summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2017-02-23 17:20:49 +0100
committerSven Eden <yamakuzure@gmx.net>2017-03-14 10:23:22 +0100
commitc6999740c1a68767c5397306b8d7e14e08533111 (patch)
tree124f416e54ea418a3538f3e53457aa809112ab69 /Makefile.am
parent3c55423a96cf68ea1c947b512123de2f0bc95ec0 (diff)
Fixed gawk script for git-tar target.
The previous variant was nice and sleek. But unfortunately, there are constructs like: #if 0 (... old code ...) #else (... alternative code for elogind ...) #endif // 0 These fragments couldn't be handled by the old code, but can by the new one. To make this work, the precompiler macros must be set like shown above. Apart from that, all lines like: /// Any doxygen one-line-comments with elogind in it are removed are removed, too. Please note the three slashes. And finally, all commented out #include directives are removed as well.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am29
1 files changed, 20 insertions, 9 deletions
diff --git a/Makefile.am b/Makefile.am
index f91734b5a..d3d5ac718 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -943,15 +943,26 @@ git-tag:
.PHONY: git-tar
git-tar:
- git archive --format=tar --prefix=elogind-$(VERSION)-raw/ HEAD | \
- (cd /var/tmp/ && tar xf -) ; \
- (cd /var/tmp && rm -rf elogind-$(VERSION) && $(MKDIR_P) elogind-$(VERSION) && \
+ $(AM_V_at)git archive --format=tar --prefix=elogind-$(VERSION)-raw/ HEAD | \
+ (cd /var/tmp/ && tar xf -)
+ $(AM_V_GEN)(cd /var/tmp && rm -rf elogind-$(VERSION) && $(MKDIR_P) elogind-$(VERSION) && \
for f in `find elogind-$(VERSION)-raw/ -type f | cut -d '/' -f 2-` ; do \
- $(MKDIR_P) elogind-$(VERSION)/`dirname $$f` ; \
- $(AWK) '/^#if 0\s*$$/,/^#endif\s+\/\/\s+0\s*$$/{next}{print}' \
- elogind-$(VERSION)-raw/$$f \
- | $(SED) -e '/^\/\/\/ .*elogind.*$$/d' \
- -e '/^\/\/ #include.*$$/d' > elogind-$(VERSION)/$$f ; \
+ $(MKDIR_P) elogind-$(VERSION)/`dirname $$f` ; \
+ $(AWK) 'BEGIN { i=0;e=0 } \
+ /^#if\s+0\s*$$/ { i=1;next } \
+ /^#else\s*$$/ { \
+ { if ( i==1 ) e=1; else print }{next} \
+ } \
+ /^#endif\s*\/\/\s*0\s*$$/ { \
+ { if ( i==1 ) { i=0;e=0 } else print }{next} \
+ } \
+ /^\s*\/\/\/.*elogind.*$$/{ next } \
+ /^\s*\/\/\s*#include.+$$/{ next } \
+ { if ( (i==0) || (e==1) ) print }' \
+ elogind-$(VERSION)-raw/$$f \
+ > elogind-$(VERSION)/$$f ; \
+ chmod `stat -c '%a' elogind-$(VERSION)-raw/$$f` \
+ elogind-$(VERSION)/$$f ; \
done ; \
for l in `find elogind-$(VERSION)-raw/ -type l | cut -d '/' -f 2-` ; do \
$(MKDIR_P) elogind-$(VERSION)/`dirname $$l` ; \
@@ -959,7 +970,7 @@ git-tar:
done ; \
tar czf elogind-$(VERSION).tar.gz elogind-$(VERSION) ; \
rm -rf elogind-$(VERSION) elogind-$(VERSION)-raw) ; \
- mv /var/tmp/elogind-$(VERSION).tar.gz ./
+ $(AM_V_at)mv /var/tmp/elogind-$(VERSION).tar.gz ./
.PHONY: install-tree
install-tree: all