]> pere.pagekite.me Git - text-infor-lif-else-laula.git/commitdiff
Made Makefile easier to configure.
authorPetter Reinholdtsen <pere@hungry.com>
Thu, 16 Nov 2023 13:37:35 +0000 (14:37 +0100)
committerPetter Reinholdtsen <pere@hungry.com>
Thu, 16 Nov 2023 13:37:35 +0000 (14:37 +0100)
Makefile

index cbcbcfd596b6c3dd530c279ee7e89a686a34153f..0939a0b526af71efacaa6a4b0fff6fa5e8d7ea3b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,6 @@
+
+SOURCE = manuscript
+
 DBLATEX = dblatex
 
 DBLATEX_OPTS = \
@@ -9,22 +12,22 @@ DBLATEX_OPTS = \
        -V \
        -p data/pdf.xsl
 
-all: manuscript.pdf manuscript.epub
+all: $(SOURCE).pdf $(SOURCE).epub
 
-manuscript.xml: *.adoc manuscript-docinfo*.xml
-       asciidoctor -b docbook5 -d book manuscript.adoc --out-file=$@
-manuscript.pdf: manuscript.xml
+$(SOURCE).xml: *.adoc $(SOURCE)-docinfo*.xml
+       asciidoctor -b docbook5 -d book $(SOURCE).adoc --out-file=$@
+$(SOURCE).pdf: $(SOURCE).xml
        $(DBLATEX) $(DBLATEX_OPTS) $<
-manuscript.epub: manuscript.xml
+$(SOURCE).epub: $(SOURCE).xml
        dbtoepub $^
 
-manuscript.html: manuscript.xml
+$(SOURCE).html: $(SOURCE).xml
        xsltproc  --encoding UTF-8 \
            --output $(subst .pdf,.fo,$@) \
            data/stylesheet-html.xsl \
            $<
 
-manuscript-fop.fo: manuscript.xml
+$(SOURCE)-fop.fo: $(SOURCE).xml
        xsltproc  \
            --output $(subst .pdf,.fo,$@).new \
            data/stylesheet-fo.xsl \
@@ -32,10 +35,10 @@ manuscript-fop.fo: manuscript.xml
        xmllint --format $@.new > $@
        $(RM) $@.new
 
-manuscript-fop.pdf: manuscript-fop.fo
+$(SOURCE)-fop.pdf: $(SOURCE)-fop.fo
        fop -c data/fop-params.xconf -fo $(subst .pdf,.fo,$@) -pdf $@ ; \
 
 clean:
        $(RM) *~
 distclean:
-       $(RM) manuscript.xml manuscript.pdf manuscript.epub
+       $(RM) $(SOURCE).xml $(SOURCE).pdf $(SOURCE).epub $(SOURCE).html