feat: Build libparticles for use when compiling hl_cdll and ns

This commit is contained in:
jonnypower 2018-04-29 22:48:44 -07:00
parent 186da9bf3f
commit 19d92bfe65
7 changed files with 19 additions and 2 deletions

View file

@ -131,6 +131,7 @@ all: build_dir targets
TARGETS= TARGETS=
TARGETS+= \ TARGETS+= \
particles \
ns \ ns \
hl_cdll \ hl_cdll \
@ -140,6 +141,8 @@ build_dir:
targets: $(TARGETS) targets: $(TARGETS)
particles:
cd ../particles && make && cd ../linux && cp ../particles/libpart* .
hl_cdll: build_dir hl_cdll: build_dir
$(MAKE_hl_cdll) ARCH=i686 CC=$(CC) CPLUS=$(CPLUS) CPP_LIB="$(CPP_LIB)" BUILD_DIR=$(BUILD_DIR) BUILD_OBJ_DIR=$(BUILD_OBJ_DIR) SOURCE_DIR=$(SOURCE_DIR) ENGINE_SRC_DIR=$(ENGINE_SRC_DIR) MOD_SRC_DIR=$(MOD_SRC_DIR) COMMON_SRC_DIR=$(COMMON_SRC_DIR) BASE_CFLAGS="$(BASE_CFLAGS)" PUBLIC_SRC_DIR=$(PUBLIC_SRC_DIR) DBG_SRC_DIR=$(DBG_SRC_DIR) ARCH_CFLAGS="$(ARCH_CFLAGS_I686)" GAME_SHARED_SRC_DIR=$(GAME_SHARED_SRC_DIR) CLINK=$(CLINK) PM_SRC_DIR=$(PM_SRC_DIR) SHLIBEXT=$(SHLIBEXT) SHLIBCFLAGS=$(SHLIBCFLAGS) SHLIBLDFLAGS=$(SHLIBLDFLAGS) CFG=$(CFG) OS=$(OS) $(MAKE_hl_cdll) ARCH=i686 CC=$(CC) CPLUS=$(CPLUS) CPP_LIB="$(CPP_LIB)" BUILD_DIR=$(BUILD_DIR) BUILD_OBJ_DIR=$(BUILD_OBJ_DIR) SOURCE_DIR=$(SOURCE_DIR) ENGINE_SRC_DIR=$(ENGINE_SRC_DIR) MOD_SRC_DIR=$(MOD_SRC_DIR) COMMON_SRC_DIR=$(COMMON_SRC_DIR) BASE_CFLAGS="$(BASE_CFLAGS)" PUBLIC_SRC_DIR=$(PUBLIC_SRC_DIR) DBG_SRC_DIR=$(DBG_SRC_DIR) ARCH_CFLAGS="$(ARCH_CFLAGS_I686)" GAME_SHARED_SRC_DIR=$(GAME_SHARED_SRC_DIR) CLINK=$(CLINK) PM_SRC_DIR=$(PM_SRC_DIR) SHLIBEXT=$(SHLIBEXT) SHLIBCFLAGS=$(SHLIBCFLAGS) SHLIBLDFLAGS=$(SHLIBLDFLAGS) CFG=$(CFG) OS=$(OS)
@ -148,4 +151,5 @@ ns: build_dir
$(MAKE_HL_LIB) CC=$(CC) ARCH=$(ARCH) CPP_LIB="$(CPP_LIB)" BUILD_DIR=$(BUILD_DIR) BUILD_OBJ_DIR=$(BUILD_OBJ_DIR) SOURCE_DIR=$(SOURCE_DIR) ENGINE_SRC_DIR=$(ENGINE_SRC_DIR) COMMON_SRC_DIR=$(COMMON_SRC_DIR) PM_SRC_DIR=$(PM_SRC_DIR) GAME_SHARED_SRC_DIR=$(GAME_SHARED_SRC_DIR) GAMEDB_SRC_DIR=$(GAMEDB_SRC_DIR) BASE_CFLAGS="$(BASE_CFLAGS)" SHLIBEXT=$(SHLIBEXT) SHLIBCFLAGS=$(SHLIBCFLAGS) SHLIBLDFLAGS=$(SHLIBLDFLAGS) PUBLIC_SRC_DIR=$(PUBLIC_SRC_DIR) CFG=$(CFG) OS=$(OS) ARCH_CFLAGS="$(ARCH_CFLAGS_I686)" $(MAKE_HL_LIB) CC=$(CC) ARCH=$(ARCH) CPP_LIB="$(CPP_LIB)" BUILD_DIR=$(BUILD_DIR) BUILD_OBJ_DIR=$(BUILD_OBJ_DIR) SOURCE_DIR=$(SOURCE_DIR) ENGINE_SRC_DIR=$(ENGINE_SRC_DIR) COMMON_SRC_DIR=$(COMMON_SRC_DIR) PM_SRC_DIR=$(PM_SRC_DIR) GAME_SHARED_SRC_DIR=$(GAME_SHARED_SRC_DIR) GAMEDB_SRC_DIR=$(GAMEDB_SRC_DIR) BASE_CFLAGS="$(BASE_CFLAGS)" SHLIBEXT=$(SHLIBEXT) SHLIBCFLAGS=$(SHLIBCFLAGS) SHLIBLDFLAGS=$(SHLIBLDFLAGS) PUBLIC_SRC_DIR=$(PUBLIC_SRC_DIR) CFG=$(CFG) OS=$(OS) ARCH_CFLAGS="$(ARCH_CFLAGS_I686)"
clean: clean:
make -f ../particles/Makefile clean
-rm -rf $(BUILD_OBJ_DIR) -rm -rf $(BUILD_OBJ_DIR)

