I have a pretty simple makefile setup, I'm using mingw32 on a windows box.
Code:
CXX = g++ $(CFLAGS)
all: adventure.exe
debug: CFLAGS = -g
debug: adventure.exe
adventure.exe: main.o Dictionary.o GameManager.o Object.o Room.o
$(CXX) main.o Dictionary.o GameManager.o Object.o Room.o -o adventure.exe
main.o: main.cpp
$(CXX) -c main.cpp -o main.o
Dictionary.o: src\\Dictionary.cpp
$(CXX) -c src\\Dictionary.cpp -o Dictionary.o
GameManager.o: src\\GameManager.cpp
$(CXX) -c src\\GameManager.cpp -o GameManager.o
Object.o: src\\Object.cpp
$(CXX) -c src\\Object.cpp -o Object.o
Room.o: src\\Room.cpp
$(CXX) -c src\\Room.cpp -o Room.o
clean:
del *.o adventure.exe
This generates all the .o files in the same root folder, make all, debug, clean all work fine, and when I run make it will only rebuild the dependencies if a file has been modified like I've seen on linux.
Now if I put the object files into a folder called "objs", and rebuild it will always rebuild even if I haven't modified any of the source/headers.
Is there a trick to getting this to work with the objects in a folder on a windows box? This is driving me crazy!