From: David Givone Date: Mon, 3 Sep 2012 22:09:52 +0000 (-0700) Subject: Improve dev.mk to be more platform independent X-Git-Tag: v3.2~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=986d47a59109f6f64a4ada6529554bc5d1ee88a5;p=thirdparty%2Fccache.git Improve dev.mk to be more platform independent 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 --- diff --git a/dev.mk.in b/dev.mk.in index a3c83d5d2..bc0908bca 100644 --- 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