# Makefile for multiple files # Ray S. Babcock, CS210, MSU-Bozeman # 1/15/04 # # This is an example of a multiple file makefile. # In this case, we have the following source files. # # mult_main.cpp # main.h # struct.h # proto.h # mult_fun1.cpp # mult_fun2.cpp # print_struct.cpp # # To rebuild this package, you only need type "make". # It compiles the .cpp files into .o files and then # links the .o files into a run image called "multiple". # OBJS = mult_main.o mult_fun1.o mult_fun2.o print_struct.o CC = g++ multiple: $(OBJS) $(CC) -o multiple $(OBJS) mult_main.o: mult_main.cpp main.h struct.h proto.h $(CC) -c mult_main.cpp mult_fun1.o: mult_fun1.cpp $(CC) -c mult_fun1.cpp mult_fun2.o: mult_fun2.cpp main.h struct.h $(CC) -c mult_fun2.cpp print_struct.o: print_struct.cpp main.h struct.h $(CC) -c print_struct.cpp clean: rm *.o multiple