]> mj.ucw.cz Git - ads2.git/blobdiff - Makerules
NP-uplnost: korektury.
[ads2.git] / Makerules
index cf70fe3978b1be9cb891a827b707335a1f7f4190..af8215cefabfe8c818cece60b6d017ed7dd85315 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -1,8 +1,12 @@
-export TEXINPUTS=.:..:
+ifndef R
+R=..
+endif
+
+export TEXINPUTS=.:$(R):
 
 all: $P.pdf
 
-%.dvi: %.tex ../lecnotes.tex ../mjmac.tex
+%.dvi: %.tex $(R)/lecnotes.tex $(R)/mjmac.tex
        csplain $<
 
 %.ps: %.dvi
@@ -14,22 +18,37 @@ all: $P.pdf
 %.pdf: %.ps
        ps2pdf13 $< $@
 
-%-booklet.ps: %.ps
-       psbook <$< | pstops '2:0L(210mm,0)+1L(210mm,148mm)' | ../utils/pstopsfix | sed 's/^%%BoundingBox: .*/%%BoundingBox: 0 0 595 842/;s/^%%DocumentPaperSizes:.*/%%DocumentPaperSizes: a4\n%%Orientation: Landscape/' >$@
+%-booklet.pdf: %.pdf
+       pspdftool 'book nup(2, paper=a4)' $< $@
+
+%-2in1.pdf: %.pdf
+       pspdftool 'nup(2, paper=a4)' $< $@
 
-%-2in1.ps: %.ps
-       pstops '2:0L(210mm,0mm)+1L(210mm,148mm)' <$< | ../utils/pstopsfix | sed 's/^%%BoundingBox: .*/%%BoundingBox: 0 0 595 842/;s/^%%DocumentPaperSizes:.*/%%DocumentPaperSizes: a4\n%%Orientation: Landscape/' >$@
+#%-booklet.ps: %.ps
+#      psbook <$< | pstops '2:0L(210mm,0)+1L(210mm,148mm)' | ../utils/pstopsfix | sed 's/^%%BoundingBox: .*/%%BoundingBox: 0 0 595 842/;s/^%%DocumentPaperSizes:.*/%%DocumentPaperSizes: a4\n%%Orientation: Landscape/' >$@
+#
+#%-2in1.ps: %.ps
+#      pstops '2:0L(210mm,0mm)+1L(210mm,148mm)' <$< | ../utils/pstopsfix | sed 's/^%%BoundingBox: .*/%%BoundingBox: 0 0 595 842/;s/^%%DocumentPaperSizes:.*/%%DocumentPaperSizes: a4\n%%Orientation: Landscape/' >$@
+
+%.stamp: force
+       date '+%Y-%m-%d' >$@
+
+force:
 
 mostlyclean:
        rm -f *.dvi *.log *~ core *.o *.aux *.bbl *.blg
 
 clean:: mostlyclean
-       rm -f *.ps *.pdf
+       rm -f *.ps *.pdf *.stamp
 
+UPDIR=vyuka/0910/ads2
 ifndef CUSTOM_UPLOAD
 upload::
-       make $P.pdf
-       scp -C $P.pdf jabberwock:www/vyuka/0910/ads2/$P.pdf
+       make $P.pdf $P.stamp
+       scp -C $P.pdf $P.stamp jabberwock:www/$(UPDIR)/
+       ssh jabberwock 'cd www && make'
 endif
 
 .SECONDARY:
+
+.PHONY: force upload clean mostlyclean