Unformatted text preview: variable on the command line. Approach 2: Of course, you also can prepare a simple makefile (available at: http://www.eng.auburn.edu/~xqin/courses/comp2710/makefile ) as follows: xzq0001_hw1: xzq0001_hw1.cpp g++ xzq0001_hw1.cpp -o xzq0001_hw1 clean: rm -f *.o xzq0001_hw1 where xzq_0001 is my auburn ID. Suppose you have two files "xzq0001_hw1.cpp" and “makefile” in the current directory, then you will have: $ ls makefile xzq001_hw1.cpp $ make g++ xzq0001_hw1 -o xzq0001_hw1 make is smart enough to use the first rule in the Makefile as the default action, so: $ ls Makefile xzq0001_hw1 xzq0001_hw1.o References: http://wlug.org.nz/MakefileHowto...
View Full Document
This note was uploaded on 12/07/2011 for the course COMP 2710 taught by Professor Staff during the Fall '08 term at Auburn University.
- Fall '08