# file: $(ECE_1111)/labs/01/l01_03/Makefile # # revision history: # 20180823 (TD): created a debug target, moved the second command for myprog.exe # target to the debug target. # 20180803 (TD): added the second command for the myprog.exe target to produce # a file with debugging information # 20180724 (JP): initial version # # define a target for the application # all: myprog.exe # define a target to link the application # myprog.exe: myprog.o myfuncts_00.o myfuncts_01.o g++ -lm myprog.o myfuncts_00.o myfuncts_01.o -o myprog.exe # define a debug target to compile with -ggdb3 # debug: g++ -ggdb3 myprog.cc myfuncts_00.cc myfuncts_01.cc -o myprog.gdb # define targets to compile the source code # myprog.o: myprog.cc myprog.h Makefile g++ -O2 -c myprog.cc -o myprog.o myfuncts_00.o: myfuncts_00.cc myprog.h Makefile g++ -O2 -c myfuncts_00.cc -o myfuncts_00.o myfuncts_01.o: myfuncts_01.cc myprog.h Makefile g++ -O2 -c myfuncts_01.cc -o myfuncts_01.o # define a target to clean the directory # clean: rm -f myprog.o myfuncts_00.o myfuncts_01.o myfuncts.exe myprog.exe # # end of file