You are suppose to know how to write a Makefile
already. If you don't, you should learn it as soon as
possible because your Makefile must work in all
your project submissions. There are a few tutorials on
make on the web. Here are links to some of them.
I have not really read through these pages so I cannot
guarantee their correctness.
Since I don't track these links, if they have moved, just google "makefile tutorial".
Please be aware that if you transfer a Makefile from a Windows
environment to a UNIX environment, chances are, it will not work.
The reason is that a line in a text file in Windows ends with "\r\n"
while a line in a text file in UNIX ends with just "\n". The extra
"\r" can confuse make on UNIX machines. But I'm sure you can
write a small program to fix that.
Compiling Your Code
If you are writing your program in C, you should use gcc
as your compiler, rather than cc. Gcc supports
function prototypes and other ANSI extensions, which you should
use in your programs.
The option -Wall turns on most of the useful
gcc warnings.
Compiling with this option will find many simple mistakes in your programs.
On many platforms you also need to link the network and socket
libraries to your program.
We will evaluate your submission by copying all the files you have
submitted into an empty directory and then type the following command:
make(If an individual project spec has more specific way of producing executables, you must follow it.) Minor variation (such as using gmake) is allowed, but you must describe in details how to compile your code near the top of your README file. Requiring a visual tool to compile your code is not allowed. If this does not produce the desired executable(s), you will probably lose a lot of points. You may lose quite a few points if the grader has to debug and modify your Makefile in order to get your code to compile. How many points you will lose depends on how hard it is for the grader to get your Makefile to work. You may even receive a score of zero if we cannot get your Makefile to work. Here are some additional requirements (sorry about redundancy with the project specs):
When you compile, if you get warning messages saying that certain .c or .h file has no newline at end of file, then it's cause by the same problem (i.e., you have created these files in Windows). Please run "dos2unix" to convert such a DOS/Windows text file into a Unix text file.
A README file is the documentation of your submission.
The filename you must use for a README is "x-README.txt" where
"x" is an appropriate name for the assignment. You are expected to download
a README file template from the spec, edit it with a text editor by supplying
all the required information, and then include it with your submission.
Such a README file includes the following sections:
How do you make sure that make would work? It's actually
very simple.
|