Pristine Ack-5.5
[Ack-5.5.git] / lang / fortran / comp / makefile
1 #       Makefile for f2c, a Fortran 77 to C converter
2
3 g = -g
4 CFLAGS = $g
5 SHELL = /bin/sh
6
7 OBJECTSd = 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
11 OBJECTS = $(OBJECTSd) malloc.o
12
13 all: xsum.out f2c
14
15 f2c: $(OBJECTS)
16         $(CC) $(LDFLAGS) $(OBJECTS) -o f2c
17         size f2c
18
19 gram.c: gram.head gram.dcl gram.expr gram.exec gram.io defs.h tokdefs.h
20         ( sed <tokdefs.h "s/#define/%token/" ;\
21                 cat gram.head gram.dcl gram.expr gram.exec gram.io ) >gram.in
22         $(YACC) $(YFLAGS) gram.in
23         echo "(expect 4 shift/reduce)"
24         sed 's/^# line.*/\/* & *\//' y.tab.c >gram.c
25         rm -f gram.in y.tab.c
26
27 $(OBJECTSd): defs.h ftypes.h defines.h machdefs.h sysdep.h
28
29 tokdefs.h: tokens
30         grep -n . <tokens | sed "s/\([^:]*\):\(.*\)/#define \2 \1/" >tokdefs.h
31
32 cds.o: sysdep.h
33 exec.o: p1defs.h names.h
34 expr.o: output.h niceprintf.h names.h
35 format.o: p1defs.h format.h output.h niceprintf.h names.h iob.h
36 formatdata.o: format.h output.h niceprintf.h names.h
37 gram.o: p1defs.h
38 init.o: output.h niceprintf.h iob.h
39 intr.o: names.h
40 io.o: names.h iob.h
41 lex.o : tokdefs.h p1defs.h
42 main.o: parse.h usignal.h
43 mem.o: iob.h
44 names.o: iob.h names.h output.h niceprintf.h
45 niceprintf.o: defs.h names.h output.h niceprintf.h
46 output.o: output.h niceprintf.h names.h
47 p1output.o: p1defs.h output.h niceprintf.h names.h
48 parse_args.o: parse.h
49 proc.o: tokdefs.h names.h niceprintf.h output.h p1defs.h
50 put.o: names.h pccdefs.h p1defs.h
51 putpcc.o: names.h
52 vax.o: defs.h output.h pccdefs.h
53 output.h: niceprintf.h
54
55 put.o putpcc.o: pccdefs.h
56
57 f2c.t: f2c.1t
58         troff -man f2c.1t >f2c.t
59
60 f2c.1: f2c.1t
61         nroff -man f2c.1t | col -b | uniq >f2c.1
62
63 clean:
64         rm -f gram.c *.o f2c tokdefs.h f2c.t
65
66 b = Notice README cds.c data.c defines.h defs.h equiv.c error.c \
67         exec.c expr.c f2c.1 f2c.1t f2c.h format.c format.h formatdata.c \
68         ftypes.h gram.dcl gram.exec gram.expr gram.head gram.io \
69         init.c intr.c io.c iob.h lex.c machdefs.h main.c makefile \
70         malloc.c mem.c memset.c misc.c names.c names.h niceprintf.c \
71         niceprintf.h output.c output.h p1defs.h p1output.c \
72         parse.h parse_args.c pccdefs.h pread.c proc.c put.c putpcc.c \
73         sysdep.c sysdep.h tokens usignal.h vax.c version.c xsum.c
74
75 bundle:
76         bundle $b xsum0.out >/tmp/f2c.bundle
77
78 xsum: xsum.c
79         $(CC) -o xsum xsum.c
80
81 #Check validity of transmitted source...
82 xsum.out: xsum
83         ./xsum $b >xsum1.out
84         cmp xsum0.out xsum1.out && mv xsum1.out xsum.out