3 .SECONDEXPANSION
: #sorry
6 CROSSDIR
:= $(shell pwd
)
8 FLAVOURS
+= linux-cross
9 linux-cross_ARCHS
= linux-armel linux-armhf linux-arm64
10 linux-armel_ARCH
= arm-linux-gnueabi
11 linux-armhf_ARCH
= arm-linux-gnueabihf
12 linux-arm64_ARCH
= aarch64-linux-gnu
14 FLAVOURS
+= linux-native
15 linux-native_ARCHS
= linux-i386 linux-amd64
16 linux-i386_ARCH
= i686-linux-gnu
17 linux-amd64_ARCH
= x86_64-linux-gnu
19 FLAVOURS
+= android-cross
20 android-cross_ARCHS
= android-arm android-arm64 android-x86 android-x86_64
21 android-arm_ARCH
= arm-linux-androideabi
22 android-arm64_ARCH
= aarch64-linux-android
23 android-x86_ARCH
= i686-linux-android
24 android-x86_64_ARCH
= x86_64-linux-android
27 v_tag
= $(call v_tag_
$V,$1)
28 v_tag_0
= @printf
" %-8s %s\n" "$1" "$@";
33 SETUPS
+= etc
/$2-setup.sh
36 $(foreach f
,$(FLAVOURS
), \
37 $(foreach a
,$($f_ARCHS), \
38 $(eval
$(call define-setup
,$f,$a))))
41 setup-flavour
= $($1_FLAVOUR)
43 $(SETUPS
): etc
/%-setup.sh
: $$(call setup-flavour
,$$*)-setup.sh.in Makefile
44 $(V_AT
)mkdir
-p
$(dir $@
)
45 $(call v_tag
,SED
)sed
's/@arch@/$($*_ARCH)/g' $< >$@.new
&& \
48 SCRIPTS
= mdw-cross crosstool
49 BINSCRIPTS
= $(addprefix bin
/,$(SCRIPTS
))
50 TARGETS
+= $(BINSCRIPTS
)
51 $(BINSCRIPTS
): bin
/%: src
/%.in
52 $(V_AT
)mkdir
-p
$(dir $@
)
53 $(call v_tag
,SED
)sed
's\a@crossdir@\a$(CROSSDIR)\a' $< >$@.new
&& \
54 chmod
+x
$@.new
&& mv
$@.new
$@
58 CLEANFILES
+= $(TARGETS
)
59 clean::; rm -f
$(CLEANFILES
)