1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00
lokinet/Makefile

78 lines
1.8 KiB
Makefile
Raw Normal View History

2018-05-16 17:59:24 +02:00
all: debug
2018-05-16 18:41:20 +02:00
SIGN = gpg --sign --detach
REPO := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
2018-06-15 15:42:49 +02:00
TARGETS = llarpd
SIGS = $(TARGETS:=.sig)
2018-06-06 19:02:57 +02:00
SHADOW_ROOT ?= $(HOME)/.shadow
SHADOW_BIN=$(SHADOW_ROOT)/bin/shadow
2018-06-07 19:36:17 +02:00
SHADOW_CONFIG=$(REPO)/shadow.config.xml
SHADOW_PLUGIN=$(REPO)/libshadow-plugin-llarp.so
SHADOW_LOG=$(REPO)/shadow.log.txt
2018-06-06 19:02:57 +02:00
TESTNET_ROOT=$(REPO)/testnet_tmp
TESTNET_CONF=$(TESTNET_ROOT)/supervisor.conf
TESTNET_LOG=$(TESTNET_ROOT)/testnet.log
clean:
2018-05-21 16:28:15 +02:00
rm -f build.ninja rules.ninja cmake_install.cmake CMakeCache.txt
rm -rf CMakeFiles
rm -f $(TARGETS)
2018-06-06 19:02:57 +02:00
rm -f $(SHADOW_PLUGIN) $(SHADOW_CONFIG)
rm -f *.sig
2018-05-16 17:59:24 +02:00
debug-configure: clean
2018-06-14 16:04:42 +02:00
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DWITH_TESTS=ON
2018-05-16 17:59:24 +02:00
release-configure: clean
2018-06-15 15:42:49 +02:00
cmake -GNinja -DSTATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release -DRELEASE_MOTTO="$(shell cat motto.txt)"
debug: debug-configure
ninja
2018-06-14 16:04:42 +02:00
ninja test
2018-05-21 16:28:15 +02:00
release-compile: release-configure
ninja
strip $(TARGETS)
$(TARGETS): release-compile
%.sig: $(TARGETS)
$(SIGN) $*
release: $(SIGS)
2018-06-06 15:17:03 +02:00
shadow-configure: clean
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DSHADOW=ON
2018-06-06 19:02:57 +02:00
shadow-build: shadow-configure
ninja clean
2018-06-06 15:17:03 +02:00
ninja
2018-06-06 19:02:57 +02:00
shadow: shadow-build
python3 contrib/shadow/genconf.py $(SHADOW_CONFIG)
2018-06-07 19:36:17 +02:00
bash -c "$(SHADOW_BIN) -w $$(cat /proc/cpuinfo | grep processor | wc -l) $(SHADOW_CONFIG) &> $(SHADOW_LOG) || true"
testnet-configure: clean
2018-06-26 03:30:36 +02:00
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug
testnet-build: testnet-configure
ninja
testnet: testnet-build
mkdir -p $(TESTNET_ROOT)
2018-06-26 19:12:33 +02:00
python3 contrib/testnet/genconf.py --bin=$(REPO)/llarpd --svc=10 --clients=1 --dir=$(TESTNET_ROOT) --out $(TESTNET_CONF)
supervisord -n -d $(TESTNET_ROOT) -l $(TESTNET_LOG) -c $(TESTNET_CONF)
2018-06-06 15:17:03 +02:00
2018-06-14 16:04:42 +02:00
test: debug-configure
2018-06-20 14:34:48 +02:00
ninja
2018-06-14 16:04:42 +02:00
ninja test
2018-05-21 16:28:15 +02:00
format:
2018-05-21 16:31:52 +02:00
clang-format -i $$(find daemon llarp include | grep -E '\.[h,c](pp)?$$')