Commit | Line | Data |
---|---|---|
eb5ad1d2 F |
1 | # Makefile for the Fortran 77 compiler |
2 | # running on the PDP11, | |
3 | # generating code for the PDP11, | |
4 | # using the Ritchie pass 2 | |
5 | ||
6 | all: f77 f77pass1 | |
7 | ||
8 | cp: all | |
9 | cp f77 /bin | |
10 | cp f77pass1 /lib | |
11 | rm *.o gram.c f77 f77pass1 | |
12 | ||
13 | cmp: all | |
14 | cmp f77 /bin/f77 | |
15 | cmp f77pass1 /lib/f77pass1 | |
16 | rm *.o gram.c f77 f77pass1 | |
17 | ||
18 | CFL = -DTARGET=PDP11 -DFAMILY=DMR -DHERE=PDP11 -DOUTPUT=BINARY -DPOLISH=POSTFIX | |
19 | CFLAGS = -O -s $(CFL) | |
20 | LDFLAGS = -i -s | |
21 | ||
22 | OBJECTS = main.o init.o gram.o lex.o proc.o \ | |
23 | equiv.o data.o expr.o exec.o intr.o io.o misc.o error.o\ | |
24 | put.o putdmr.o pdp11.o pdp11x.o | |
25 | ||
26 | compiler :: f77 f77pass1 | |
27 | touch compiler | |
28 | ||
29 | compiler :: /lib/c1 | |
30 | @echo "***Warning: /lib/c1 has changed" | |
31 | ||
32 | f77 : driver.o pdp11x.o | |
33 | cc -n -s driver.o pdp11x.o -o f77 | |
34 | @size f77 | |
35 | f77pass1 : $(OBJECTS) | |
36 | @echo LOAD | |
37 | @$(CC) $(LDFLAGS) $(OBJECTS) -o f77pass1 | |
38 | @size f77pass1 | |
39 | ||
40 | gram.c: gram.head gram.dcl gram.expr gram.exec gram.io tokdefs | |
41 | ( sed <tokdefs "s/#define/%token/" ;\ | |
42 | cat gram.head gram.dcl gram.expr gram.exec gram.io ) >gram.in | |
43 | $(YACC) $(YFLAGS) gram.in | |
44 | mv y.tab.c gram.c | |
45 | rm gram.in | |
46 | ||
47 | tokdefs: tokens | |
48 | grep -n . <tokens | sed "s/\([^:]*\):\(.*\)/#define \2 \1/" >tokdefs | |
49 | ||
50 | lex.o : tokdefs | |
51 | driver.o $(OBJECTS) : defs defines locdefs ftypes | |
52 | driver.o : drivedefs | |
53 | ||
54 | locdefs : pdp11defs | |
55 | cp pdp11defs locdefs | |
56 | ||
57 | put.o putdmr.o pdp11.o : dmrdefs | |
58 | io.o : fio.h | |
59 | ||
60 | lint: | |
61 | @echo "LINT DRIVER" >Lintout | |
62 | @lint -p $(CFL) driver.c pdp11x.c >>Lintout | |
63 | echo "LINT PASS1" >>Lintout | |
64 | @nohup lint -p $(CFL) error.c exec.c intr.c expr.c gram.c init.c io.c\ | |
65 | lex.c main.c proc.c misc.c put.c putdmr.c pdp11.c pdp11x.c\ | |
66 | equiv.c data.c >>Lintout& | |
67 | ||
68 | cleanup: | |
69 | -rm f gram.c *.o | |
70 | du | |
71 | ||
72 | install: /usr/bin/f77 /usr/lib/f77pass1 | |
73 | ||
74 | /usr/bin/f77 : f77 | |
75 | strip f77 | |
76 | @size f77 /usr/bin/f77 | |
77 | cp f77 /usr/bin/f77 | |
78 | ||
79 | /usr/lib/f77pass1 : f77pass1 | |
80 | strip f77pass1 | |
81 | @size f77pass1 /usr/lib/f77pass1 | |
82 | -chmod u-t /usr/lib/f77pass1 | |
83 | @/usr/lib/f77pass1 2>/dev/null | |
84 | cp f77pass1 /usr/lib/f77pass1 | |
85 | echo "***Now do a chmod u+t /usr/lib/f77pass1 in su mode" |