core/sourcehook/test/Makefile
author Scott Ehlert <ds@alliedmods.net>
Thu Jul 01 02:43:22 2010 -0500 (2010-07-01)
changeset 722 78f730f91439
parent 685 522727461c0d
child 733 2365240861a2
permissions -rw-r--r--
Fixed problem on OBV where alternately loaded plugins (CreateInterface_MMS) could be incorrectly told they were on the OB engine (bug 4491, r=dvander).

This only happened when there was more than one plugin that loaded this way. And the first plugin to load had to fail on OBV first so that OB could be tried. It was being permanently set to OB for future plugin loads and this caused problems.
     1 # (C)2004-2009 Metamod:Source Development Team
     2 # Makefile written by David "BAILOPAN" Anderson and Pavol Marko
     3 
     4 OPT_FLAGS = -O3 -funroll-loops -s -pipe
     5 DEBUG_FLAGS = -g -ggdb3
     6 CPP = gcc
     7 LINK = -lstdc++
     8 INCLUDE = -I. -I..
     9 MAX_PARAMS=20
    10 
    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
    14 
    15 ifeq "$(DEBUG)" "true"
    16 	BIN_DIR = Debug
    17 	CFLAGS = $(DEBUG_FLAGS)
    18 else
    19 	BIN_DIR = Release
    20 	CFLAGS = $(OPT_FLAGS)
    21 endif
    22 
    23 CFLAGS += -Wall -Wno-non-virtual-dtor
    24 # Also, enable SH_ASSERT
    25 CFLAGS += -DSH_DEBUG
    26 
    27 OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
    28 	
    29 
    30 default: all
    31 
    32 $(BIN_DIR)/%.o: %.cpp $(HEADERS)
    33 	$(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $<
    34 
    35 ../sourcehook.h: ../generate/sourcehook.hxx
    36 	(cd ../generate; ./shworker.bin iter sourcehook.hxx sourcehook.h $(MAX_PARAMS); cp sourcehook.h ..)
    37 
    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 ..)
    40 
    41 ../FastDelegate.hxx: ../generate/FastDelegate.hxx
    42 	(cd ../generate; ./shworker.bin iter FastDelegate.hxx FastDelegate.h $(MAX_PARAMS); cp FastDelegate.h ..)
    43 	
    44 debug:
    45 	$(MAKE) all DEBUG=true
    46 	
    47 all:
    48 	mkdir -p $(BIN_DIR)
    49 	ln -sf ../sourcehook.cpp
    50 	ln -sf ../sourcehook_hookmangen.cpp
    51 	$(MAKE) $(BINARY)
    52 	rm -f $(BINARY)
    53 	rm -f sourcehook.cpp
    54 	rm -f sourcehook_hookmangen.cpp
    55 	ln -sf $(BIN_DIR)/$(BINARY) $(BINARY)
    56 
    57 
    58 $(BINARY): $(OBJ_LINUX)
    59 	$(CPP) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -o $(BIN_DIR)/$(BINARY)
    60 
    61 clean:
    62 	rm -rf Release/*.o
    63 	rm -rf Release/$(BINARY)
    64 	rm -rf Debug/*.o
    65 	rm -rf Debug/$(BINARY)