home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / f2c-93.04.28-src.tgz / tar.out / fsf / f2c / src / makefile < prev    next >
Makefile  |  1996-09-28  |  3KB  |  96 lines

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