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