From 065016393a3c27720f543b00517d405fed94568a Mon Sep 17 00:00:00 2001 From: Dean Eigenmann <7621705+decanus@users.noreply.github.com> Date: Sat, 3 Oct 2020 07:26:49 +0200 Subject: [PATCH] fix/makefile (#194) * rename make targets * rename * fixes * fix * fix * added example 2 * fix * fix * silly me --- Makefile | 35 ++++++++++++++++++++--------------- waku.nimble | 10 +++++----- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 4dca8b7c9..21e69565c 100644 --- a/Makefile +++ b/Makefile @@ -21,10 +21,11 @@ DOCKER_IMAGE_NIM_PARAMS ?= -d:chronicles_colors:none -d:insecure all \ deps \ update \ - wakusim \ - wakunode \ + sim1 \ + wakunode1 \ wakunode2 \ - wakuexample \ + example1 \ + example2 \ test \ clean \ libbacktrace @@ -45,7 +46,7 @@ GIT_SUBMODULE_UPDATE := git submodule update --init --recursive else # "variables.mk" was included. Business as usual until the end of this file. # default target, because it's the first one that doesn't start with '.' -all: | wakunode wakusim wakuexample wakunode2 wakusim2 wakuexample2 +all: | wakunode1 sim1 example1 wakunode2 sim2 example2 # must be included after the default target -include $(BUILD_SYSTEM_DIR)/makefiles/targets.mk @@ -68,25 +69,29 @@ update: | update-common $(MAKE) waku.nims $(HANDLE_OUTPUT) # a phony target, because teaching `make` how to do conditional recompilation of Nim projects is too complicated -wakunode: | build deps +wakunode1: | build deps echo -e $(BUILD_MSG) "build/$@" && \ - $(ENV_SCRIPT) nim wakunode $(NIM_PARAMS) waku.nims + $(ENV_SCRIPT) nim wakunode1 $(NIM_PARAMS) waku.nims -wakusim: | build deps wakunode +sim1: | build deps wakunode1 echo -e $(BUILD_MSG) "build/$@" && \ - $(ENV_SCRIPT) nim wakusim $(NIM_PARAMS) waku.nims + $(ENV_SCRIPT) nim sim1 $(NIM_PARAMS) waku.nims -wakuexample: | build deps +example1: | build deps echo -e $(BUILD_MSG) "build/$@" && \ - $(ENV_SCRIPT) nim wakuexample $(NIM_PARAMS) waku.nims + $(ENV_SCRIPT) nim example1 $(NIM_PARAMS) waku.nims + +example2: | build deps + echo -e $(BUILD_MSG) "build/$@" && \ + $(ENV_SCRIPT) nim example2 $(NIM_PARAMS) waku.nims wakunode2: | build deps echo -e $(BUILD_MSG) "build/$@" && \ $(ENV_SCRIPT) nim wakunode2 $(NIM_PARAMS) waku.nims -wakusim2: | build deps wakunode2 +sim2: | build deps wakunode2 echo -e $(BUILD_MSG) "build/$@" && \ - $(ENV_SCRIPT) nim wakusim2 $(NIM_PARAMS) waku.nims + $(ENV_SCRIPT) nim sim2 $(NIM_PARAMS) waku.nims scripts2: | build deps wakunode2 echo -e $(BUILD_MSG) "build/$@" && \ @@ -100,9 +105,9 @@ test2: echo -e $(BUILD_MSG) "build/$@" && \ $(ENV_SCRIPT) nim test2 $(NIM_PARAMS) waku.nims -wakuexample2: +example2: echo -e $(BUILD_MSG) "build/$@" && \ - $(ENV_SCRIPT) nim wakuexample2 $(NIM_PARAMS) waku.nims + $(ENV_SCRIPT) nim example2 $(NIM_PARAMS) waku.nims chat2: echo -e $(BUILD_MSG) "build/$@" && \ @@ -117,7 +122,7 @@ libbacktrace: + $(MAKE) -C vendor/nim-libbacktrace --no-print-directory BUILD_CXX_LIB=0 # build a docker image for the fleet -docker-image: MAKE_TARGET ?= wakunode +docker-image: MAKE_TARGET ?= wakunode1 docker-image: DOCKER_IMAGE_TAG ?= $(MAKE_TARGET) docker-image: DOCKER_IMAGE_NAME ?= statusteam/nim-waku:$(DOCKER_IMAGE_TAG) docker-image: diff --git a/waku.nimble b/waku.nimble index 8c2e29122..1cd8808f0 100644 --- a/waku.nimble +++ b/waku.nimble @@ -47,14 +47,14 @@ task test, "Run waku v1 tests": task test2, "Run waku v2 tests": test "all_tests_v2" -task wakunode, "Build Waku v1 cli node": +task wakunode1, "Build Waku v1 cli node": buildBinary "wakunode", "waku/node/v1/", "-d:chronicles_log_level=TRACE" -task wakusim, "Build Waku v1 simulation tools": +task sim1, "Build Waku v1 simulation tools": buildBinary "quicksim", "waku/node/v1/", "-d:chronicles_log_level=INFO" buildBinary "start_network", "waku/node/v1/", "-d:chronicles_log_level=DEBUG" -task wakuexample, "Build Waku v1 example": +task example1, "Build Waku v1 example": buildBinary "example", "examples/v1/", "-d:chronicles_log_level=DEBUG" # TODO Also build Waku store and filter protocols here @@ -64,7 +64,7 @@ task protocol2, "Build the experimental Waku protocol": task wakunode2, "Build Experimental Waku cli": buildBinary "wakunode2", "waku/node/v2/", "-d:chronicles_log_level=TRACE" -task wakusim2, "Build Experimental Waku simulation tools": +task sim2, "Build Experimental Waku simulation tools": buildBinary "quicksim2", "waku/node/v2/", "-d:chronicles_log_level=DEBUG" buildBinary "start_network2", "waku/node/v2/", "-d:chronicles_log_level=TRACE" @@ -73,7 +73,7 @@ task scripts2, "Build Waku v2 scripts": buildBinary "rpc_subscribe", "waku/node/v2/rpc/", "-d:chronicles_log_level=DEBUG" buildBinary "rpc_query", "waku/node/v2/rpc/", "-d:chronicles_log_level=DEBUG" -task wakuexample2, "Build example Waku usage": +task example2, "Build example Waku usage": let name = "basic2" buildBinary name, "examples/v2/", "-d:chronicles_log_level=DEBUG"