More Makefile improvements

This commit is contained in:
Tim Warren 2015-05-06 17:08:41 -04:00
parent 6ffb603e50
commit 6baa24dcf6

View File

@ -17,8 +17,6 @@ CXXFLAGS = -Os -DNDEBUG
TEST_SRC = $(wildcard tests/*.cpp) TEST_SRC = $(wildcard tests/*.cpp)
TESTS = $(patsubst %.cpp,%,$(TEST_SRC)) TESTS = $(patsubst %.cpp,%,$(TEST_SRC))
DEV = false
LDLIBS = LDLIBS =
OS ?= $(shell uname -s) OS ?= $(shell uname -s)
@ -47,7 +45,7 @@ endif
CXX += -Iinclude -I. -I/usr/local/include CXX += -Iinclude -I. -I/usr/local/include
ifeq ($(DEV),true) ifdef $(DEV)
all: CXXFLAGS = $(DEV_CXXFLAGS) all: CXXFLAGS = $(DEV_CXXFLAGS)
endif endif
all: build json_wrapper $(TYRO_LIB) $(PROGRAM) all: build json_wrapper $(TYRO_LIB) $(PROGRAM)
@ -56,6 +54,7 @@ all: Tyro.app
endif endif
dev: DEV = true dev: DEV = true
dev: CXXFLAGS = $(DEV_CXXFLAGS)
dev: all dev: all
json_wrapper: json_wrapper_build json_wrapper: json_wrapper_build
@ -90,17 +89,18 @@ run-grind:
valgrind $(PROGRAM) valgrind $(PROGRAM)
# Make optimized and striped executable # Make optimized and striped executable
release: DEV = false release: DEV=
release:
ifeq ($(OS),Darwin) ifeq ($(OS),Darwin)
make all release: all
endif endif
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
make exe release: exe
release:
strip -SXx $(PROGRAM).exe strip -SXx $(PROGRAM).exe
endif endif
ifeq ($(OS),Linux) ifeq ($(OS),Linux)
make all release: all
release:
strip -SXx $(PROGRAM) strip -SXx $(PROGRAM)
endif endif
@ -115,7 +115,7 @@ exe: msw_resource $(PROGRAM)
# OS X application bundle # OS X application bundle
Tyro.app: Tyro.app:
ifeq ($(DEV),false) ifndef DEV
strip -SXx $(PROGRAM) strip -SXx $(PROGRAM)
endif endif
SetFile -t APPL $(TYRO_LIB) SetFile -t APPL $(TYRO_LIB)