Below is the makefile. My problem is that if I change only myclass.cpp, the changes are not pulled in. What am I doing wrong in this build process?
Thanks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
CC=g++
LN=$(CC)
mainbin : main myclass.o
@echo "a test of this stuff"
@echo "compiling and linking the code"
$(LN) -o mkfiletest main
main : mkfiletest.cpp
$(CC) -Wall -c mkfiletest.cpp
myclass.o : myclass.h myclass.cpp
$(CC) -Wall -c myclass.h
$(CC) -Wall -c myclass.cpp
I can't be of any help because I know little about makefiles. But if you want to go easy on yourself, you can just use an IDE. Then you don't have to worry about this crap.
Additionally, why are you compiling myclass.h ? If that header file is #include 'd in myclass.cpp, there's no need at all for you to be compiling it into an object file.
I'm not sure you need a lot of your makefile; what happens if you just have