MakeFile?

Community Forums/General Help/MakeFile?

JoshK(Posted 2010) [#1]
Does anyone have experience using GNU make and makefiles? I get this error when running make.exe:
C:\Project>make
cc myprog.o -o myprog
process_begin: CreateProcess(NULL, cc myprog.o -o myprog, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [myprog] Error 2



Canardian(Posted 2010) [#2]
You can do:
myprog: myprog.o
	g++ -o myprog myprog.o
Then it generates a default myprog.o target and compiles it first.

Or you can specify also your own myprog.o target, since you usually want to include some additional optimization parameters while compiling (-c) the C++ source code:
myprog: myprog.o
	g++ -o myprog myprog.o

myprog.o: myprog.cpp
	g++ -c -O6 myprog.cpp



JoshK(Posted 2010) [#3]
Thanks!