-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
36 lines (26 loc) · 852 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
SUBDIRS := acarsdec/. dump1090/. rtl-ais_es/. LTE-Cell-Scanner/.
# Limited version
#.PHONY : all $(SUBDIRS)
# all : $(SUBDIRS)
#
#$(SUBDIRS) :
# $(MAKE) -C $@ clean all
#Arbitrary target
#SUBDIRS_POST := $(foreach t,$(SUBDIRS),$(addsuffix "/.",$t))
TARGETS := all clean # whatever else, but must not contain '/'
# foo/.all bar/.all foo/.clean bar/.clean
SUBDIRS_TARGETS := \
$(foreach t,$(TARGETS),$(addsuffix $t,$(SUBDIRS)))
.PHONY : $(TARGETS) $(SUBDIRS_TARGETS)
# static pattern rule, expands into:
#all clean : % : foo/.% bar/.%
$(TARGETS) : % : $(addsuffix %,$(SUBDIRS))
@echo 'Done "$*" target'
# # here, for foo/.all:
# $(@D) is foo
# # $(@F) is .all, with leading period
# $(@F:.%=%) is just all
#
# -j 2 should not be increased in RPi2 (memory exhausts easily)
$(SUBDIRS_TARGETS) :
$(MAKE) -C $(@D) $(@F:.%=%) -j 2