X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=Makefile;h=00230db9d4e52cee9857dc122b7705589af28570;hb=c256dca7c6ca2c7f8eeffae53c02fe62bd892198;hp=d0a3083a97a225c8026aa0a6c9cff8191967a7ff;hpb=d71d636af8b6f493abe537088464d1dc6b816c04;p=blank.git diff --git a/Makefile b/Makefile index d0a3083..00230db 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ CXX = g++ --std=c++11 LDXX = g++ -LIBS = sdl2 SDL2_image glew +LIBS = sdl2 SDL2_image SDL2_net SDL2_ttf glew openal freealut zlib PKGFLAGS := $(shell pkg-config --cflags $(LIBS)) PKGLIBS := $(shell pkg-config --libs $(LIBS)) @@ -16,8 +16,8 @@ LDXXFLAGS ?= LDXXFLAGS += $(PKGLIBS) DEBUG_FLAGS = -g3 -O0 -PROFILE_FLAGS = -DNDEBUG -O1 -g3 -RELEASE_FLAGS = -DNDEBUG -O2 +PROFILE_FLAGS = -DNDEBUG -O1 -g3 -DBLANK_PROFILING +RELEASE_FLAGS = -DNDEBUG -O2 -g1 TEST_FLAGS = -g -O2 -I./src $(TESTFLAGS) SOURCE_DIR := src @@ -28,6 +28,9 @@ RELEASE_DIR := build/release TEST_DIR := build/test DIR := $(RELEASE_DIR) $(DEBUG_DIR) $(PROFILE_DIR) $(TEST_DIR) build +ASSET_DIR := assets +ASSET_DEP := $(ASSET_DIR)/.git + LIB_SRC := $(wildcard $(SOURCE_DIR)/*/*.cpp) BIN_SRC := $(wildcard $(SOURCE_DIR)/*.cpp) SRC := $(LIB_SRC) $(BIN_SRC) @@ -58,21 +61,27 @@ profile: $(PROFILE_BIN) tests: $(TEST_BIN) -run: blank - ./blank +run: $(ASSET_DEP) blank + ./blank --save-path saves/ + +server: $(ASSET_DEP) blank + ./blank --server --save-path saves/ -gdb: blank.debug +client: $(ASSET_DEP) blank + ./blank --client --save-path client-saves/ + +gdb: $(ASSET_DEP) blank.debug gdb ./blank.debug -cachegrind: blank.profile - valgrind ./blank.profile +cachegrind: $(ASSET_DEP) blank.profile + valgrind ./blank.profile --save-path saves/ -callgrind: blank.profile +callgrind: $(ASSET_DEP) blank.profile valgrind --tool=callgrind \ --branch-sim=yes --cacheuse=yes --cache-sim=yes \ --collect-bus=yes --collect-systime=yes --collect-jumps=yes \ --dump-instr=yes --simulate-hwpref=yes --simulate-wb=yes \ - ./blank.profile -n 128 -t 16 --no-keyboard --no-mouse -d --no-vsync + ./blank.profile -n 128 -t 16 --no-keyboard --no-mouse -d --no-vsync --save-path saves/ test: blank.test ./blank.test @@ -82,6 +91,7 @@ clean: distclean: clean rm -f $(BIN) cachegrind.out.* callgrind.out.* + rm -Rf build client-saves saves .PHONY: all release debug profile tests run gdb cachegrind callgrind test clean distclean @@ -103,6 +113,10 @@ $(TEST_BIN): $(TEST_OBJ) @echo link: $@ @$(LDXX) -o $@ $(CXXFLAGS) $(LDXXFLAGS) $(TESTLIBS) $(TEST_FLAGS) $^ +$(ASSET_DEP): .git/$(shell git symbolic-ref HEAD) + @git submodule update --init >/dev/null + @touch $@ + $(RELEASE_DIR)/%.o: $(SOURCE_DIR)/%.cpp | $(RELEASE_DIR) @mkdir -p "$(@D)" @echo compile: $@