From f73a878fd1af16c6cf9b2d153b51753374f1a159 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 22 Dec 2018 09:27:48 +0000 Subject: [PATCH] Makefile: Emit a `etc/config.sh' snippet about target architectures. Not needed yet, but may come in handy later. --- .gitignore | 1 + Makefile | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/.gitignore b/.gitignore index 339c3b3..5de6399 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /bin/ /inst.*/ +/etc/config.sh /etc/*-setup.sh diff --git a/Makefile b/Makefile index 1411e61..5c1ffc1 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,9 @@ android-arm64_ARCH = aarch64-linux-android android-x86_ARCH = i686-linux-android android-x86_64_ARCH = x86_64-linux-android +CONFIG_VARS += FLAVOURS +CONFIG_VARS += $(foreach f,$(FLAVOURS), $f_ARCHS) + V = 0 v_tag = $(call v_tag_$V,$1) v_tag_0 = @printf " %-8s %s\n" "$1" "$@"; @@ -53,6 +56,18 @@ $(BINSCRIPTS): bin/%: src/%.in $(call v_tag,SED)sed 's@crossdir@$(CROSSDIR)' $< >$@.new && \ chmod +x $@.new && mv $@.new $@ +fix = $(subst -,_,$1) +quote = '$(subst ','\'',$1)'#' + +TARGETS += etc/config.sh +etc/config.sh: Makefile + $(V_AT)mkdir -p $(dir $@) + $(call v_tag,GEN){ \ + echo '### -*-sh-*- GENERATED by mdw-cross/Makefile'; \ + $(foreach v,$(CONFIG_VARS), \ + echo $(call fix,$v)=$(call quote,$(call quote,$($v)));) \ + } >$@.new && mv $@.new $@ + all:: $(TARGETS) CLEANFILES += $(TARGETS) -- 2.11.0