CS 2304--UNIX: Assignment 4

Due Friday, March 21, 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 directory ~sedwards/assignments/assign4 on the lab machines. 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) and up to date.

In your makefile, use descriptive comments to clarify your intentions where ever necessary.

Submitting Your Answers

You are to hand in your assignment by sending an email message to the address cs2304u@ei.cs.vt.edu. To receive credit, you 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.

The body of your message must be a plain ASCII text file that contains the following:




Stephen Edwards <edwards@cs.vt.edu>
Last modified: Wed Mar 12 14:55:08 EST 1997