More re-arranging. Not what we discussed in IRC but I think it works out better, Make can't deal with upward dependencies nicely.
1 #(C)2004-2008 SourceMM Development Team
2 # Makefile written by David "BAILOPAN" Anderson and Pavol Marko
4 OPT_FLAGS = -O3 -funroll-loops -s -pipe
5 DEBUG_FLAGS = -g -ggdb3
11 BINARY = sourcehook_test
12 OBJECTS = main.cpp sourcehook.cpp ../sourcehook_hookmangen.cpp $(shell ls -t test*.cpp)
13 HEADERS = ../sh_list.h ../sh_tinyhash.h ../sh_memory.h ../sh_string.h ../sh_vector.h ../sourcehook_impl.h ../FastDelegate.h ../sourcehook.h ../sh_memfuncinfo.h
15 ifeq "$(DEBUG)" "true"
17 CFLAGS = $(DEBUG_FLAGS)
23 CFLAGS += -Wall -Wno-non-virtual-dtor
24 # Also, enable SH_ASSERT
27 OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
32 $(BIN_DIR)/%.o: %.cpp $(HEADERS)
33 $(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $<
35 ../sourcehook.h: ../generate/sourcehook.hxx
36 (cd ../generate; ./shworker.bin iter sourcehook.hxx sourcehook.h $(MAX_PARAMS); cp sourcehook.h ..)
38 ../sourcehook.hxx: ../generate/sh_memfuncinfo.hxx
39 (cd ../generate; ./shworker.bin iter sh_memfuncinfo.hxx sh_memfuncinfo.h $(MAX_PARAMS); cp sh_memfuncino.h ..)
41 ../FastDelegate.hxx: ../generate/FastDelegate.hxx
42 (cd ../generate; ./shworker.bin iter FastDelegate.hxx FastDelegate.h $(MAX_PARAMS); cp FastDelegate.h ..)
45 $(MAKE) all DEBUG=true
49 ln -sf ../sourcehook.cpp sourcehook.cpp
53 ln -sf $(BIN_DIR)/$(BINARY) $(BINARY)
56 $(BINARY): $(OBJ_LINUX)
57 $(CPP) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -o$(BIN_DIR)/$(BINARY)
61 rm -rf Release/$(BINARY)
63 rm -rf Debug/$(BINARY)