| 1 |
# Makefile for the LaTeX2e package `draftcopy' |
| 2 |
# Copyright (C)1995 Dr. Juergen Vollmer, all rights reserved. |
| 3 |
# Dr. Juergen Vollmer, Viktoriastrasse 15, D-76133 Karlsruhe, Germany |
| 4 |
# [email protected] |
| 5 |
# $Id: Makefile,v 2.60 2002/02/25 09:13:32 vollmer Exp $ |
| 6 |
|
| 7 |
BASE = draftcopy |
| 8 |
VERSION = 2.16 |
| 9 |
V_DATE = February 25, 2002 |
| 10 |
VV_DATE = 2002/02/25 |
| 11 |
|
| 12 |
DVIPS = dvips |
| 13 |
GZIP = gzip |
| 14 |
LATEX = latex |
| 15 |
MAKEINDEX = makeindex |
| 16 |
PDFLATEX = pdflatex |
| 17 |
|
| 18 |
# a postscript viewer: |
| 19 |
GV = ghostscript |
| 20 |
GV = gv |
| 21 |
|
| 22 |
#-------- user configuration section |
| 23 |
TEX_DIR = /usr/lib/teTeX/texmf |
| 24 |
STY_DIR = $(TEX_DIR)/tex/latex/misc |
| 25 |
CFG_DIR = $(TEX_DIR)/tex/latex/config |
| 26 |
DOC_DIR = $(TEX_DIR)/doc/latex/draftcopy |
| 27 |
SRC_DIR = $(TEX_DIR)/source/latex/draftcopy |
| 28 |
#-------- end of user configuration section |
| 29 |
|
| 30 |
DATE = `date +%Y-%m-%d` |
| 31 |
DATE2 = `date +%Y/%m/%d` |
| 32 |
TAR_BAK = $(BASE)-$(DATE)-backup.tar.gz |
| 33 |
TAR_SRC = $(BASE)-$(DATE)-source.tar.gz |
| 34 |
TAR_DIST = $(BASE)-$(VERSION).tar.gz |
| 35 |
EX = --exclude "*.o" --exclude core --exclude "*.tar.gz" --exclude "*~" \ |
| 36 |
--exclude "*.a" |
| 37 |
EXrcs = $(EX) --exclude "*/RCS/*" --exclude "*/RCS" |
| 38 |
|
| 39 |
.PHONY: all clean realclean diff backup src-tar |
| 40 |
|
| 41 |
all: draftcopy.dtx $(BASE).ps $(BASE).pdf test clean |
| 42 |
|
| 43 |
draftcopy.dtx: draftcopy.doc draftcopy.ins |
| 44 |
$(LATEX) draftcopy.ins |
| 45 |
|
| 46 |
%.dvi: %.dtx |
| 47 |
$(LATEX) $*.dtx |
| 48 |
makeindex -s gind.ist -o $*.ind $*.idx |
| 49 |
makeindex -s gglo.ist -o $*.gls $*.glo |
| 50 |
rm -f rcsinfo.ins rcsinfo.perl |
| 51 |
$(LATEX) $*.dtx |
| 52 |
|
| 53 |
%.dvi: %.tex |
| 54 |
rm -f *.toc *.aux |
| 55 |
$(LATEX) $*.tex |
| 56 |
$(LATEX) $*.tex |
| 57 |
|
| 58 |
%.ps: %.dvi |
| 59 |
$(DVIPS) -o $*.ps $*.dvi |
| 60 |
|
| 61 |
%.pdf: %.dtx |
| 62 |
rm -f *.toc *.aux |
| 63 |
$(PDFLATEX) $*.dtx |
| 64 |
$(PDFLATEX) $*.dtx |
| 65 |
|
| 66 |
test: test-portrait test-landscape |
| 67 |
|
| 68 |
test-portrait: |
| 69 |
for i in 1 2 3 4 5 6 7 8 9 10 13 14 15 16; do \ |
| 70 |
f=$(BASE)-test-$$i; \ |
| 71 |
echo file: $$f; \ |
| 72 |
$(LATEX) $$f ; \ |
| 73 |
$(DVIPS) -o $$f.ps $$f.dvi; \ |
| 74 |
$(GV) $$f.ps ; \ |
| 75 |
done |
| 76 |
|
| 77 |
test-landscape: |
| 78 |
for i in 11 12; do \ |
| 79 |
f=$(BASE)-test-$$i; \ |
| 80 |
echo file: $$f; \ |
| 81 |
$(LATEX) $$f ; \ |
| 82 |
$(DVIPS) -t landscape -o $$f.ps $$f.dvi; \ |
| 83 |
$(GV) -seascape $$f.ps ; \ |
| 84 |
done |
| 85 |
|
| 86 |
install: draftcopy.dtx draftcopy.dvi draftcopy.ps |
| 87 |
[ -d $(TEX_DIR) ] || mkdir $(TEX_DIR) |
| 88 |
[ -d $(DOC_DIR) ] || mkdir $(DOC_DIR) |
| 89 |
[ -d $(SRC_DIR) ] || mkdir $(SRC_DIR) |
| 90 |
[ -d $(CFG_DIR) ] || mkdir $(CFG_DIR) |
| 91 |
[ -d $(STY_DIR) ] || mkdir $(STY_DIR) |
| 92 |
cp draftcopy.sty $(STY_DIR) |
| 93 |
cp draftcopy.cfg $(CFG_DIR) |
| 94 |
cp draftcopy.dtx $(DOC_DIR) |
| 95 |
cp draftcopy.dvi $(DOC_DIR) |
| 96 |
cp draftcopy.ps $(DOC_DIR) |
| 97 |
cp draftcopy-test-*.tex $(DOC_DIR) |
| 98 |
cp draftcopy.doc $(SRC_DIR) |
| 99 |
cp draftcopy.ins $(SRC_DIR) |
| 100 |
cp README $(SRC_DIR) |
| 101 |
cp THIS-IS-VERSION-$(VERSION) $(SRC_DIR) |
| 102 |
|
| 103 |
uninstall: |
| 104 |
rm -f $(STY_DIR)/draftcopy.sty |
| 105 |
rm -f $(CFG_DIR)/draftcopy.cfg |
| 106 |
rm -fr $(DOC_DIR) |
| 107 |
rm -fr $(SRC_DIR) |
| 108 |
|
| 109 |
clean: |
| 110 |
-rm -f *.dtx *.log *.aux *.lof *.lot *.toc |
| 111 |
-rm -f *.idx *.ind *.glo *.gls *~ *.ilg *.out |
| 112 |
|
| 113 |
realclean: clean |
| 114 |
-rm -f *.sty *.cls *.ps *.dvi *.cfg *.pdf |
| 115 |
-rm -f *test* |
| 116 |
|
| 117 |
src-tar: |
| 118 |
$(MAKE) realclean |
| 119 |
@cd ..; tar $(EXrcs) -czvf $(BASE)/$(TAR_SRC) $(BASE) |
| 120 |
|
| 121 |
dist: |
| 122 |
rm -f THIS-IS-VERSION-* |
| 123 |
co -l draftcopy.doc draftcopy.ins README Makefile |
| 124 |
@rm -f .xxx; cp draftcopy.doc .xxx |
| 125 |
@sed < .xxx -e 's/\(^% \\date{\).*}/\1$(V_DATE); Version $(VERSION)}/' \ |
| 126 |
-e 's|\(^ *\\ProvidesPackage{draftcopy}\)\[.*\]|\1[$(VV_DATE) v$(VERSION)]|' \ |
| 127 |
> draftcopy.doc |
| 128 |
@rm -f .xxx; cp draftcopy.ins .xxx |
| 129 |
@sed < .xxx -e 's/\(Version:\) *[0-9]*\.[0-9]*.*}/\1 $(VERSION); $(V_DATE)}/' \ |
| 130 |
> draftcopy.ins |
| 131 |
@rm -f .xxx; cp README .xxx |
| 132 |
@sed < .xxx -e 's/\(Version:\) *[0-9]*\.[0-9]*.*$$/\1 $(VERSION); $(V_DATE)/' \ |
| 133 |
> README |
| 134 |
V=`echo $(VERSION)-$(VV_DATE) | sed -e 's|\.|-|g' -e's|/|-|g'`; \ |
| 135 |
ci -u -N"VERSION-$$V" -m"Distribution" \ |
| 136 |
draftcopy.ins draftcopy.doc Makefile README |
| 137 |
- $(MAKE) realclean all |
| 138 |
@echo "VERSION $(VERSION) DATE=$(V_DATE)" > THIS-IS-VERSION-$(VERSION) |
| 139 |
@cd ..; tar $(EXrcs) -czvf $(BASE)/$(TAR_DIST) \ |
| 140 |
$(BASE)/draftcopy.ins \ |
| 141 |
$(BASE)/draftcopy.doc \ |
| 142 |
$(BASE)/Makefile \ |
| 143 |
$(BASE)/README \ |
| 144 |
$(BASE)/THIS-IS-VERSION-$(VERSION) |