Skip to content

Commit aff16fd

Browse files
committed
depends: Add 'make clean' and 'make clean-all' rules
It's useful to have a standard way to clean up the work done by the depends system when testing changes to it. The `make clean-all` rule removes build artifacts for all supported architectures (in addition to sources/), while `make clean` only removes artifacts for current architecture (`BUILD`).
1 parent f15b72f commit aff16fd

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

depends/Makefile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.NOTPARALLEL :
22

33
SOURCES_PATH ?= $(BASEDIR)/sources
4+
WORK_PATH = $(BASEDIR)/work
45
BASE_CACHE ?= $(BASEDIR)/built
56
SDK_PATH ?= $(BASEDIR)/SDKs
67
NO_QT ?=
@@ -29,9 +30,9 @@ else
2930
release_type=release
3031
endif
3132

32-
base_build_dir=$(BASEDIR)/work/build
33-
base_staging_dir=$(BASEDIR)/work/staging
34-
base_download_dir=$(BASEDIR)/work/download
33+
base_build_dir=$(WORK_PATH)/build
34+
base_staging_dir=$(WORK_PATH)/staging
35+
base_download_dir=$(WORK_PATH)/download
3536
canonical_host:=$(shell ./config.sub $(HOST))
3637
build:=$(shell ./config.sub $(BUILD))
3738

@@ -165,6 +166,12 @@ $(host_prefix)/share/config.site: check-packages
165166

166167
check-packages: check-sources
167168

169+
clean-all: clean
170+
@rm -rf $(SOURCES_PATH) x86_64* i686* mips* arm* aarch64*
171+
172+
clean:
173+
@rm -rf $(WORK_PATH) $(BASE_CACHE) $(BUILD)
174+
168175
install: check-packages $(host_prefix)/share/config.site
169176

170177

@@ -178,4 +185,4 @@ download-win:
178185
@$(MAKE) -s HOST=x86_64-w64-mingw32 download-one
179186
download: download-osx download-linux download-win
180187

181-
.PHONY: install cached download-one download-osx download-linux download-win download check-packages check-sources
188+
.PHONY: install cached clean clean-all download-one download-osx download-linux download-win download check-packages check-sources

0 commit comments

Comments
 (0)