CS 1206: Assignment 4

Due Friday, March 19, 1999 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 contain your name, PID, and lab section code. 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.

Part III: Submitting Your Answers

Your submission must be a legal makefile, meaning that your name, PID, and lab section code, as well as a description of the makefile, should occur only as comments within the makefile. You are to hand in your assignment by using the Automated Grader application. To receive credit, your assignment must be submitted before the time and date listed above. It is your responsibility to successfully submit your assignment via the Automated Grader. A maximum of three submissions is allowed per student. Brief instructions are given below on how to use the Grader, but it will be helpful to visit the Automated Grader's Web page.

After connecting to the Internet, run the grader program with the command:

Acceptor_UI

A dialog box will then appear. If the title of the dialog box says "CS 1206 Grader Client" then you have the correct application; otherwise you are running the wrong client application on your local machine. Fill in your original PID, e-mail password, and Student ID. Click inside the Course Index field and select the lab section you are enrolled in. Type in HW4 for the Project Number. Enter the full path of the file to be submitted, or click on Browse to find it. After all the information is typed in, click on Submit. If your submission was successful, a window will appear stating "Your file has been submitted. A confirmation will be sent to you via e-mail." If your submission did not succeed, then a dialog box will appear describing the problem. Correct the information and resubmit. If the submission was successful, click the Quit button. After a few minutes (or sometimes hours!), you should receive an e-mail message verifying the file was received.

Also, remember that no late assignments are accepted.




Layne T. Watson <ltw@cs.vt.edu>
Last modified: Wed Mar 3 11:34:35 EST 1999