| 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 | |
| 18 | gram.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 | |
| 28 | tokdefs.h: tokens |
| 29 | grep -n . <tokens | sed "s/\([^:]*\):\(.*\)/#define \2 \1/" >tokdefs.h |
| 30 | |
| 31 | cds.o: sysdep.h |
| 32 | exec.o: p1defs.h names.h |
| 33 | expr.o: output.h niceprintf.h names.h |
| 34 | format.o: p1defs.h format.h output.h niceprintf.h names.h iob.h |
| 35 | formatdata.o: format.h output.h niceprintf.h names.h |
| 36 | gram.o: p1defs.h |
| 37 | init.o: output.h niceprintf.h iob.h |
| 38 | intr.o: names.h |
| 39 | io.o: names.h iob.h |
| 40 | lex.o : tokdefs.h p1defs.h |
| 41 | main.o: parse.h usignal.h |
| 42 | mem.o: iob.h |
| 43 | names.o: iob.h names.h output.h niceprintf.h |
| 44 | niceprintf.o: defs.h names.h output.h niceprintf.h |
| 45 | output.o: output.h niceprintf.h names.h |
| 46 | p1output.o: p1defs.h output.h niceprintf.h names.h |
| 47 | parse_args.o: parse.h |
| 48 | proc.o: tokdefs.h names.h niceprintf.h output.h p1defs.h |
| 49 | put.o: names.h pccdefs.h p1defs.h |
| 50 | putpcc.o: names.h |
| 51 | vax.o: defs.h output.h pccdefs.h |
| 52 | output.h: niceprintf.h |
| 53 | |
| 54 | put.o putpcc.o: pccdefs.h |
| 55 | |
| 56 | f2c.t: f2c.1t |
| 57 | troff -man f2c.1t >f2c.t |
| 58 | |
| 59 | f2c.1: f2c.1t |
| 60 | nroff -man f2c.1t | col -b | uniq >f2c.1 |
| 61 | |
| 62 | clean: |
| 63 | rm -f gram.c *.o f2c tokdefs.h f2c.t |
| 64 | |
| 65 | b = 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 | |
| 74 | bundle: |
| 75 | bundle $b xsum0.out >/tmp/f2c.bundle |
| 76 | |
| 77 | xsum: xsum.c |
| 78 | $(CC) -o xsum xsum.c |
| 79 | |
| 80 | #Check validity of transmitted source... |
| 81 | xsum.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. |
| 88 | xsumr.out: xsum |
| 89 | ./xsum -r $b >xsum1.out |
| 90 | cmp xsum0.out xsum1.out && mv xsum1.out xsumr.out |