scripts/mk/gitmk-proxy.mk: echo -e is not portable
[navymail.git] / scripts / mk / gitmk-proxy.mk
blobad96b72c7fd4adf0fbf0ae11257fcb8d4d472675
1 # build targets in Git, and export git's variables. All in *one* go.
2 # run as $(MAKE) -C git/ -f ../scripts/mk/gitmk-proxy.mk <git-targets> __export __export-file=path/to/file.mk
4 # Copyright (C) 2011 Kirill Smelkov <kirr@navytux.spb.ru>
7 # include Git's Makefile
8 include Makefile
11 ifeq ($(V),2)
12 QQ :=
13 else
14 QQ := @
15 endif
17 # this target exports variables
18 __export-vars := CC ALL_CFLAGS ALL_LDFLAGS LIBS X
19 __export-vvars := QUIET_CC
20 __export:
21 $(QQ)printf '%b' '# variables exported from git/Makefile (autogenerated)\n'\
22 $(foreach v,$(__export-vars),'GIT_$v := $(subst ','\'',$($v))\n') \
23 $(foreach v,$(__export-vvars),'GIT_$v = $(subst ','\'',$(value $v))\n') \
24 > $(__export-file)