sourcehook/test/Makefile
changeset 117 e322da4af2d2
parent 113 3146a1956be9
child 235 df7d7d108475
     1.1 --- a/sourcehook/test/Makefile	Thu Sep 29 23:05:01 2005 +0000
     1.2 +++ b/sourcehook/test/Makefile	Mon Oct 03 17:20:22 2005 +0000
     1.3 @@ -1,16 +1,16 @@
     1.4  #(C)2004-2005 SourceMM Development Team
     1.5 -# Makefile written by David "BAILOPAN" Anderson
     1.6 +# Makefile written by David "BAILOPAN" Anderson and Pavol Marko
     1.7  
     1.8  OPT_FLAGS = -O3 -funroll-loops -s -pipe
     1.9  DEBUG_FLAGS = -g -ggdb3
    1.10  CPP = gcc
    1.11 -BINARY = sourcehook_test
    1.12 -
    1.13 -OBJECTS = test1.cpp test2.cpp test3.cpp test4.cpp testbail.cpp testbail2.cpp testlist.cpp main.cpp sourcehook.cpp
    1.14 +LINK = -lstdc++
    1.15 +INCLUDE = -I. -I..
    1.16 +MAX_PARAMS=20
    1.17  
    1.18 -LINK = -lstdc++
    1.19 -
    1.20 -INCLUDE = -I. -I..
    1.21 +BINARY = sourcehook_test
    1.22 +OBJECTS = main.cpp sourcehook.cpp $(shell ls -t test*.cpp)
    1.23 +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
    1.24  
    1.25  ifeq "$(DEBUG)" "true"
    1.26  	BIN_DIR = Debug
    1.27 @@ -20,28 +20,42 @@
    1.28  	CFLAGS = $(OPT_FLAGS)
    1.29  endif
    1.30  
    1.31 -# CFLAGS += 
    1.32 +CFLAGS += -Wall
    1.33 +# Also, enable SH_ASSERT
    1.34 +CFLAGS += -DSH_DEBUG
    1.35  
    1.36  OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
    1.37 +	
    1.38  
    1.39 -$(BIN_DIR)/%.o: %.cpp
    1.40 +default: all
    1.41 +
    1.42 +$(BIN_DIR)/%.o: %.cpp $(HEADERS)
    1.43  	$(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $<
    1.44  
    1.45 +../sourcehook.h: ../generate/sourcehook.hxx
    1.46 +	(cd ../generate; ./shworker.bin iter $(MAX_PARAMS) sourcehook.hxx sourcehook.h; cp sourcehook.h ..)
    1.47 +
    1.48 +../sourcehook.hxx: ../generate/sh_memfuncinfo.hxx
    1.49 +	(cd ../generate; ./shworker.bin iter $(MAX_PARAMS) sh_memfuncinfo.hxx sh_memfuncinfo.h; cp sh_memfuncino.h ..)
    1.50 +
    1.51 +../FastDelegate.hxx: ../generate/FastDelegate.hxx
    1.52 +	(cd ../generate; ./shworker.bin iter $(MAX_PARAMS) FastDelegate.hxx FastDelegate.h; cp FastDelegate.h ..)
    1.53 +	
    1.54 +debug:
    1.55 +	$(MAKE) all DEBUG=true
    1.56 +	
    1.57  all:
    1.58  	mkdir -p $(BIN_DIR)
    1.59  	ln -sf ../sourcehook.cpp sourcehook.cpp
    1.60 -	$(MAKE) sourcehook_test
    1.61 +	$(MAKE) $(BINARY)
    1.62  	rm -f $(BINARY)
    1.63 +	rm -f sourcehook.cpp
    1.64  	ln -sf $(BIN_DIR)/$(BINARY) $(BINARY)
    1.65  
    1.66 -sourcehook_test: $(OBJ_LINUX)
    1.67 +
    1.68 +$(BINARY): $(OBJ_LINUX)
    1.69  	$(CPP) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -o$(BIN_DIR)/$(BINARY)
    1.70  
    1.71 -debug:	
    1.72 -	$(MAKE) all DEBUG=true
    1.73 -
    1.74 -default: all
    1.75 -
    1.76  clean:
    1.77  	rm -rf Release/*.o
    1.78  	rm -rf Release/$(BINARY)