1
0
Fork 0
forked from lthn/blockchain
blockchain/Makefile

106 lines
2.9 KiB
Makefile
Raw Normal View History

2019-02-20 02:42:47 +00:00
# Copyright (c) 2014-2019 Zano Project
# Copyright (c) 2014 The Cryptonote developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Define CMake generator
system := $(shell uname)
ifneq (, $(findstring MINGW, $(system)))
cmake_gen = -G 'MSYS Makefiles'
endif
2018-12-27 18:50:45 +03:00
cmake = cmake $(cmake_gen)
2018-12-27 18:50:45 +03:00
2024-03-21 13:16:33 +00:00
cmake_debug = $(cmake) -D CMAKE_BUILD_TYPE=Debug -D MUTE_ERRORS=FALSE
cmake_release = $(cmake) -D CMAKE_BUILD_TYPE=Release -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=contrib/cmake/conan_provider.cmake
cmake_gui = -D BUILD_GUI=ON
cmake_testnet = -D TESTNET=ON -D BUILD_TESTS=OFF
cmake_static = -D STATIC=ON
2024-03-21 13:16:33 +00:00
cmake_tests = -D BUILD_TESTS=ON -D TESTNET=ON
# Helper macro
define CMAKE
mkdir -p $1 && cd $1 && $2 ../../
endef
2018-12-27 18:50:45 +03:00
build = build
dir_debug = $(build)/debug
dir_release = $(build)/release
2018-12-27 18:50:45 +03:00
all: release
2018-12-27 18:50:45 +03:00
release:
$(eval command += $(cmake_release))
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
2018-12-27 18:50:45 +03:00
2024-03-21 13:16:33 +00:00
release-testnet:
$(eval command += $(cmake_release) $(cmake_testnet))
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
debug:
$(eval command += $(cmake_debug))
$(call CMAKE,$(dir_debug),$(command)) && $(MAKE)
2024-03-21 13:16:33 +00:00
debug-testnet:
$(eval command += $(cmake_debug) $(cmake_testnet))
$(call CMAKE,$(dir_debug),$(command)) && $(MAKE)
static: static-release
static-release:
$(eval command += $(cmake_release) $(cmake_static))
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
2024-03-21 13:16:33 +00:00
static-release-testnet:
$(eval command += $(cmake_release) $(cmake_static) $(cmake_testnet))
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
#
# GUI
#
gui: gui-release
gui-release:
$(eval command += $(cmake_release) $(cmake_gui))
$(call CMAKE,$(dir_release),$(command)) && $(MAKE)
2024-03-21 13:16:33 +00:00
gui-release-testnet:
$(eval command += $(cmake_release) $(cmake_gui) $(cmake_testnet))
$(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)
2024-03-21 13:16:33 +00:00
gui-release-static-testnet:
$(eval command += $(cmake_release) $(cmake_gui) $(cmake_static) $(cmake_testnet))
$(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:
$(eval command += $(cmake_debug) $(cmake_tests))
$(call CMAKE,$(dir_debug),$(command)) && $(MAKE) && $(MAKE) test
2018-12-27 18:50:45 +03:00
clean:
rm -rf build
2024-03-21 13:16:33 +00:00
macos-gui:
bash ./utils/build/testnet_mac_osx_gui.sh
2018-12-27 18:50:45 +03:00
tags:
ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ src contrib tests/gtest
2024-03-21 13:16:33 +00:00
.PHONY: all release debug static static-release gui gui-release gui-static gui-release-static gui-debug test test-release test-debug clean tags macos-gui