From 0bea18ca9f4a4e50514d542c477384b48f2ab758 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 24 Mar 2004 06:33:03 +0000 Subject: [PATCH] New makefile --- dlls/cstrike/Makefile | 28 ++++++++++------------------ dlls/cstrike/cstrike.h | 2 +- dlls/fun/Makefile | 4 ++-- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/dlls/cstrike/Makefile b/dlls/cstrike/Makefile index a4334dd3..dc72c2f8 100755 --- a/dlls/cstrike/Makefile +++ b/dlls/cstrike/Makefile @@ -1,5 +1,5 @@ MODNAME = cstrike_amx -SRCFILES = cstrike.cpp CstrikePlayer.cpp +SRCFILES = CstrikePlayer.cpp cstrike.cpp EXTRA_LIBS_LINUX = EXTRA_LIBS_WIN32 = @@ -10,6 +10,7 @@ EXTRA_INCLUDEDIRS = -Iextra/include -I../amxmodx EXTRA_FLAGS = -Dstrcmpi=strcasecmp +AMXDIR=../amxmodx SDKTOP=../hlsdk METADIR=../metamodx @@ -25,7 +26,7 @@ else OS=LINUX endif -CC_LINUX=gcc-2.95 +CC_LINUX=gcc ifeq "$(OS)" "WIN32" CC_WIN32=gcc LD_WINDLL=dllwrap @@ -52,43 +53,34 @@ else ASRCFILES := $(shell dir /b) endif OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o) -OBJC_LINUX := $(CSRCFILES:%.c=$(OBJDIR_LINUX)/%.o) OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o) -OBJC_WIN32 := $(CSRCFILES:%.c=$(OBJDIR_WIN32)/%.o) - -CCOPT = -march=i386 -O2 -ffast-math -funroll-loops \ +CCOPT = -march=i586 -O6 -ffast-math -funroll-loops \ -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \ - -malign-jumps=2 -malign-functions=2 -s -DNDEBUG + -malign-jumps=2 -malign-functions=2 -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) +INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(AMXDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS) CFLAGS=-Wall -Wno-unknown-pragmas 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 $< -LINK_LINUX=$(CC_LINUX) $(CFLAGS) -shared -ldl -lm $(OBJ_LINUX) $(OBJC_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@ -LINK_WIN32=$(LD_WINDLL) -mwindows --def $(MODNAME).def --add-stdcall-alias $(OBJ_WIN32) $(OBJC_WIN32) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@ - -$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.c - $(DO_CC_LINUX) +LINK_LINUX=$(CC_LINUX) $(CFLAGS) -shared -ldl -lm $(OBJ_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@ +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)/%.c - $(DO_CC_WIN32) - $(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.cpp $(DO_CC_WIN32) default: $(DEFAULT) -$(TARGET_LINUX): $(OBJDIR_LINUX) $(OBJ_LINUX) $(OBJC_LINUX) +$(TARGET_LINUX): $(OBJDIR_LINUX) $(OBJ_LINUX) $(LINK_LINUX) -$(TARGET_WIN32): $(OBJDIR_WIN32) $(OBJ_WIN32) $(OBJC_WIN32) +$(TARGET_WIN32): $(OBJDIR_WIN32) $(OBJ_WIN32) $(LINK_WIN32) $(OBJDIR_LINUX): diff --git a/dlls/cstrike/cstrike.h b/dlls/cstrike/cstrike.h index 894cd420..e83107db 100755 --- a/dlls/cstrike/cstrike.h +++ b/dlls/cstrike/cstrike.h @@ -1,4 +1,4 @@ -//#define __cswonbuild__ // comment when compiling for STEAM +#define __cswonbuild__ // comment when compiling for STEAM /* AMX Mod X * Counter-Strike Module diff --git a/dlls/fun/Makefile b/dlls/fun/Makefile index ba64c656..2e8314c1 100755 --- a/dlls/fun/Makefile +++ b/dlls/fun/Makefile @@ -55,9 +55,9 @@ endif OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o) OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o) -CCOPT = -march=i386 -O2 -ffast-math -funroll-loops \ +CCOPT = -march=i586 -O6 -ffast-math -funroll-loops \ -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \ - -malign-jumps=2 -malign-functions=2 -s -DNDEBUG -lstdc++ + -malign-jumps=2 -malign-functions=2 -s -DNDEBUG INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(AMXDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS) CFLAGS=-Wall -Wno-unknown-pragmas