~pbatch/patchwerk

patchwerk/Makefile -rw-r--r-- 835 bytes
9c265356 — paul plan9 additions from Sigrid 3 months ago
                                                                                
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
.PHONY: pdf C

NAME=patchwerk
CTANGLE=ctangle -b -h -p
CWEAVE=cweave -b -h -p
CFLAGS=-ansi -pedantic -Wall -O3 -g

WEB=\
	header.w\
	cable.w\
	patchwerk.w\
	node.w\
	patch.w\
	error.w\
	pointer.w\
	egraph.w\
	subpatch.w\
	pool.w\
	stack.w\
	memory.w\
	dump.w \
	print.w \

default: lib$(NAME).a

$(NAME).c: $(NAME).w $(WEB)
	$(CTANGLE) $<

$(NAME).tex: $(NAME).w $(WEB)
	$(CWEAVE) $<

$(NAME).o: $(NAME).c
	$(CC) $(CFLAGS) -c $< -o $@


lib$(NAME).a: $(NAME).o
	$(AR) rcs $@ $(NAME).o

C: patchwerk.c

pdf: $(NAME).pdf

$(NAME).pdf: $(NAME).tex macros.tex
	tex "\let\pdf+ \input $(NAME)"
	dvipdfm -q $(NAME).dvi

clean:
	rm -rf $(NAME).c
	rm -rf lib$(NAME).a
	rm -rf $(NAME).o
	rm -rf $(NAME).tex
	rm -rf $(NAME).idx
	rm -rf $(NAME).scn
	rm -rf $(NAME).h
	rm -rf $(NAME).dvi
	rm -rf $(NAME).log
	rm -rf $(NAME).toc
	rm -rf $(NAME).pdf