-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
72 lines (44 loc) · 1.15 KB
/
Makefile
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
# Makefile for picoProlog on linux
all: pprolog
# The interpreter itself
pprolog: pprolog.c ptclib.i
$(CC) $(CFLAGS) -o $@ $<
pprolog.c: pprolog.p ptc
./ptc $< >$@
pprolog.p: pprolog.x ppp
(echo "define(ptc)"; cat pprolog.x) | ./ppp >pprolog.p
# A version written in Oberon and compiled with Mike's Oberon compiler
obprolog: obProlog.m
obc -x $< -o $@
obProlog.m: obProlog.x ppp
./ppp <$< | sed -e 's/{/(*/g' -e 's/}/*)/g' >$@
# Pascal preprocessor 'ppp'
ppp: ppp.c ptclib.i
$(CC) $(CFLAGS) -o $@ $<
ppp.c: ppp.p ptc
./ptc $< >$@
# Alternate build using Free Pascal
FPC = fpc
fp-pprolog: fp-pprolog.p
$(FPC) -o$@ $^
fp-pprolog.p: pprolog.x fp-ppp
(echo "define(fpc)"; cat pprolog.x) | ./fp-ppp >fp-pprolog.p
fp-ppp: ppp.p
$(FPC) -o$@ $^
# Pascal to C translator
PTC = parse.o scan.o
ptc: $(PTC)
$(CC) $(CFLAGS) -o ptc $(PTC)
$(PTC): ptc.h parse.h
parse.c parse.h: parse.y
bison -d -o parse.c parse.y
scan.c: scan.l
flex -t scan.l >scan.c
# Cleanup
clean: force
rm -f ptc ppp pprolog *.o ppp.c pprolog.c pprolog.p \
parse.c parse.h scan.c fp-ppp fp-pprolog fp-pprolog.p \
obProlog.m obProlog.k obprolog
force:
CC = gcc
CFLAGS = -g -O2