forked from lthn/blockchain
Merge pull request #15 from anonimal/makefile
Makefile: add static and GUI targets, refactor
This commit is contained in:
commit
5d1ef64e21
1 changed files with 41 additions and 8 deletions
49
Makefile
49
Makefile
|
|
@ -13,7 +13,14 @@ cmake = cmake $(cmake_gen)
|
||||||
|
|
||||||
cmake_debug = $(cmake) -D CMAKE_BUILD_TYPE=Debug
|
cmake_debug = $(cmake) -D CMAKE_BUILD_TYPE=Debug
|
||||||
cmake_release = $(cmake) -D CMAKE_BUILD_TYPE=Release
|
cmake_release = $(cmake) -D CMAKE_BUILD_TYPE=Release
|
||||||
cmake_tests = $(cmake) -D BUILD_TESTS=ON
|
|
||||||
|
cmake_gui = -D BUILD_GUI=ON
|
||||||
|
cmake_static = -D STATIC=ON
|
||||||
|
cmake_tests = -D BUILD_TESTS=ON
|
||||||
|
|
||||||
|
gui:
|
||||||
|
$(eval command += $(cmake_release) $(cmake_gui))
|
||||||
|
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
|
||||||
|
|
||||||
# Helper macro
|
# Helper macro
|
||||||
define CMAKE
|
define CMAKE
|
||||||
|
|
@ -30,16 +37,42 @@ release:
|
||||||
$(eval command += $(cmake_release))
|
$(eval command += $(cmake_release))
|
||||||
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
|
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
|
||||||
|
|
||||||
test-release:
|
|
||||||
$(eval command += $(cmake_release) $(cmake_tests))
|
|
||||||
$(call CMAKE,$(dir_release),$(command)) && $(MAKE) && $(MAKE) test
|
|
||||||
|
|
||||||
test: test-release
|
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
$(eval command += $(cmake_debug))
|
$(eval command += $(cmake_debug))
|
||||||
$(call CMAKE,$(dir_debug),$(command)) && $(MAKE)
|
$(call CMAKE,$(dir_debug),$(command)) && $(MAKE)
|
||||||
|
|
||||||
|
static: static-release
|
||||||
|
static-release:
|
||||||
|
$(eval command += $(cmake_release) $(cmake_static))
|
||||||
|
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
|
||||||
|
|
||||||
|
#
|
||||||
|
# GUI
|
||||||
|
#
|
||||||
|
|
||||||
|
gui: gui-release
|
||||||
|
gui-release:
|
||||||
|
$(eval command += $(cmake_release) $(cmake_gui))
|
||||||
|
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
|
||||||
|
|
||||||
|
gui-debug:
|
||||||
|
$(eval command += $(cmake_debug) $(cmake_gui))
|
||||||
|
$(call CMAKE,$(dir_debug),$(command)) && $(MAKE)
|
||||||
|
|
||||||
|
gui-static: gui-release-static
|
||||||
|
gui-release-static:
|
||||||
|
$(eval command += $(cmake_release) $(cmake_gui) $(cmake_static))
|
||||||
|
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Tests
|
||||||
|
#
|
||||||
|
|
||||||
|
test: test-release
|
||||||
|
test-release:
|
||||||
|
$(eval command += $(cmake_release) $(cmake_tests))
|
||||||
|
$(call CMAKE,$(dir_release),$(command)) && $(MAKE) && $(MAKE) test
|
||||||
|
|
||||||
test-debug:
|
test-debug:
|
||||||
$(eval command += $(cmake_debug) $(cmake_tests))
|
$(eval command += $(cmake_debug) $(cmake_tests))
|
||||||
$(call CMAKE,$(dir_debug),$(command)) && $(MAKE) && $(MAKE) test
|
$(call CMAKE,$(dir_debug),$(command)) && $(MAKE) && $(MAKE) test
|
||||||
|
|
@ -50,4 +83,4 @@ clean:
|
||||||
tags:
|
tags:
|
||||||
ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ src contrib tests/gtest
|
ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ src contrib tests/gtest
|
||||||
|
|
||||||
.PHONY: all release test-release test all-debug debug test-debug clean tags
|
.PHONY: all release debug static static-release gui gui-release gui-static gui-release-static gui-debug test test-release test-debug clean tags
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue