]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Improve dev.mk to be more platform independent
authorDavid Givone <david@givone.net>
Mon, 3 Sep 2012 22:09:52 +0000 (15:09 -0700)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 13 Sep 2012 18:53:18 +0000 (20:53 +0200)
The dev.mk was improved to allow for the make dist to work on mac os x:

1) asciidoc may not always be install to /etc, so also check /usr/local/etc
2) --parents parameter for cp does not work on mac so use rsync --relative
3) replaced -a tar flag with somesomething that should work across
   platforms

dev.mk.in

index a3c83d5d2a0d4bf7f1478a6b308edd1bb6de3842..bc0908bcabb74578955dc1d9fcf99567bb8bd3aa 100644 (file)
--- a/dev.mk.in
+++ b/dev.mk.in
@@ -6,7 +6,10 @@ all_cppflags += -MD -MP -MF .deps/$(subst .._,,$(subst /,_,$<)).d
 ASCIIDOC = asciidoc
 GPERF = gperf
 XSLTPROC = xsltproc
-MANPAGE_XSL = /etc/asciidoc/docbook-xsl/manpage.xsl
+MANPAGE_XSL = $(shell if [ -e /usr/local/etc/asciidoc/docbook-xsl/manpage.xsl ]; \
+                then echo /usr/local/etc/asciidoc/docbook-xsl/manpage.xsl; \
+                else echo /etc/asciidoc/docbook-xsl/manpage.xsl; fi)
+
 
 version := \
     $(shell (git --git-dir=$(srcdir)/.git describe --dirty || git --git-dir=$(srcdir)/.git describe || echo vunknown) \
@@ -15,8 +18,10 @@ version := \
 dist_dir = ccache-$(version)
 dist_archives = \
     ccache-$(version).tar.bz2 \
-    ccache-$(version).tar.gz \
-    ccache-$(version).tar.xz
+    ccache-$(version).tar.gz
+ifneq ($(shell uname), Darwin)
+    dist_archives += ccache-$(version).tar.xz
+endif
 
 generated_docs = \
     ccache.1 AUTHORS.html INSTALL.html LICENSE.html MANUAL.html NEWS.html \
@@ -98,10 +103,16 @@ $(dist_archives): $(dist_files)
        dir=$$tmpdir/$(dist_dir) && \
        mkdir $$dir && \
        (cd $(srcdir) && \
-        cp -r --parents $(source_dist_files) $$dir) && \
+        rsync -r --relative $(source_dist_files) $$dir) && \
        cp $(built_dist_files) $$dir && \
        (cd $$tmpdir && \
-        tar caf $(CURDIR)/$@ $(dist_dir)) && \
+        tarcompression= && \
+        case $@ in \
+            *.bz2) tarcompression=-j ;; \
+            *.gz) tarcompression=-z ;; \
+            *.xz) tarcompression=-J ;; \
+        esac && \
+        tar -c $$tarcompression -f $(CURDIR)/$@ $(dist_dir)) && \
        rm -rf $$tmpdir
 
 .PHONY: distcheck