diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..30d9e7c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +on: + push: + branches: + - master + pull_request: + branches: + - master + +name: "Build" + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-20.04 + - windows-2019 + - macos-10.15 + env: + ARCHIVE: 1 + + steps: + - name: "Checkout" + uses: actions/checkout@v2 + + - name: "Compile" + run: make release + + - name: "Upload artifacts" + uses: actions/upload-artifact@v2 + with: + name: ${{ runner.os }} + path: bspc* diff --git a/Makefile b/Makefile index f5fe36f..4284db5 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,55 @@ +# +# bspc Makefile +# +# GNU Make required +# +COMPILE_PLATFORM=$(shell uname | sed -e 's/_.*//' | tr '[:upper:]' '[:lower:]' | sed -e 's/\//_/g') +COMPILE_ARCH=$(shell uname -m | sed -e 's/i.86/x86/' | sed -e 's/^arm.*/arm/') + +ifeq ($(COMPILE_PLATFORM),sunos) + # Solaris uname and GNU uname differ + COMPILE_ARCH=$(shell uname -p | sed -e 's/i.86/x86/') +endif + +############################################################################# +# +# If you require a different configuration from the defaults below, create a +# new file named "Makefile.local" in the same directory as this file and define +# your parameters there. This allows you to change configuration without +# causing problems with keeping up to date with the repository. +# +############################################################################# +-include Makefile.local + +ifeq ($(COMPILE_PLATFORM),cygwin) + PLATFORM=mingw32 +endif + +ifndef PLATFORM +PLATFORM=$(COMPILE_PLATFORM) +endif + +ifeq ($(PLATFORM),mingw32) + MINGW=1 +endif +ifeq ($(PLATFORM),mingw64) + MINGW=1 +endif + + CC=gcc CFLAGS=\ -Dstricmp=strcasecmp -DCom_Memcpy=memcpy -DCom_Memset=memset \ - -DMAC_STATIC= -DQDECL= -DLINUX -DBSPC -D_FORTIFY_SOURCE=2 \ + -DMAC_STATIC= -DQDECL= -DBSPC -D_FORTIFY_SOURCE=2 \ -fno-common \ - -I. -Ideps -Wall + -I. -Ideps -Wall $(EXPAT_CFLAGS) + +ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu")) + CFLAGS += -DHAVE_GETRANDOM -DLINUX +endif +ifeq ($(PLATFORM),darwin) + CFLAGS += -DHAVE_ARC4RANDOM -DLINUX +endif RELEASE_CFLAGS=-O3 -ffast-math DEBUG_CFLAGS=-g -O0 -ffast-math @@ -80,20 +126,24 @@ GAME_OBJS = \ #tetrahedron.o EXEC = bspc +ifdef MINGW + BINEXT=.exe +endif + all: release debug: CFLAGS += $(DEBUG_CFLAGS) -debug: $(EXEC)_g +debug: $(EXEC)_g$(BINEXT) release: CFLAGS += $(RELEASE_CFLAGS) -release: $(EXEC) +release: $(EXEC)$(BINEXT) -$(EXEC): $(GAME_OBJS) +$(EXEC)$(BINEXT): $(GAME_OBJS) $(CC) -o $@ $(GAME_OBJS) $(LDFLAGS) strip $@ -$(EXEC)_g: $(GAME_OBJS) +$(EXEC)_g$(BINEXT): $(GAME_OBJS) $(CC) -o $@ $(GAME_OBJS) $(LDFLAGS) ############################################################################# diff --git a/deps/botlib/l_script.c b/deps/botlib/l_script.c index d4da773..19863e1 100644 --- a/deps/botlib/l_script.c +++ b/deps/botlib/l_script.c @@ -46,6 +46,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA typedef enum {qfalse, qtrue} qboolean; #endif //SCREWUP +int COM_Compress( char *data_p ); #ifdef BOTLIB //include files for usage in the bot library