summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-06-29 08:46:48 -0600
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-06-29 08:46:48 -0600
commit099c6ced849aaa9a6063fd1e63a3db571be70dde (patch)
treeb1cab07eacefceaeb72d5ca4d1a96dd0f26e07b8 /Makefile
parentf50a0e73d77bfcfb8b458840b8b7a440cca9770c (diff)
`make dist` wasn't working
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 7 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 1f84a37..57993c8 100644
--- a/Makefile
+++ b/Makefile
@@ -23,5 +23,12 @@ subdirs = wrapper
src_files = Makefile
src_files += common.top.mk common.bottom.mk config.mk configure
src_files += COPYING HACKING README
+obj_files = config.sh config.h
+
+config_vars = $(shell $(SED) -n 's/^\s*\([a-z][^ !?:=]*\).*=.*/\1/p' $(topobjdir)/config.mk) PACKAGE VERSION DESTDIR
+$(objdir)/config.sh: $(objdir)/config.mk
+ $(PRINTF) '%s=%s\n' $(foreach v,$(config_vars),$v $($v)) | LC_ALL=C $(SORT) > $@
+$(objdir)/config.h: $(objdir)/config.sh
+ . $(abspath $<) && $(PRINTF) '#define %s "%s"\n' $(foreach v,$(config_vars),$v '$($v)') PACKAGE_UPPER $${PACKAGE^^} | LC_ALL=C $(SORT) > $@
include $(topsrcdir)/common.bottom.mk