diff --git a/.gitignore b/.gitignore index 98f8068..d0cc1e4 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ blobwarsAttrition dist/* /blobwarsAttrition.exe /.errors +build diff --git a/build/build.sh b/build/build.sh deleted file mode 100755 index 330f67d..0000000 --- a/build/build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -cd .. - -rm -rf dist -make clean -make -make dist -make src-dist diff --git a/makefile.mac b/makefile.mac new file mode 100644 index 0000000..ed49014 --- /dev/null +++ b/makefile.mac @@ -0,0 +1,35 @@ +PROG = blobwarsAttrition +CC = gcc +PREFIX ?= /usr +BIN_DIR ?= $(PREFIX)/bin +DATA_DIR ?= /opt/$(PROG) +LOCALE_DIR = $(PREFIX)/share/locale +ICON_DIR = $(PREFIX)/share/icons/hicolor +DESKTOP_DIR = $(PREFIX)/share/applications + +DESTDIR ?= +INST_BIN_DIR = $(DESTDIR)$(BIN_DIR) +INST_DATA_DIR = $(DESTDIR)$(DATA_DIR) +INST_LOCALE_DIR = $(DESTDIR)$(LOCALE_DIR) +INST_ICON_DIR = $(DESTDIR)$(ICON_DIR) +INST_DESKTOP_DIR = $(DESTDIR)$(DESKTOP_DIR) + +SEARCHPATH += src/plat/unix +_OBJS += unixInit.o + +include common.mk + +CXXFLAGS += `sdl2-config --cflags` -DVERSION=$(VERSION) -DREVISION=$(REVISION) -DDATA_DIR=\"$(DATA_DIR)\" -DLOCALE_DIR=\"$(LOCALE_DIR)\" +CXXFLAGS += -fms-extensions + +LDFLAGS += `sdl2-config --libs` -lSDL2_mixer -lSDL2_image -lSDL2_ttf -lm -lz -lpng + +SHARED_FILES = LICENSE README.md data gfx manual music sound icons +DIST_FILES = $(SHARED_FILES) locale $(PROG) +SRC_DIST_FILES = $(SHARED_FILES) src makefile* common.mk + +# linking the program. +$(PROG): $(OBJS) + $(CC) -o $@ $(OBJS) $(LDFLAGS) + +.PHONY: dist diff --git a/makefile.win32 b/makefile.win32 new file mode 100644 index 0000000..fb7f203 --- /dev/null +++ b/makefile.win32 @@ -0,0 +1,23 @@ +PROG = blobwarsAttrition.exe +CC = x86_64-w64-mingw32-gcc +SDLC = /usr/x86_64-w64-mingw32/bin/sdl2-config +LOCALE_DIR = locale + +SEARCHPATH += src/plat/win32 +_OBJS += win32Init.o + +include common.mk + +NPROCS = $(shell grep -c 'processor' /proc/cpuinfo) +MAKEFLAGS += -j$(NPROCS) + +CXXFLAGS += `$(SDLC) --cflags` -DVERSION=$(VERSION) -DREVISION=$(REVISION) -DDATA_DIR=\"$(DATA_DIR)\" -DLOCALE_DIR=\"$(LOCALE_DIR)\" +CXXFLAGS += -Wall -Wempty-body -ansi -pedantic -Werror -Wstrict-prototypes -Werror=maybe-uninitialized -Warray-bounds +CXXFLAGS += -g -lefence +CXXFLAGS += -fms-extensions -std=gnu11 + +LDFLAGS += `$(SDLC) --libs` -lm -lSDL2_mixer -lSDL2_image -lSDL2_ttf -lSDL2main -lpng -lz + +# linking the program. +$(PROG): $(OBJS) + $(CC) -o $@ $(OBJS) $(LDFLAGS) -L$(LIBPATH)