-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.plugins
42 lines (34 loc) · 898 Bytes
/
Makefile.plugins
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
plugins += std
plugins += shmem
plugins += fds
dep-fds := std
dep-shmem := std
define gen-plugin-rule
ifneq ($(2),)
plugindep := plugins/$(2)/built-in.o
else
plugindep :=
endif
plugins/$(1)/%: $(EARLY-GEN) $$(plugindep)
$$(Q) $$(MAKE) $$(build)=plugins/$(1) $$@
plugins/$(1)/built-in.o: $(EARLY-GEN) $$(plugindep)
$$(Q) $$(MAKE) $$(build)=plugins/$(1) all
endef
$(foreach plugin, \
$(plugins), \
$(eval $(call gen-plugin-rule,$(plugin),$(dep-$(plugin)))))
all-plugins = $(patsubst %,plugins/%/built-in.o,$(plugins))
plugins: $(all-plugins)
@true
define gen-plugin-clean
clean-plugin-$(1):
$$(Q) $$(MAKE) $$(build)=plugins/$(1) clean
all-plugin-clean += clean-plugin-$(1)
.PHONY: clean-plugin-$(1)
endef
$(foreach plugin, \
$(plugins), \
$(eval $(call gen-plugin-clean,$(plugin))))
clean-plugins: $(all-plugin-clean)
@true
.PHONY: plugins clean-plugins