From cc14b530907c093b7af9ebd3345197411503974b Mon Sep 17 00:00:00 2001 From: roktas Date: Wed, 8 Nov 2006 10:32:53 +0000 Subject: Changes for 'website': + Execute $(MAIN) in './' otherwise this would fail if $(MAIN) is not available in PATH. + Make echo off during file checking. + Copy $(deb_main) from parent directory. Changes for 'deb': + Calculate $(deb_main) the essential Debian package to install. + Place this target before website target. + 'deb' should be a PHONY target. + Make echo off during tool checking. Changes for 'tarball': + Use all-lowercase $(THIS) instead of $(MAIN). git-svn-id: https://pandoc.googlecode.com/svn/trunk@81 788f1e2b-df1e-0410-8736-df70ead52e1b --- Makefile | 58 ++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index eab98e79c..ddb10b814 100644 --- a/Makefile +++ b/Makefile @@ -259,7 +259,7 @@ tags: $(src_all) LC_ALL=C sort tags >tags.sorted; mv tags.sorted tags .PHONY: tarball -fullname:=$(NAME)-$(VERSION) +fullname:=$(THIS)-$(VERSION) tarball_name:=$(fullname).tar.gz cleanup_files+=$(tarball_name) tarball: $(tarball_name) @@ -268,49 +268,59 @@ $(tarball_name): tar cvzf $(tarball_name) $(fullname) -rm -rf $(fullname) +.PHONY: deb +deb_name:=$(shell grep ^Package debian/control | cut -d' ' -f2 | head -n 1) +deb_version:=$(shell head -n 1 debian/changelog | cut -f2 -d' ' | tr -d '()') +deb_arch:=i386 +deb_main:=$(deb_name)_$(deb_version)_$(deb_arch).deb +deb: debian + @[ -x /usr/bin/fakeroot ] || { \ + echo "*** Please install fakeroot package. ***"; \ + exit 1; \ + } + @[ -x /usr/bin/dpkg-buildpackage ] || { \ + echo "*** Please install dpkg-dev package. ***"; \ + exit 1; \ + } + if [ -x /usr/bin/debuild ]; then \ + debuild -uc -us -i.svn -I.svn -i_darcs -I_darcs --lintian-opts -i; \ + else \ + echo "*** Please install devscripts package. ***"; \ + echo "*** Using dpkg-buildpackage for package building. ***"; \ + dpkg-buildpackage -rfakeroot -uc -us -i.svn -I.svn -i_darcs -I_darcs; \ + fi + .PHONY: website web_src:=web web_dest:=web/pandoc -make_page := $(MAIN) -s -B $(web_src)/header.html -A $(web_src)/footer.html \ - -H $(web_src)/css +make_page:=./$(MAIN) -s -B $(web_src)/header.html \ + -A $(web_src)/footer.html \ + -H $(web_src)/css cleanup_files+=$(web_dest) website: $(web_dest) - -$(web_dest)/: $(MAIN) html/ $(tarball_name) - [ -f $(osx_dmg_name) ] || { \ +$(web_dest)/: $(MAIN) html $(tarball_name) + @[ -f $(osx_dmg_name) ] || { \ echo "*** Missing $(osx_dmg_name). ***"; \ exit 1; \ } + @[ -f ../$(deb_main) ] || { \ + echo "*** Missing ../$(deb_main). ***"; \ + exit 1; \ + } -rm -rf $(web_dest) mkdir $(web_dest) cp -r html $(web_dest)/doc cp $(osx_dmg_name) $(web_dest)/ + cp ../$(deb_main) $(web_dest)/ cp $(tarball_name) $(web_dest)/ cp $(web_src)/*.css $(web_dest)/ $(make_page) README > $(web_dest)/README.html $(make_page) INSTALL > $(web_dest)/INSTALL.html $(make_page) changelog > $(web_dest)/history.html sed -e 's/@TARBALL_NAME@/$(tarball_name)/g' $(web_src)/index.txt | \ - sed -e 's/@DEB_NAME@/$(deb_name)/g' | \ + sed -e 's/@DEB_NAME@/$(deb_main)/g' | \ $(make_page) > $(web_dest)/index.html -deb: debian - [ -x /usr/bin/fakeroot ] || { \ - echo "*** Please install fakeroot package. ***"; \ - exit 1; \ - } - [ -x /usr/bin/dpkg-buildpackage ] || { \ - echo "*** Please install dpkg-dev package. ***"; \ - exit 1; \ - } - if [ -x /usr/bin/debuild ]; then \ - debuild -uc -us -i.svn -I.svn -i_darcs -I_darcs --lintian-opts -i; \ - else \ - echo "*** Please install devscripts package. ***"; \ - echo "*** Using dpkg-buildpackage for package building. ***"; \ - dpkg-buildpackage -rfakeroot -uc -us -i.svn -I.svn -i_darcs -I_darcs; \ - fi - .PHONY: distclean clean distclean: clean if [ -d debian ]; then \ -- cgit v1.2.3