Sprinkled with ${.CURDIR} to get the builds of gram.c and tokdefs.h
[unix-history] / usr.bin / f2c / makefile
CommitLineData
f1525c23
WH
1# Makefile for f2c, a Fortran 77 to C converter
2
3g = -g
4CFLAGS = $g
5SHELL = /bin/sh
6
7OBJECTSd = main.o init.o gram.o lex.o proc.o equiv.o data.o format.o \
8 expr.o exec.o intr.o io.o misc.o error.o mem.o names.o \
9 output.o p1output.o pread.o put.o putpcc.o vax.o formatdata.o \
10 parse_args.o niceprintf.o cds.o sysdep.o version.o
11OBJECTS = $(OBJECTSd) malloc.o
12
13all: xsum.out f2c
14
15f2c: $(OBJECTS)
16 $(CC) $(LDFLAGS) $(OBJECTS) -o f2c
17
18gram.c: gram.head gram.dcl gram.expr gram.exec gram.io defs.h tokdefs.h
19 ( sed <tokdefs.h "s/#define/%token/" ;\
20 cat gram.head gram.dcl gram.expr gram.exec gram.io ) >gram.in
21 $(YACC) $(YFLAGS) gram.in
22 echo "(expect 4 shift/reduce)"
23 sed 's/^# line.*/\/* & *\//' y.tab.c >gram.c
24 rm -f gram.in y.tab.c
25
26$(OBJECTSd): defs.h ftypes.h defines.h machdefs.h sysdep.h
27
28tokdefs.h: tokens
29 grep -n . <tokens | sed "s/\([^:]*\):\(.*\)/#define \2 \1/" >tokdefs.h
30
31cds.o: sysdep.h
32exec.o: p1defs.h names.h
33expr.o: output.h niceprintf.h names.h
34format.o: p1defs.h format.h output.h niceprintf.h names.h iob.h
35formatdata.o: format.h output.h niceprintf.h names.h
36gram.o: p1defs.h
37init.o: output.h niceprintf.h iob.h
38intr.o: names.h
39io.o: names.h iob.h
40lex.o : tokdefs.h p1defs.h
41main.o: parse.h usignal.h
42mem.o: iob.h
43names.o: iob.h names.h output.h niceprintf.h
44niceprintf.o: defs.h names.h output.h niceprintf.h
45output.o: output.h niceprintf.h names.h
46p1output.o: p1defs.h output.h niceprintf.h names.h
47parse_args.o: parse.h
48proc.o: tokdefs.h names.h niceprintf.h output.h p1defs.h
49put.o: names.h pccdefs.h p1defs.h
50putpcc.o: names.h
51vax.o: defs.h output.h pccdefs.h
52output.h: niceprintf.h
53
54put.o putpcc.o: pccdefs.h
55
56f2c.t: f2c.1t
57 troff -man f2c.1t >f2c.t
58
59f2c.1: f2c.1t
60 nroff -man f2c.1t | col -b | uniq >f2c.1
61
62clean:
63 rm -f gram.c *.o f2c tokdefs.h f2c.t
64
65b = Notice README cds.c data.c defines.h defs.h equiv.c error.c \
66 exec.c expr.c f2c.1 f2c.1t f2c.h format.c format.h formatdata.c \
67 ftypes.h gram.dcl gram.exec gram.expr gram.head gram.io \
68 init.c intr.c io.c iob.h lex.c machdefs.h main.c makefile \
69 malloc.c mem.c memset.c misc.c names.c names.h niceprintf.c \
70 niceprintf.h output.c output.h p1defs.h p1output.c \
71 parse.h parse_args.c pccdefs.h pread.c proc.c put.c putpcc.c \
72 sysdep.c sysdep.h tokens usignal.h vax.c version.c xsum.c
73
74bundle:
75 bundle $b xsum0.out >/tmp/f2c.bundle
76
77xsum: xsum.c
78 $(CC) -o xsum xsum.c
79
80#Check validity of transmitted source...
81xsum.out: xsum
82 ./xsum $b >xsum1.out
83 cmp xsum0.out xsum1.out && mv xsum1.out xsum.out
84
85#On non-Unix systems that end lines with carriage-return/newline pairs,
86#use "make xsumr.out" rather than "make xsum.out". The -r flag ignores
87#carriage-return characters.
88xsumr.out: xsum
89 ./xsum -r $b >xsum1.out
90 cmp xsum0.out xsum1.out && mv xsum1.out xsumr.out