CS 1206: Assignment 4

Due Friday, March 6 by 5pm

100 Points




Writing A Makefile

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:

Create a directory of your own and copy all of these files there. Then create your makefile (name it ``Makefile'') in that directory.

The Details of Your Makefile

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:

Your 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:

The "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.

Submitting Your Answers

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:




Layne T. Watson <ltw@cs.vt.edu>
Last modified: Wed Jan 28 21:07:55 EST 1998