2015-04-07 17:08:28 -04:00
|
|
|
PROGRAM = build/Tyro
|
2015-05-07 14:06:12 -04:00
|
|
|
|
2015-04-16 22:07:51 -04:00
|
|
|
WX_RES = $(shell wx-config --rescomp)
|
2015-04-30 17:10:26 -04:00
|
|
|
WX_CXXFLAGS = $(shell wx-config --cxxflags)
|
2015-04-16 22:07:51 -04:00
|
|
|
|
2015-07-10 16:24:09 -04:00
|
|
|
TEST_RUNNER = build/test_runner
|
2015-04-29 13:10:52 -04:00
|
|
|
|
2015-04-16 22:07:51 -04:00
|
|
|
OS ?= $(shell uname -s)
|
2015-04-16 13:16:36 -04:00
|
|
|
|
2015-04-22 21:06:35 -04:00
|
|
|
|
2015-07-10 16:24:09 -04:00
|
|
|
all:
|
|
|
|
./cmake.sh Tyro
|
2015-05-08 22:20:59 -04:00
|
|
|
|
2015-05-29 09:13:30 -04:00
|
|
|
|
2019-06-18 15:48:28 -04:00
|
|
|
dev:
|
|
|
|
mkdir -p build
|
|
|
|
cmake -DCMAKE_BUILD_TYPE=Debug -B./build -H.
|
|
|
|
make -C ./build
|
2015-03-31 16:43:42 -04:00
|
|
|
|
2019-06-18 15:48:28 -04:00
|
|
|
run:
|
2015-05-04 16:26:23 -04:00
|
|
|
ifneq ($(OS),Darwin)
|
2015-05-07 17:05:27 -04:00
|
|
|
./$(PROGRAM)
|
2015-05-04 16:26:23 -04:00
|
|
|
else
|
2015-05-07 17:05:27 -04:00
|
|
|
./build/Tyro.app/Contents/MacOS/Tyro
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
ifeq ($(OS),Darwin)
|
2019-05-31 22:46:27 -04:00
|
|
|
run-app: all
|
2015-05-04 16:26:23 -04:00
|
|
|
open -a $(PWD)/build/Tyro.app
|
|
|
|
endif
|
2015-03-31 16:43:42 -04:00
|
|
|
|
2019-05-31 22:46:27 -04:00
|
|
|
run-grind: all
|
2015-04-28 09:55:43 -04:00
|
|
|
valgrind $(PROGRAM)
|
2015-04-22 10:09:43 -04:00
|
|
|
|
|
|
|
# Make optimized and striped executable
|
2015-04-16 22:07:51 -04:00
|
|
|
ifeq ($(OS),Darwin)
|
2015-05-06 17:08:41 -04:00
|
|
|
release: all
|
2015-04-16 13:16:36 -04:00
|
|
|
endif
|
2015-04-16 22:07:51 -04:00
|
|
|
ifeq ($(OS),Windows_NT)
|
2015-05-06 17:08:41 -04:00
|
|
|
release: exe
|
2015-04-30 19:35:21 -04:00
|
|
|
strip -SXx $(PROGRAM).exe
|
2015-04-16 22:07:51 -04:00
|
|
|
endif
|
2015-04-28 09:55:43 -04:00
|
|
|
ifeq ($(OS),Linux)
|
2015-05-06 17:08:41 -04:00
|
|
|
release: all
|
2015-04-28 09:55:43 -04:00
|
|
|
strip -SXx $(PROGRAM)
|
|
|
|
endif
|
2015-04-16 22:07:51 -04:00
|
|
|
|
2015-04-22 10:09:43 -04:00
|
|
|
|
|
|
|
# Windows resource linking
|
2015-04-16 22:07:51 -04:00
|
|
|
msw_resource:
|
|
|
|
$(WX_RES) resources/platform/msw/resource.rc -O coff -o resource.res
|
|
|
|
|
|
|
|
exe: LDLIBS += resource.res
|
2015-05-07 14:06:12 -04:00
|
|
|
exe: json_wrapper_build json_wrapper $(BASE_LIB)
|
2015-04-28 09:55:43 -04:00
|
|
|
exe: msw_resource $(PROGRAM)
|
2015-04-22 10:09:43 -04:00
|
|
|
|
2015-05-04 16:26:23 -04:00
|
|
|
# OS X application bundle
|
|
|
|
Tyro.app:
|
2015-05-06 17:08:41 -04:00
|
|
|
ifndef DEV
|
2015-05-06 16:58:07 -04:00
|
|
|
strip -SXx $(PROGRAM)
|
|
|
|
endif
|
2015-05-07 14:06:12 -04:00
|
|
|
SetFile -t APPL $(BASE_LIB)
|
2015-04-29 13:10:52 -04:00
|
|
|
-mkdir -p build/Tyro.app/Contents/MacOS
|
|
|
|
-mkdir -p build/Tyro.app/Contents/Resources/English.lproj
|
|
|
|
cp resources/platform/osx/Info.plist build/Tyro.app/Contents/
|
|
|
|
echo -n 'APPL????' > build/Tyro.app/Contents/PkgInfo
|
|
|
|
cp build/Tyro build/Tyro.app/Contents/MacOS/Tyro
|
|
|
|
cp resources/platform/osx/tyro.icns build/Tyro.app/Contents/Resources/
|
2015-03-31 16:43:42 -04:00
|
|
|
|
2015-04-22 21:06:35 -04:00
|
|
|
|
2015-07-10 16:24:09 -04:00
|
|
|
$(TEST_RUNNER):
|
|
|
|
./cmake.sh test_runner
|
2015-06-18 13:34:54 -04:00
|
|
|
|
|
|
|
run-tests: tests
|
2015-07-10 16:24:09 -04:00
|
|
|
|
|
|
|
tests: $(TEST_RUNNER)
|
|
|
|
./build/test_runner
|
|
|
|
|
|
|
|
tests-verbose: $(TEST_RUNNER)
|
|
|
|
./build/test_runner -s
|
2015-04-07 17:08:28 -04:00
|
|
|
|
2015-03-31 16:43:42 -04:00
|
|
|
clean:
|
2015-04-16 22:07:51 -04:00
|
|
|
rm -f *.res
|
2015-04-15 09:56:00 -04:00
|
|
|
rm -f config/json2c
|
2015-04-16 22:07:51 -04:00
|
|
|
rm -f config/json2c.exe
|
2015-04-15 09:56:00 -04:00
|
|
|
rm -f config/*_json.h
|
2015-07-10 16:24:09 -04:00
|
|
|
rm -rf build/*
|
2015-07-02 15:05:05 -04:00
|
|
|
mkdir -p build
|