chiark / gitweb /
Makefile.am: Add a git-tar target, that removes all elogind masks from the sources...
authorSven Eden <yamakuzure@gmx.net>
Wed, 22 Feb 2017 14:13:33 +0000 (15:13 +0100)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:23:22 +0000 (10:23 +0100)
Makefile.am

index fe4b811c734758d48c62398226e364d6d9d09087..f91734b5adae31c05afb163ab4cc802be76c9de9 100644 (file)
@@ -941,6 +941,26 @@ dist:
 git-tag:
        git tag -s "v$(VERSION)" -m "elogind $(VERSION)"
 
+.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) && \
+        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 ; \
+        done ; \
+        for l in `find elogind-$(VERSION)-raw/ -type l | cut -d '/' -f 2-` ; do \
+               $(MKDIR_P) elogind-$(VERSION)/`dirname $$l` ; \
+               cp -P elogind-$(VERSION)-raw/$$l elogind-$(VERSION)/$$l ; \
+        done ; \
+        tar czf elogind-$(VERSION).tar.gz elogind-$(VERSION) ; \
+        rm -rf elogind-$(VERSION) elogind-$(VERSION)-raw) ; \
+       mv /var/tmp/elogind-$(VERSION).tar.gz ./
+
 .PHONY: install-tree
 install-tree: all
        rm -rf $(abs_srcdir)/install-tree