Hello everyone. I am currently studying programming and am really confused when I come to this level. It is to link object files together using a "makefile". I just wanted to know if I am correct in my understanding so far. If I am wrong in my conclusions please cite me at where I am wrong.
I created a windows program using "Bloodshed DevC++" and it comes with MingW32 library and a GNU make program (I'm assuming on this). The headers I have created for a complex windows program are "Engine.h" and "EngineMain.h". "Engine.h" which contains the class, prototypes, and global variables. "EngineMain.h" which contains the includes to "Engine.h", "Windowsx.h" and to "Windows.h".
To my understanding a "makefile" is a text file with the extension ".mak" or ".mk" generated by using the "edit" program in command prompt. From my resources, if anyone uses Blodshed DevC++, I am suppose to tell the compiler to use my custom "makefile" under "Project Option->Makefile tab". And under the "Program Option->Parameter tab" type the command "--file=Makefile.mak" in the linker box. Am I correct in this procedure?
Please Note that the word "tab" enclosed in paranthesis indicate that they are tab characters in the text file as per "makefile" rule.
My "Makefile" contains this:
EngineMain : EngineMain.o Engine.o
(tab)gcc -o EngineMain.o Engine.o
EngineMain.o : EngineMain.cpp Engine.h
(tab)gcc -c -g EngineMain.cpp
Engine.o : Engine.cpp Engine.h
(tab)gcc -c -g Engine.cpp
Thanks in advance and be praised your extremely good fortunes.