makefile example

The phd student is learning to use makefile to compile her codes. She thinks that putting an example here might be useful someday. And this is a good link about makefile.

ALL:

poly: polymain.o poly_func.o eliptic_poly.o eliptic_poly_main.o
        gcc -o poly polymain.o poly_func.o eliptic_poly.o eliptic_poly_main.o

polymain.o: polymain.c 
        gcc -c polymain.c 

poly_func.o: poly_func.c
        gcc -c poly_func.c

eliptic_poly.o: eliptic_poly.c
        gcc -c eliptic_poly.c

eliptic_poly_main.c: eliptic_poly_main.c
        gcc -c eliptic_poly_main.c

polyCG: polyCG.o poly_func.o eliptic_poly.o polymain.o
        gcc -o polyCG polyCG.o poly_func.o eliptic_poly.o polymain.o

polyCG.o: polyCG.c
        gcc -c polyCG.c
Advertisements