``makefile''

Unix makefiles have many useful features. For instance, you can define variables so that you do not have to retype the same information over and over again. More importantly, this makes it easy to include new changes to every entry without having to go through each one. You only need add the new entries to the line defining the appropriate variable.

Below is an example makefile which should work with last week's assignment. You should use this as an example to build upon as the starting point for this week. (Remember that the spaces before the cc's are always tab characters!)

LIBRARIES = -lm
OBJECTS   = p480.o nrutil.o
HEADERS   = p480.h nrutil.h

rk4debug: rk4debug.c $(OBJECTS) $(HEADERS)
        cc -o rk4debug rk4debug.c $(OBJECTS) $(LIBRARIES)

poisson: poisson.c $(OBJECTS) $(HEADERS)
        cc -o poisson poisson.c $(OBJECTS) $(LIBRARIES)

quicksch: quicksch.c $(OBJECTS) $(HEADERS)
        cc -o quicksch quicksch.c $(OBJECTS) $(LIBRARIES)



Tomas Arias 2006-02-13