summaryrefslogtreecommitdiff
path: root/web/tweb/makefile
blob: 5f0fbf9022c455bdecd47565ffa3fa6425df4bc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#--------------------------------------------------------
#  $Id: Makefile,v 1.9 1995/07/12 22:25:36 web Exp web $	
#  
#  Unix Makefile for TWEB
#
#--------------------------------------------------------
# !!! put first tweb.sty in the tex search path

#  place for web2awk and other scripts
SCRIPTDIR = BIN

#  place for index styles
INDEXDIR = IDXSTY

#  name of makeindex program
MAKEINDEX = makeindex

#========================================================

.SUFFIXES: .dvi .tex .sty .tw

.tex.dvi:
	tex $*.tex
	$(MAKEINDEX) -s $(INDEXDIR)/dnd.ist -o $*.dnd $*.ddx
	$(MAKEINDEX) -s $(INDEXDIR)/und.ist -o $*.und $*.udx
	$(MAKEINDEX) -s $(INDEXDIR)/chn.ist -o $*.chn $*.chk
	tex $*.tex
	touch $*.tex

.tw.tex:
	$(SCRIPTDIR)/web2tex $*.tw > $*.tex

.tw.sty:
	markup $*.tw | nt > $*.sty

.tw.dvi:
	make $*.tex
	make $*.dvi

#----------------------------------------------------

.PHONY: help clean veryclean archive unprimitivize

help:
	@ echo
	@ echo Usage:                           for only one TWEB file
	@ echo =======================================================
	@ echo "       Weaving:  make `basename *.tw .tw`.tex" 
	@ echo "      Tangling:  make `basename *.tw .tw`.sty" 
	@ echo "        Texing:  make `basename *.tw .tw`.dvi"
	@ echo "Making archive:  make archive"
	@ echo "      Cleaning:  make clean (or veryclean)"
	@ echo =======================================================
	@ echo

clean:
	- rm -f *.log *.tex\
	        *.ilg *.chk *.chn *.ddx *.dnd *.udx *.und *.DDX *.UDX\
	        *.toc *.ref

veryclean:
	- rm -f *.dvi *.log *.tex\
	        *.ilg *.chk *.chn *.ddx *.dnd *.udx *.und *.DDX *.UDX\
	        *.toc *.ref

archive: 
	- cd .. ; rm $(notdir $(shell pwd)).zip
	cd .. ; zip -r $(notdir $(shell pwd)) $(notdir $(shell pwd))/*

unprimitivize:  
	@ echo 
	@ echo Be patient... 
	@ echo 
	- $(foreach var, $(basename $(wildcard *.tw)),\
               $(SCRIPTDIR)/unprimitivize $(var).ddx > $(var).DDX;\
               mv $(var).DDX $(var).ddx;)
	- $(foreach var, $(basename $(wildcard *.tw)),\
               $(SCRIPTDIR)/unprimitivize $(var).udx > $(var).UDX;\
               mv $(var).UDX $(var).udx;)
	- $(foreach var, $(basename $(wildcard *.tw)),\
               $(MAKEINDEX) -s $(INDEXDIR)/dnd.ist -o $(var).dnd $(var).ddx;\
               $(MAKEINDEX) -s $(INDEXDIR)/und.ist -o $(var).und $(var).udx;\
               tex $(var).tex)