/
Makefile
43 lines (33 loc) · 855 Bytes
/
Makefile
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
.PHONY: all _phony
all:
# make git-dotfiles first and restart make
ifeq ($(shell command -v git-dotfiles),)
include bin/.aliases/.done
bin/.aliases/.done:
$(MAKE) -C bin .aliases/.done
endif
include ~/_help.mk
define SUBDIR_TEMPLATE
$(1): _phony
$$(MAKE) -C $$@
$(1)\%%: _phony
$$(MAKE) -C $(1) $$*
help-src: help-src-$(1)
help-src-$(1):
@echo "##"
@echo "$(1):"
@echo "##"
@echo "$(1)%target:"
endef
SUBDIRS := $(shell git-dotfiles ls-files | sed -n -e 's|/Makefile$$||p')
$(foreach subdir,$(SUBDIRS),$(eval $(call SUBDIR_TEMPLATE,$(subdir))))
SUBDIRS_EXCLUDE := docs/resume-cv .xmonad-testing
## Invoke make for all subdirs with Makefiles
all: $(filter-out $(SUBDIRS_EXCLUDE),$(SUBDIRS))
.cargo/bin: bin/.ext
.rustup: bin/.ext
## Invoke "make gc" in sub-Makefiles
gc: .cargo/bin%gc
gc: bin/.ext%gc
gc: bin/.ext-npm%gc
gc: src-elixir%gc