-
Notifications
You must be signed in to change notification settings - Fork 94
/
Cleanfile
63 lines (54 loc) · 1.8 KB
/
Cleanfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
.PHONY: distclean distclean_all_subdirs distclean_all_subdirs_internal
ifneq ($(V),1)
.SILENT:
endif
_cf = Cleanfile
_d1 = ../
_d2 = $(_d1)../
_d3 = $(_d2)../
_d4 = $(_d3)../
_d5 = $(_d4)../
_d6 = $(_d5)../
_d7 = $(_d6)../
_d8 = $(_d7)../
find_sdk_src_root = $(if $(wildcard $(_cf)),,$(if $(wildcard $(_d1)$(_cf)),$(_d1),$(if $(wildcard $(_d2)$(_cf)),$(_d2),$(if $(wildcard $(_d3)$(_cf)),$(_d3),$(if $(wildcard $(_d4)$(_cf)),$(_d4),$(if $(wildcard $(_d5)$(_cf)),$(_d5),$(if $(wildcard $(_d6)$(_cf)),$(_d6),$(if $(wildcard $(_d7)$(_cf)),$(_d7),$(if $(wildcard $(_d8)$(_cf)),$(_d8),)))))))))
ifneq ($(wildcard $(_CF_DIR)Cleanfile),)
_SDK_SRC_ROOT = $(_CF_DIR)
endif
ifeq ($(wildcard $(_SDK_SRC_ROOT)Cleanfile),)
_SDK_SRC_ROOT = $(find_sdk_src_root)
endif
include $(_SDK_SRC_ROOT)crossplatform.mk
subdirs := $(sort $(filter-out .configs obj __pycache__,$(hs_ls_dir)))
cd_make_distclean_all_subdirs = $(cd) $(call fp_opt_quotes,$(1)) && $(_MAKE) -f $(_SDK_SRC_ROOT)../Cleanfile _SDK_SRC_ROOT=$(_SDK_SRC_ROOT)../ $(if $(BUILD_DIR),BUILD_DIR=$(BUILD_DIR)$(1)/ ,) distclean distclean_all_subdirs_internal && cd ..
distclean_all_subdirs:
$(call echo,This may take a while...)
ifdef _SDK_SRC_ROOT
$(call hs_crossloop,$(subdirs),cd_make_distclean_all_subdirs)
endif
$(call echo,Done.)
distclean_all_subdirs_internal:
ifdef _SDK_SRC_ROOT
$(call hs_crossloop,$(subdirs),cd_make_distclean_all_subdirs)
endif
distclean:
ifdef _SDK_SRC_ROOT
ifndef KEEP_CONFIGS
$(if $(wildcard .configs/),$(call rmr,.configs/),)
endif
ifndef KEEP_MAKEFILES
$(call rm,*.Makefile)
endif
ifndef KEEP_OBJS
$(if $(wildcard obj/),$(call rmr,obj/),)
endif
ifndef KEEP_PY
$(call rm,_py*.c)
$(call rm,_py*.pyd)
$(if $(wildcard __pycache__/),$(call rmr,__pycache__/),)
endif
ifndef KEEP_WORKSPACES
$(call rm,*.ews)
endif
endif
$(MAKEFILE_LIST): ;