File: Makefile

package info (click to toggle)
cwebx 3.04-7
  • links: PTS
  • area: main
  • in suites: sarge, woody
  • size: 836 kB
  • ctags: 362
  • sloc: ansic: 1,867; pascal: 227; makefile: 147; sh: 6
file content (136 lines) | stat: -rw-r--r-- 3,087 bytes parent folder | download
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# This file is part of CWEB, version x3.0.

# 
# Read the README file, then edit this file to reflect local conditions
#

# The C compiler should be ANSI compatible

CC = gcc

# We let CWEAVE report syntax errors by setting +d.
# The flag +m makes the TeX output slightly more compact.

CWFLAGS = +md
CTFLAGS =

# We keep debugging info around to enable the `+d' option of cweave
CFLAGS = -DDEBUG -DSTAT -O2 -Wall
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g
endif

# Set CCHANGES to common-foo.ch if you need changes to common.w in another
# file than common.ch

CCHANGES=

# Set TCHANGES to ctangle-foo.ch if you need changes to ctangle.w in another
# file than ctangle.ch

TCHANGES=

# Set WCHANGES to cweave-foo.ch if you need changes to cweave.w in another
# file than cweave.ch

WCHANGES=

##########  You shouldn't have to change anything after this point #######

CWEAVE = ./cweave $(CWFLAGS)
CTANGLE = ./ctangle $(CTFLAGS)

.SUFFIXES: .tex .dvi .w

.w.tex:
	$(CWEAVE) $*

.tex.dvi:
	tex $*.tex

.w.c:
	$(CTANGLE) $*

.w.dvi:
	make $*.tex
	make $*.dvi

.w.o:
	make $*.c
	make $*.o

all: cweb doc listings
cweb: ctangle cweave
manual doc: manual.dvi
listings: common.dvi ctangle.dvi cweave.dvi

cautiously: ctangle
	make common.c ctangle.c cweave.c
	mv ctangle SAVEctangle # save version in case things mess up
	make ctangle
	mv common.c SAVEcommon.c
	./ctangle common $(CCHANGES)
	diff common.c SAVEcommon.c
	mv SAVEcommon.c common.c # restore date
	mv ctangle.c SAVEctangle.c
	./ctangle ctangle $(TCHANGES)
	diff ctangle.c SAVEctangle.c
	mv SAVEctangle.c ctangle.c # restore date
	mv cweave.c SAVEcweave.c
	./ctangle cweave $(WCHANGES)
	diff cweave.c SAVEcweave.c
	mv SAVEcweave.c cweave.c # restore date
	rm SAVEctangle # succeeded, use new binary from now on

SAVEctangle.c:
	cp ctangle.c SAVEctangle.c

SAVEcommon.c:
	cp common.c SAVEcommon.c

common.c: common.w $(CCHANGES) common.inc
	$(CTANGLE) common $(CCHANGES)

common.h: common.w $(CCHANGES)
	$(CTANGLE) common $(CCHANGES)

common.tex:  common.w common.inc
	$(CWEAVE) common $(CCHANGES)

ctangle: ctangle.o common.o
	$(CC) $(CFLAGS) -o ctangle ctangle.o common.o 

ctangle.c: ctangle.w $(TCHANGES) common.inc common.h
	$(CTANGLE) ctangle $(TCHANGES)

ctangle.tex:  ctangle.w $(TCHANGES) common.inc intro.inc
	$(CWEAVE) ctangle $(TCHANGES)

cweave: cweave.o common.o
	$(CC) $(CFLAGS) -o cweave cweave.o common.o

cweave.c: cweave.w $(WCHANGES) common.inc common.h parser.w rules.w
	$(CTANGLE) cweave $(WCHANGES)

cweave.tex:  cweave.w $(WCHANGES) parser.w rules.w common.inc intro.inc
	$(CWEAVE) cweave $(WCHANGES)

manual.dvi: compare.tex

# Debian additions: we need a clean and install target of course!!

# Are we going to suffix an `x' on the end of filenames to distinguish
# CWEBx from K&L CWEB?
DESTPREF=x

INSTALLROOT=debian/tmp
BINDIR=$(INSTALLROOT)/usr/bin
MACRODIR=$(INSTALLROOT)/usr/share/texmf/tex/plain/litprog

clean:
	-rm -f *.dvi *.log *.o ctangle cweave cweave.c

install:
	cp cweave $(BINDIR)/cweave$(DESTPREF)
	cp ctangle $(BINDIR)/ctangle$(DESTPREF)
	cp cweb?mac.tex $(MACRODIR)