| 1 | # Makefile for the Fortran 77 command |
| 2 | # Running on the VAX |
| 3 | # Generating code for the VAX |
| 4 | # Using the Johnson C compiler's second pass (binary version) |
| 5 | COMPFLGS = -O -DTARGET=VAX -DFAMILY=SCJ -DHERE=VAX -DOUTPUT=BINARY -DPOLISH=POSTFIX |
| 6 | FILES = Makefile defs defines locdefs drivedefs ftypes scjdefs tokens fio.h\ |
| 7 | driver.c \ |
| 8 | main.c proc.c init.c\ |
| 9 | gram.head gram.dcl gram.expr gram.exec gram.io\ |
| 10 | lex.c equiv.c data.c expr.c exec.c intr.c\ |
| 11 | io.c misc.c error.c put.c putscjb.c vax.c vaxx.c |
| 12 | |
| 13 | |
| 14 | OBJECTS = main.o init.o proc.o gram.o lex.o \ |
| 15 | equiv.o data.o expr.o exec.o intr.o io.o misc.o error.o\ |
| 16 | put.o putscjb.o vax.o vaxx.o |
| 17 | |
| 18 | compiler: f77 f77pass1 |
| 19 | |
| 20 | f77 : driver.o vaxx.o |
| 21 | cc -n driver.o vaxx.o -o f77 |
| 22 | @size f77 |
| 23 | |
| 24 | f77pass1 : $(OBJECTS) |
| 25 | @echo LOAD |
| 26 | @$(CC) $(LDFLAGS) $(OBJECTS) -o f77pass1 |
| 27 | @size f77pass1 |
| 28 | |
| 29 | gram.c: gram.head gram.dcl gram.expr gram.exec gram.io tokdefs |
| 30 | ( sed <tokdefs "s/#define/%token/" ;\ |
| 31 | cat gram.head gram.dcl gram.expr gram.exec gram.io ) >gram.in |
| 32 | $(YACC) $(YFLAGS) gram.in |
| 33 | mv y.tab.c gram.c |
| 34 | rm gram.in |
| 35 | |
| 36 | tokdefs: tokens |
| 37 | grep -n . <tokens | sed "s/\([^:]*\):\(.*\)/#define \2 \1/" >tokdefs |
| 38 | |
| 39 | lex.o : tokdefs |
| 40 | driver.o $(OBJECTS) : defs defines locdefs ftypes |
| 41 | driver.o : drivedefs |
| 42 | |
| 43 | locdefs : vaxdefs |
| 44 | cp vaxdefs locdefs |
| 45 | |
| 46 | put.o putscjb.o : scjdefs |
| 47 | io.o : fio.h |
| 48 | scjdefs : nmanifest ; |
| 49 | |
| 50 | nmanifest :# /usr/tbl/scj/manifest |
| 51 | # @echo "***Warning: /usr/tbl/scj/manifest has changed***" |
| 52 | |
| 53 | fio.h :# /usr/sif/fort/libI77/fio.h |
| 54 | # @echo "***Warning : /usr/sif/fort/libI77/fio.h has changed***" |
| 55 | |
| 56 | archall: |
| 57 | ar rc ../fortarch $(FILES) |
| 58 | |
| 59 | arch : ../fortarch |
| 60 | |
| 61 | ../fortarch: $(FILES) |
| 62 | @ar uv ../fortarch $? |
| 63 | @wc ../fortarch |
| 64 | |
| 65 | |
| 66 | printall: |
| 67 | pr $(FILES) | $P |
| 68 | touch print |
| 69 | |
| 70 | print: $(FILES) |
| 71 | pr $? | $P |
| 72 | touch print |
| 73 | |
| 74 | lint: |
| 75 | @echo "nohup lint -p ... >Lintout&" |
| 76 | @nohup lint -p error.c exec.c intr.c expr.c gram.c init.c io.c\ |
| 77 | lex.c main.c proc.c misc.c put.c putscjb.c vax.c vaxx.c\ |
| 78 | equiv.c data.c -lS >Lintout& |
| 79 | |
| 80 | clean: |
| 81 | -rm -f gram.c *.o f77 f77pass1 |
| 82 | du |
| 83 | |
| 84 | install: |
| 85 | install -s f77 $(DESTDIR)/usr/bin |
| 86 | install -s f77pass1 $(DESTDIR)/usr/lib |
| 87 | |
| 88 | src : $(FILES) vaxdefs |
| 89 | cp $? /usr/src/cmd/f77 |
| 90 | touch src |
| 91 | .c.o : |
| 92 | cc -c $(CFLAGS) $(COMPFLGS) $*.c |