sourcepawn/jit/Makefile.shell
author David Anderson <danderson@mozilla.com>
Thu Aug 08 09:41:24 2013 -0700 (2013-08-08)
changeset 3977 fca2b54741ca
child 3979 bdad6d9c8351
permissions -rw-r--r--
Refactor the JIT to use a newer, simpler macro assembler. (bug 5827, r=ann)
danderson@3977
     1
# (C)2004-2008 SourceMod Development Team
danderson@3977
     2
# Makefile written by David "BAILOPAN" Anderson
danderson@3977
     3
danderson@3977
     4
SMSDK = ../..
danderson@3977
     5
MMSOURCE17 = ../../../mmsource-1.7
danderson@3977
     6
danderson@3977
     7
#####################################
danderson@3977
     8
### EDIT BELOW FOR OTHER PROJECTS ###
danderson@3977
     9
#####################################
danderson@3977
    10
danderson@3977
    11
PROJECT = spshell
danderson@3977
    12
danderson@3977
    13
OBJECTS = dll_exports.cpp 	\
danderson@3977
    14
	x86/jit_x86.cpp			\
danderson@3977
    15
	sp_vm_basecontext.cpp	\
danderson@3977
    16
	sp_vm_engine.cpp	\
danderson@3977
    17
	sp_vm_function.cpp	\
danderson@3977
    18
	engine2.cpp			\
danderson@3977
    19
	BaseRuntime.cpp		\
danderson@3977
    20
	jit_function.cpp	\
danderson@3977
    21
	opcodes.cpp		\
danderson@3977
    22
	md5/md5.cpp			\
danderson@3977
    23
	zlib/adler32.c		\
danderson@3977
    24
	zlib/compress.c		\
danderson@3977
    25
	zlib/crc32.c		\
danderson@3977
    26
	zlib/deflate.c		\
danderson@3977
    27
	zlib/gzio.c			\
danderson@3977
    28
	zlib/infback.c		\
danderson@3977
    29
	zlib/inffast.c		\
danderson@3977
    30
	zlib/inflate.c		\
danderson@3977
    31
	zlib/inftrees.c		\
danderson@3977
    32
	zlib/trees.c		\
danderson@3977
    33
	zlib/uncompr.c		\
danderson@3977
    34
	zlib/zutil.c		\
danderson@3977
    35
danderson@3977
    36
OBJECTS += ../../knight/shared/KeCodeAllocator.cpp
danderson@3977
    37
danderson@3977
    38
##############################################
danderson@3977
    39
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
danderson@3977
    40
##############################################
danderson@3977
    41
danderson@3977
    42
C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -pipe -fno-strict-aliasing
danderson@3977
    43
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
danderson@3977
    44
C_GCC4_FLAGS = -fvisibility=hidden
danderson@3977
    45
CXX_GCC4_FLAGS = -fvisibility-inlines-hidden
danderson@3977
    46
CXX = c++
danderson@3977
    47
CC = cc
danderson@3977
    48
danderson@3977
    49
LINK = -m32 -lm
danderson@3977
    50
danderson@3977
    51
INCLUDE = -I. -I.. -I$(SMSDK)/public -I$(SMSDK)/public/jit -I$(SMSDK)/public/jit/x86 \
danderson@3977
    52
	-I$(SMSDK)/public/sourcepawn -I$(MMSOURCE17)/core/sourcehook -I$(SMSDK)/knight/shared -Ix86
danderson@3977
    53
danderson@3977
    54
CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
danderson@3977
    55
	-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -DHAVE_STDINT_H \
danderson@3977
    56
	-m32 -Wno-uninitialized -Werror -DSPSHELL -ggdb3 -Wno-unused
danderson@3977
    57
CXXFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti -Wno-delete-non-virtual-dtor
danderson@3977
    58
danderson@3977
    59
################################################
danderson@3977
    60
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
danderson@3977
    61
################################################
danderson@3977
    62
danderson@3977
    63
ifeq "$(DEBUG)" "true"
danderson@3977
    64
	BIN_DIR = Debug.shell
danderson@3977
    65
	CFLAGS += $(C_DEBUG_FLAGS)
danderson@3977
    66
else
danderson@3977
    67
	BIN_DIR = Release.shell
danderson@3977
    68
	CFLAGS += $(C_OPT_FLAGS)
danderson@3977
    69
endif
danderson@3977
    70
danderson@3977
    71
GCC_VERSION := $(shell $(CXX) -dumpversion >&1 | cut -b1)
danderson@3977
    72
ifeq "$(GCC_VERSION)" "4"
danderson@3977
    73
	CFLAGS += $(C_GCC4_FLAGS)
danderson@3977
    74
	CXXFLAGS += $(CXX_GCC4_FLAGS)
danderson@3977
    75
endif
danderson@3977
    76
danderson@3977
    77
OBJ_LINUX := $(OBJECTS:../../knight/shared/%.cpp=$(BIN_DIR)/knight/%.o)
danderson@3977
    78
OBJ_LINUX := $(OBJ_LINUX:%.cpp=$(BIN_DIR)/%.o)
danderson@3977
    79
OBJ_LINUX := $(OBJ_LINUX:%.c=$(BIN_DIR)/%.o)
danderson@3977
    80
danderson@3977
    81
default: all
danderson@3977
    82
danderson@3977
    83
$(BIN_DIR)/%.o: %.c
danderson@3977
    84
	$(CC) $(INCLUDE) $(CFLAGS) -o $@ -c $<
danderson@3977
    85
danderson@3977
    86
$(BIN_DIR)/%.o: %.cpp
danderson@3977
    87
	$(CXX) $(INCLUDE) $(CFLAGS) $(CXXFLAGS) -o $@ -c $<
danderson@3977
    88
danderson@3977
    89
$(BIN_DIR)/knight/%.o: ../../knight/shared/%.cpp
danderson@3977
    90
	$(CXX) $(INCLUDE) $(CFLAGS) $(CXXFLAGS) -o $@ -c $<
danderson@3977
    91
danderson@3977
    92
all:
danderson@3977
    93
	mkdir -p $(BIN_DIR)/x86
danderson@3977
    94
	mkdir -p $(BIN_DIR)/md5
danderson@3977
    95
	mkdir -p $(BIN_DIR)/zlib
danderson@3977
    96
	mkdir -p $(BIN_DIR)/knight
danderson@3977
    97
	$(MAKE) -f Makefile.shell jit
danderson@3977
    98
danderson@3977
    99
jit: $(OBJ_LINUX)
danderson@3977
   100
	$(CXX) $(INCLUDE) $(OBJ_LINUX) $(LINK) -o $(BIN_DIR)/$(PROJECT)
danderson@3977
   101
danderson@3977
   102
debug:
danderson@3977
   103
	$(MAKE) -f Makefile.shell all DEBUG=true
danderson@3977
   104
danderson@3977
   105
clean:
danderson@3977
   106
	rm -f $(BIN_DIR)/x86/*.o
danderson@3977
   107
#	rm -rf $(BIN_DIR)/zlib/*.o
danderson@3977
   108
#	rm -rf $(BIN_DIR)/knight/*.o
danderson@3977
   109
	rm -f $(BIN_DIR)/*.o
danderson@3977
   110
	rm -f $(BIN_DIR)/$(PROJECT)
danderson@3977
   111