Makefile needed for source tar generation.
authorBjoern Sikora <bjoern.sikora@intra2net.com>
Thu, 15 Oct 2009 15:11:38 +0000 (17:11 +0200)
committerBjoern Sikora <bjoern.sikora@intra2net.com>
Thu, 15 Oct 2009 15:11:38 +0000 (17:11 +0200)
Makefile [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..44b1345
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,41 @@
+# fake Makefile
+
+TAR = tar
+GZIP_ENV = --best
+
+project = $(shell grep "AM_INIT_AUTOMAKE" configure.in | sed -e "s/AM_INIT_AUTOMAKE(\(.*\)\,\(.*\))/\1/")
+version = $(shell grep "AM_INIT_AUTOMAKE" configure.in | sed -e "s/AM_INIT_AUTOMAKE(\(.*\)\,\(.*\))/\2/")
+distdir = $(project)-$(version)
+
+dist: dirmake
+       -chmod -R a+r $(distdir)
+       GZIP=$(GZIP_ENV) $(TAR) czf $(distdir).tar.gz $(distdir)
+       -rm -rf $(distdir)
+
+dirmake:
+       -rm -rf $(distdir)
+       mkdir $(distdir)
+       cp CMakeLists.txt $(distdir)
+       for N in $(shell \
+                        for D in `find . -type d` ; do \
+                                if [ "$$D" != "./$(distdir)" ] && [ "$$D" != "./SRPMS" ] && \
+                                   ! echo $$D | grep -q ".git" ; then \
+                                    echo $$D ; \
+                                fi ; \
+                        done) ; \
+                do \
+                        mkdir -p $(distdir)/$$N ; \
+                done
+       for N in $(shell \
+                        for D in `find . -maxdepth 1 -mindepth 1 -type d` ; do \
+                                if [ "$$D" != "./$(distdir)" ] && [ "$$D" != "./SRPMS" ] ; then \
+                                        for N in `find $$D` ; do \
+                                                if ! echo $$N | grep ".git" >/dev/null ; then \
+                                                        echo $$N ; \
+                                                fi \
+                                        done \
+                                fi ; \
+                        done) ; \
+                do \
+                        cp --parents -P $$N $(distdir) ; \
+                done