Update makefile

This commit is contained in:
Tim Warren 2015-05-06 16:58:07 -04:00
parent f376790583
commit 6ffb603e50

View File

@ -17,6 +17,8 @@ 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)
@ -38,19 +40,22 @@ ifeq ($(OS),Linux)
LDLIBS += -lssh2 LDLIBS += -lssh2
endif endif
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
CXXFLAGS = -DNDEBUG -static CXXFLAGS += -DNDEBUG -static
CXX += -I/include -DWIN32 CXX += -I/include -DWIN32
LDLIBS += -L/lib -lwsock32 -lssh2 LDLIBS += -L/lib -lwsock32 -lssh2
endif endif
CXX += -Iinclude -I. -I/usr/local/include CXX += -Iinclude -I. -I/usr/local/include
ifeq ($(DEV),true)
all: CXXFLAGS = $(DEV_CXXFLAGS)
endif
all: build json_wrapper $(TYRO_LIB) $(PROGRAM) all: build json_wrapper $(TYRO_LIB) $(PROGRAM)
ifeq ($(OS),Darwin) ifeq ($(OS),Darwin)
all: Tyro.app all: Tyro.app
endif endif
dev: CXXFLAGS = $(DEV_CXXFLAGS) dev: DEV = true
dev: all dev: all
json_wrapper: json_wrapper_build json_wrapper: json_wrapper_build
@ -85,11 +90,10 @@ run-grind:
valgrind $(PROGRAM) valgrind $(PROGRAM)
# Make optimized and striped executable # Make optimized and striped executable
release: DEV = false
release: release:
ifeq ($(OS),Darwin) ifeq ($(OS),Darwin)
make all make all
strip -SXx $(PROGRAM)
make Tyro.app
endif endif
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
make exe make exe
@ -111,11 +115,11 @@ exe: msw_resource $(PROGRAM)
# OS X application bundle # OS X application bundle
Tyro.app: Tyro.app:
ifeq ($(DEV),false)
strip -SXx $(PROGRAM)
endif
SetFile -t APPL $(TYRO_LIB) SetFile -t APPL $(TYRO_LIB)
-mkdir -p build/Tyro.app
-mkdir -p build/Tyro.app/Contents
-mkdir -p build/Tyro.app/Contents/MacOS -mkdir -p build/Tyro.app/Contents/MacOS
-mkdir -p build/Tyro.app/Contents/Resources
-mkdir -p build/Tyro.app/Contents/Resources/English.lproj -mkdir -p build/Tyro.app/Contents/Resources/English.lproj
cp resources/platform/osx/Info.plist build/Tyro.app/Contents/ cp resources/platform/osx/Info.plist build/Tyro.app/Contents/
echo -n 'APPL????' > build/Tyro.app/Contents/PkgInfo echo -n 'APPL????' > build/Tyro.app/Contents/PkgInfo