Your assignment is to write a Makefile for a C program.
The program is called ``flip''--a program that
converts the line-ending characters on plain text files from
MS-DOS conventions (CR-LF pairs) to Unix conventions (LF only)
and vice versa.
The source files for flip are available in the tar file
assign4.tar on ei.cs.vt.edu. The source files are:
flip.1 flip.c flip.h getopt.cCreate a directory of your own and copy all of these files there. Then create your makefile (name it ``
Makefile'') in that
directory.
Make sure you start off your makefile with a section of comments that describe its purpose and who wrote it. Then include target directives for every derived file produced during the compilation process (i.e., each program, each object file, and any other intermediate files produced during compilation). Make sure that each directive also lists all files that the derived file depends on in its dependency list.
The basic steps in compiling flip are:
gcc -DBSD -DNDEBUG -O -c flip.c gcc -DBSD -DNDEBUG -O -c getopt.c gcc -s -o flip flip.o getopt.oYour makefile should be written so that ``
make flip''
carries out these commands. Each command above generates a separate
derived file, and so should be placed in a separate directive.
In addition, your makefile should be written so that ``make
man'' carries out the following commands:
nroff -man flip.1 > flip.manThe "
flip.1" file is the source file for the command's
man page. Nroff is a program that formats the text
of the man page. The command shown above formats the man page into
a human-readable form and places the output in the file
"flip.man".
Finally, your makefile should be written so that when
make is invoked with no target specified on the command
line, it carries out both sets of commands listed above,
bringing everything (both the program and its formatted man page)
up to date.
In your makefile, use descriptive comments to clarify your intentions whereever necessary.
You are to hand in your assignment by sending an email message to the address cs1206@ei.cs.vt.edu. To receive credit, your mail message must be received by this account by the time and date listed above. It is your responsibility to successfully submit your assignment via email (remember that you will receive an auto-reply by the system when your message has been received successfully). Also, send yourself a copy for future reference. The messsage must be a plain ASCII text file, with no attachments, and in exactly the format defined below. Do not insert any extra notes or explanations.
The body of your message must be a plain ASCII text file that contains the following:
Makefile you wrote.