2005-02-15 14:39:36 +00:00
|
|
|
MODNAME = sqlite_amxx
|
|
|
|
SRCFILES = sqlite_amx.cpp sqlite.cpp amxxmodule.cpp
|
2005-02-15 14:11:01 +00:00
|
|
|
|
2005-08-11 19:06:54 +00:00
|
|
|
EXTRA_INCLUDEDIRS = -I../../amxmodx -Isqlite-source-3_2_2
|
2005-02-15 14:11:01 +00:00
|
|
|
|
|
|
|
EXTRA_FLAGS = -Dstrcmpi=strcasecmp
|
|
|
|
|
2005-02-15 14:39:36 +00:00
|
|
|
SDKTOP=../../hlsdk
|
|
|
|
METADIR=../../metamod/metamod
|
2005-02-15 14:11:01 +00:00
|
|
|
|
|
|
|
SDKSRC=$(SDKTOP)/SourceCode
|
|
|
|
OBJDIR_LINUX=obj.linux
|
|
|
|
OBJDIR_WIN32=obj.win32
|
|
|
|
SRCDIR=.
|
|
|
|
|
|
|
|
ifdef windir
|
|
|
|
OS=WIN32
|
|
|
|
else
|
|
|
|
OS=LINUX
|
|
|
|
endif
|
|
|
|
|
2005-02-15 14:39:36 +00:00
|
|
|
CC_LINUX=gcc-2.95
|
2005-02-15 14:11:01 +00:00
|
|
|
ifeq "$(OS)" "WIN32"
|
|
|
|
CC_WIN32=gcc
|
|
|
|
LD_WINDLL=dllwrap
|
|
|
|
DEFAULT=win32
|
|
|
|
CLEAN=clean_win32
|
|
|
|
else
|
|
|
|
CC_WIN32=/usr/local/cross-tools/i386-mingw32msvc/bin/gcc
|
|
|
|
LD_WINDLL=/usr/local/cross-tools/bin/i386-mingw32msvc-dllwrap
|
|
|
|
DEFAULT=linux win32
|
|
|
|
CLEAN=clean_both
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LIBFILE_LINUX = $(MODNAME)_i386.so
|
|
|
|
LIBFILE_WIN32 = $(MODNAME).dll
|
|
|
|
TARGET_LINUX = $(OBJDIR_LINUX)/$(LIBFILE_LINUX)
|
|
|
|
TARGET_WIN32 = $(OBJDIR_WIN32)/$(LIBFILE_WIN32)
|
|
|
|
|
|
|
|
FILES_ALL = *.cpp *.h [A-Z]* *.rc
|
|
|
|
ifeq "$(OS)" "LINUX"
|
|
|
|
ASRCFILES := $(shell ls -t $(SRCFILES))
|
|
|
|
else
|
|
|
|
ASRCFILES := $(shell dir /b)
|
|
|
|
endif
|
|
|
|
OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
|
|
|
|
OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
|
|
|
|
|
|
|
|
CCOPT = -march=i386 -O2 -s -DNDEBUG
|
|
|
|
|
|
|
|
INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS)
|
2005-02-15 14:39:36 +00:00
|
|
|
CFLAGS=-Wall -Wno-unknown-pragmas -march=i386
|
2005-02-15 14:11:01 +00:00
|
|
|
ODEF = -DOPT_TYPE=\"optimized\"
|
|
|
|
CFLAGS:=$(CCOPT) $(CFLAGS) $(ODEF) $(EXTRA_FLAGS)
|
|
|
|
|
|
|
|
DO_CC_LINUX=$(CC_LINUX) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $<
|
|
|
|
DO_CC_WIN32=$(CC_WIN32) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $<
|
2005-02-15 14:39:36 +00:00
|
|
|
LINK_LINUX=$(CC_LINUX) $(CFLAGS) -shared -lc -lgcc -ldl -lm $(OBJ_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@
|
2005-02-15 14:11:01 +00:00
|
|
|
LINK_WIN32=$(LD_WINDLL) -mwindows --def $(MODNAME).def --add-stdcall-alias $(OBJ_WIN32) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@
|
|
|
|
|
|
|
|
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp
|
|
|
|
$(DO_CC_LINUX)
|
|
|
|
|
|
|
|
$(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.cpp
|
|
|
|
$(DO_CC_WIN32)
|
|
|
|
|
|
|
|
default: $(DEFAULT)
|
|
|
|
|
|
|
|
$(TARGET_LINUX): $(OBJDIR_LINUX) $(OBJ_LINUX)
|
|
|
|
$(LINK_LINUX)
|
|
|
|
|
|
|
|
$(TARGET_WIN32): $(OBJDIR_WIN32) $(OBJ_WIN32)
|
|
|
|
$(LINK_WIN32)
|
|
|
|
|
|
|
|
$(OBJDIR_LINUX):
|
|
|
|
mkdir $@
|
|
|
|
|
|
|
|
$(OBJDIR_WIN32):
|
|
|
|
mkdir $@
|
|
|
|
|
|
|
|
win32: $(TARGET_WIN32)
|
|
|
|
|
|
|
|
linux: $(TARGET_LINUX)
|
|
|
|
|
|
|
|
clean: $(CLEAN)
|
|
|
|
|
|
|
|
clean_both:
|
|
|
|
-rm -f $(OBJDIR_LINUX)/*
|
|
|
|
-rm -f $(OBJDIR_WIN32)/*
|
|
|
|
|
|
|
|
clean_win32:
|
|
|
|
del /q $(OBJDIR_WIN32)
|
|
|
|
|