View file

@ -13,6 +13,7 @@ HL_SERVER_SRC_DIR=$(SOURCE_DIR)/dlls
GAME_SHARED_SRC_DIR=$(SOURCE_DIR)/game_shared GAME_SHARED_SRC_DIR=$(SOURCE_DIR)/game_shared
PM_SHARED_SRC_DIR=$(SOURCE_DIR)/pm_shared PM_SHARED_SRC_DIR=$(SOURCE_DIR)/pm_shared
TEXTREP_SRC_DIR=$(SOURCE_DIR)/textrep TEXTREP_SRC_DIR=$(SOURCE_DIR)/textrep
PARTICLES_SRC_DIR=$(SOURCE_DIR)/particles
TEXTREP_OBJ_DIR=$(HL1_OBJ_DIR)/textrep TEXTREP_OBJ_DIR=$(HL1_OBJ_DIR)/textrep
UTIL_OBJ_DIR=$(HL1_OBJ_DIR)/util UTIL_OBJ_DIR=$(HL1_OBJ_DIR)/util

Binary file not shown.

Binary file not shown.

View file

@ -11,12 +11,21 @@ GLUT_HOME =/usr/local/contrib/unmoderated
MP = #-mp -DPARTICLE_MP MP = #-mp -DPARTICLE_MP
OS:=$(shell uname)
# Make it real fast on an Origin 2000. # Make it real fast on an Origin 2000.
#LNO =-LNO:opt=1:fusion=2:fission=2:fusion_peeling_limit=2048:cs1=32K:cs2=8M #LNO =-LNO:opt=1:fusion=2:fission=2:fusion_peeling_limit=2048:cs1=32K:cs2=8M
COPT = $(MP) -O3 $(LNO) -fPIC COPT = $(MP) -O3 $(LNO) -fPIC
CFLAGS = $(COPT) $(COMPFLAGS) -I. -I.. -I$(GLUT_HOME)/include -I/usr/include/c++/4.8/ -I../common -I../public -I../pm_shared -I../engine CFLAGS = $(COPT) $(COMPFLAGS) -I. -I.. -I$(GLUT_HOME)/include -I/usr/include/c++/4.8/ -I../common -I../public -I../pm_shared -I../engine
ifeq ($(OS),Darwin)
SLIBB = $(C++) -dynamiclib -undefined suppress -flat_namespace *.o -o libparticles.dylib
CFLAGS += -target i386-apple-darwin -DCMAKE_OSX_ARCHITECTURES=i386
else
SLIBB = ar clq $@ $(POBJS)
endif
POBJS =action_api.o actions.o HLRender.o opengl.o system.o POBJS =action_api.o actions.o HLRender.o opengl.o system.o
ALL = libparticleMP.a ALL = libparticleMP.a
@ -31,7 +40,7 @@ all: $(ALL)
libparticleMP.a: $(POBJS) libparticleMP.a: $(POBJS)
rm -f $@ rm -f $@
ar clq $@ $(POBJS) $(SLIBB)
SPDir: SPDir:
(make) (make)

View file

@ -9,9 +9,12 @@
#ifdef WIN32 #ifdef WIN32
// This is for something in gl.h. // This is for something in gl.h.
#include <windows.h> #include <windows.h>
#include <GL/gl.h>
#else
#include <OpenGL/gl.h>
#define NULL 0
#endif #endif
#include <GL/gl.h>
// XXX #include <iostream.h> // XXX #include <iostream.h>
// Emit OpenGL calls to draw the particles. These are drawn with // Emit OpenGL calls to draw the particles. These are drawn with