diff --git a/README.md b/README.md index adf9e6d..5500e1e 100644 --- a/README.md +++ b/README.md @@ -190,6 +190,12 @@ automatic bumps. You do it like this: git submodule update --recursive vendor/news ``` +### clean-cross + +Confusingly named target that deletes libnatpmp and miniupnp objects and static +libraries. Useful when you're cross-compiling and don't want to `make clean` +and have to rebuild the compiler. + ### clean-common Internal target that needs to be a dependency for a custom "clean" target that diff --git a/makefiles/targets.mk b/makefiles/targets.mk index b63534d..990428f 100644 --- a/makefiles/targets.mk +++ b/makefiles/targets.mk @@ -14,6 +14,7 @@ nat-libs \ libminiupnpc.a \ libnatpmp.a \ + clean-cross \ clean-common \ mrproper \ github-ssh \ @@ -102,9 +103,9 @@ endif libnatpmp.a: | sanity-checks ifeq ($(OS), Windows_NT) - + "$(MAKE)" -C vendor/nim-nat-traversal/vendor/libnatpmp CC=gcc CFLAGS="-Wall -Os -DWIN32 -DNATPMP_STATICLIB -DENABLE_STRNATPMPERR -DNATPMP_MAX_RETRIES=4 $(CFLAGS)" $@ $(HANDLE_OUTPUT) + + "$(MAKE)" -C vendor/nim-nat-traversal/vendor/libnatpmp-upstream CC=gcc CFLAGS="-Wall -Os -DWIN32 -DNATPMP_STATICLIB -DENABLE_STRNATPMPERR -DNATPMP_MAX_RETRIES=4 $(CFLAGS)" $@ $(HANDLE_OUTPUT) else - + "$(MAKE)" CFLAGS="-Wall -Os -DENABLE_STRNATPMPERR -DNATPMP_MAX_RETRIES=4 $(CFLAGS)" -C vendor/nim-nat-traversal/vendor/libnatpmp $@ $(HANDLE_OUTPUT) + + "$(MAKE)" CFLAGS="-Wall -Os -DENABLE_STRNATPMPERR -DNATPMP_MAX_RETRIES=4 $(CFLAGS)" -C vendor/nim-nat-traversal/vendor/libnatpmp-upstream $@ $(HANDLE_OUTPUT) endif #- depends on Git submodules being initialised @@ -115,10 +116,12 @@ $(NIMBLE_DIR): NIMBLE_DIR="$(CURDIR)/$(NIMBLE_DIR)" PWD_CMD="$(PWD)" \ git submodule foreach --recursive --quiet '$(CURDIR)/$(BUILD_SYSTEM_DIR)/scripts/create_nimble_link.sh "$$sm_path"' -clean-common: - rm -rf build/{*.exe,*.so,*.so.0} $(NIMBLE_DIR) $(NIM_BINARY) $(NIM_DIR)/bin/timestamp $(NIM_DIR)/nimcache nimcache +clean-cross: + [[ -e vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc ]] && "$(MAKE)" -C vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc clean $(HANDLE_OUTPUT) || true - + [[ -e vendor/nim-nat-traversal/vendor/libnatpmp ]] && "$(MAKE)" -C vendor/nim-nat-traversal/vendor/libnatpmp clean $(HANDLE_OUTPUT) || true + + [[ -e vendor/nim-nat-traversal/vendor/libnatpmp-upstream ]] && "$(MAKE)" -C vendor/nim-nat-traversal/vendor/libnatpmp-upstream clean $(HANDLE_OUTPUT) || true + +clean-common: clean-cross + rm -rf build/{*.exe,*.so,*.so.0} $(NIMBLE_DIR) $(NIM_BINARY) $(NIM_DIR)/bin/timestamp $(NIM_DIR)/nimcache nimcache # dangerous cleaning, because you may have not-yet-pushed branches and commits in those vendor repos you're about to delete mrproper: clean