core/logic/Makefile
author David Anderson <dvander@alliedmods.net>
Fri May 14 21:06:06 2010 -0700 (2010-05-14)
changeset 3008 660ceb40e6ee
parent 3006 39a4611feaba
child 3009 a1f52cb232d3
permissions -rw-r--r--
Moved handle natives from core to logic (bug 4406 part 9, r=ds).
     1 # (C)2004-2008 SourceMod Development Team
     2 # Makefile written by David "BAILOPAN" Anderson
     3 
     4 SMSDK = ../..
     5 MMSOURCE17 = ../../../mmsource-1.7
     6 
     7 #####################################
     8 ### EDIT BELOW FOR OTHER PROJECTS ###
     9 #####################################
    10 
    11 BINARY = sourcemod.logic.so
    12 
    13 OBJECTS = \
    14 	common_logic.cpp	\
    15 	smn_adt_array.cpp	\
    16 	smn_sorting.cpp		\
    17 	smn_maplists.cpp	\
    18 	smn_adt_stack.cpp	\
    19 	thread/ThreadWorker.cpp \
    20 	thread/BaseWorker.cpp 	\
    21 	thread/PosixThreads.cpp \
    22 	ThreadSupport.cpp	\
    23 	smn_float.cpp		\
    24 	TextParsers.cpp		\
    25 	smn_textparse.cpp	\
    26 	smn_adt_trie.cpp	\
    27 	Profiler.cpp		\
    28 	smn_functions.cpp   \
    29 	sm_crc32.cpp		\
    30 	smn_timers.cpp		\
    31 	MemoryUtils.cpp		\
    32 	smn_admin.cpp		\
    33 	smn_banning.cpp		\
    34 	stringutil.cpp		\
    35 	Translator.cpp		\
    36 	PhraseCollection.cpp \
    37 	smn_lang.cpp		\
    38 	smn_string.cpp		\
    39 	smn_handles.cpp		\
    40 	smn_players.cpp
    41 
    42 ##############################################
    43 ### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
    44 ##############################################
    45 
    46 C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -pipe -fno-strict-aliasing
    47 C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
    48 C_GCC4_FLAGS = -fvisibility=hidden
    49 CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
    50 CPP = gcc
    51 
    52 LINK += -lpthread -static-libgcc
    53 	
    54 INCLUDE += -I. -I$(MMSOURCE17)/core/sourcehook -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn
    55 
    56 CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
    57 	-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror \
    58 	-Wno-uninitialized -mfpmath=sse -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -DSM_DEFAULT_THREADER -m32 \
    59 	-DSM_LOGIC
    60 CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
    61 
    62 ################################################
    63 ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
    64 ################################################
    65 
    66 ifeq "$(DEBUG)" "true"
    67 	BIN_DIR = Debug
    68 	CFLAGS += $(C_DEBUG_FLAGS)
    69 else
    70 	BIN_DIR = Release
    71 	CFLAGS += $(C_OPT_FLAGS)
    72 endif
    73 
    74 GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
    75 ifeq "$(GCC_VERSION)" "4"
    76 	CFLAGS += $(C_GCC4_FLAGS)
    77 	CPPFLAGS += $(CPP_GCC4_FLAGS)
    78 endif
    79 
    80 OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
    81 OBJ_LINUX := $(OBJ_LINUX:%.c=$(BIN_DIR)/%.o)
    82 
    83 $(BIN_DIR)/%.o: %.cpp
    84 	$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
    85 
    86 $(BIN_DIR)/%.o: %.c
    87 	$(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $<
    88 
    89 all: 
    90 	mkdir -p $(BIN_DIR)/thread
    91 	$(MAKE) -f Makefile sourcemod
    92 
    93 sourcemod: $(OBJ_LINUX)
    94 	$(CPP) $(INCLUDE) $(OBJ_LINUX) $(LINK) -m32 -shared -ldl -lm -o $(BIN_DIR)/$(BINARY)
    95 
    96 debug:
    97 	$(MAKE) -f Makefile all DEBUG=true
    98 
    99 default: all
   100 
   101 clean: 
   102 	rm -rf $(BIN_DIR)/*.o
   103 	rm -rf $(BIN_DIR)/thread/*.o
   104 	rm -rf $(BIN_DIR)/$(BINARY)