chiark / gitweb /
Makefile: Add silent-rules machinery for completely silent actions.
[mdw-cross] / Makefile
CommitLineData
1a141be6
MW
1### -*-makefile-*-
2
3.SECONDEXPANSION: #sorry
4all::
5
a3c31732
MW
6FLAVOURS += linux-cross
7linux-cross_ARCHS = linux-armel linux-armhf linux-arm64
8linux-armel_ARCH = arm-linux-gnueabi
9linux-armhf_ARCH = arm-linux-gnueabihf
10linux-arm64_ARCH = aarch64-linux-gnu
11
12FLAVOURS += linux-native
13linux-native_ARCHS = linux-i386 linux-amd64
14linux-i386_ARCH = i686-linux-gnu
15linux-amd64_ARCH = x86_64-linux-gnu
16
17FLAVOURS += android-cross
18android-cross_ARCHS = android-arm android-arm64 android-x86 android-x86_64
19android-arm_ARCH = arm-linux-androideabi
20android-arm64_ARCH = aarch64-linux-android
21android-x86_ARCH = i686-linux-android
22android-x86_64_ARCH = x86_64-linux-android
1a141be6
MW
23
24V = 0
25v_tag = $(call v_tag_$V,$1)
26v_tag_0 = @printf " %-8s %s\n" "$1" "$@";
7f281ec3
MW
27V_AT = $(V_AT_$V)
28V_AT_0 = @
1a141be6 29
a3c31732
MW
30define define-setup
31SETUPS += etc/$2-setup.sh
32$2_FLAVOUR = $1
33endef
34$(foreach f,$(FLAVOURS), \
35 $(foreach a,$($f_ARCHS), \
36 $(eval $(call define-setup,$f,$a))))
37
1a141be6 38TARGETS += $(SETUPS)
a3c31732 39setup-flavour = $($1_FLAVOUR)
1a141be6 40
a3c31732
MW
41$(SETUPS): etc/%-setup.sh: $$(call setup-flavour,$$*)-setup.sh.in Makefile
42 $(call v_tag,GEN)sed 's/@arch@/$($*_ARCH)/g' $< >$@.new && mv $@.new $@
1a141be6
MW
43
44all:: $(TARGETS)
45
46CLEANFILES += $(TARGETS)
47clean::; rm -f $(CLEANFILES)
a3c31732
MW
48
49show:; : $(VAR)