2005-09-24 17:56:40 +02:00
|
|
|
#(C)2004-2005 SourceMM Development Team
|
2005-10-03 19:20:22 +02:00
|
|
|
# Makefile written by David "BAILOPAN" Anderson and Pavol Marko
|
2005-05-01 14:36:48 +02:00
|
|
|
|
2005-09-24 17:56:40 +02:00
|
|
|
OPT_FLAGS = -O3 -funroll-loops -s -pipe
|
|
|
|
DEBUG_FLAGS = -g -ggdb3
|
|
|
|
CPP = gcc
|
|
|
|
LINK = -lstdc++
|
|
|
|
INCLUDE = -I. -I..
|
2005-10-03 19:20:22 +02:00
|
|
|
MAX_PARAMS=20
|
|
|
|
|
|
|
|
BINARY = sourcehook_test
|
|
|
|
OBJECTS = main.cpp sourcehook.cpp $(shell ls -t test*.cpp)
|
|
|
|
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
|
2005-05-05 15:13:16 +02:00
|
|
|
|
2005-09-24 17:56:40 +02:00
|
|
|
ifeq "$(DEBUG)" "true"
|
|
|
|
BIN_DIR = Debug
|
|
|
|
CFLAGS = $(DEBUG_FLAGS)
|
|
|
|
else
|
|
|
|
BIN_DIR = Release
|
|
|
|
CFLAGS = $(OPT_FLAGS)
|
|
|
|
endif
|
2005-05-01 14:36:48 +02:00
|
|
|
|
2005-10-03 19:20:22 +02:00
|
|
|
CFLAGS += -Wall
|
|
|
|
# Also, enable SH_ASSERT
|
|
|
|
CFLAGS += -DSH_DEBUG
|
2005-05-05 15:13:16 +02:00
|
|
|
|
2005-09-24 17:56:40 +02:00
|
|
|
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
|
2005-10-03 19:20:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
default: all
|
2005-05-05 16:00:08 +02:00
|
|
|
|
2005-10-03 19:20:22 +02:00
|
|
|
$(BIN_DIR)/%.o: %.cpp $(HEADERS)
|
2005-09-24 17:56:40 +02:00
|
|
|
$(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $<
|
2005-05-01 14:36:48 +02:00
|
|
|
|
2005-10-03 19:20:22 +02:00
|
|
|
../sourcehook.h: ../generate/sourcehook.hxx
|
2006-08-09 09:42:16 +02:00
|
|
|
(cd ../generate; ./shworker.bin iter sourcehook.hxx sourcehook.h $(MAX_PARAMS); cp sourcehook.h ..)
|
2005-10-03 19:20:22 +02:00
|
|
|
|
|
|
|
../sourcehook.hxx: ../generate/sh_memfuncinfo.hxx
|
2006-08-09 09:42:16 +02:00
|
|
|
(cd ../generate; ./shworker.bin iter sh_memfuncinfo.hxx sh_memfuncinfo.h $(MAX_PARAMS); cp sh_memfuncino.h ..)
|
2005-10-03 19:20:22 +02:00
|
|
|
|
|
|
|
../FastDelegate.hxx: ../generate/FastDelegate.hxx
|
2006-08-09 09:42:16 +02:00
|
|
|
(cd ../generate; ./shworker.bin iter FastDelegate.hxx FastDelegate.h $(MAX_PARAMS); cp FastDelegate.h ..)
|
2005-10-03 19:20:22 +02:00
|
|
|
|
|
|
|
debug:
|
|
|
|
$(MAKE) all DEBUG=true
|
|
|
|
|
2005-09-24 17:56:40 +02:00
|
|
|
all:
|
|
|
|
mkdir -p $(BIN_DIR)
|
|
|
|
ln -sf ../sourcehook.cpp sourcehook.cpp
|
2005-10-03 19:20:22 +02:00
|
|
|
$(MAKE) $(BINARY)
|
2005-09-24 17:56:40 +02:00
|
|
|
rm -f $(BINARY)
|
2005-10-03 19:20:22 +02:00
|
|
|
rm -f sourcehook.cpp
|
2005-09-24 17:56:40 +02:00
|
|
|
ln -sf $(BIN_DIR)/$(BINARY) $(BINARY)
|
|
|
|
|
|
|
|
|
2005-10-03 19:20:22 +02:00
|
|
|
$(BINARY): $(OBJ_LINUX)
|
|
|
|
$(CPP) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -o$(BIN_DIR)/$(BINARY)
|
2005-09-24 17:56:40 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf Release/*.o
|
|
|
|
rm -rf Release/$(BINARY)
|
|
|
|
rm -rf Debug/*.o
|
|
|
|
rm -rf Debug/$(BINARY)
|