1 # Makefile for f2c, a Fortran 77 to C converter
4 SRCS
= main.c init.c gram.c
lex.c proc.c equiv.c data.c format.c \
5 expr.c exec.c intr.c io.c misc.c error.c mem.c names.c \
6 output.c p1output.c pread.c put.c putpcc.c vax.c formatdata.c \
7 parse_args.c niceprintf.c cds.c sysdep.c version.c
$(MALLOC
)
12 # To use the malloc whose source accompanies the f2c source,
13 # add malloc.c to the right-hand side of the "MALLOC =" line,
16 # This gives faster execution on some systems, but some other
17 # systems do not tolerate replacement of the system's malloc.
20 # In case yacc is broken, a correctly functioning gram.c is distributed
21 # (derived with a Unix variant of the yacc from plan9).
23 # There should be 4 shift/reduce conflicts:
25 gram.y
: gram.head gram.dcl gram.expr gram.exec gram.io tokdefs.h
26 ( sed
"s/#define/%token/" < $(.ALLSRC
:M
*tokdefs.h
) ; \
27 cat
$(.ALLSRC
:M
*gram.head
) \
28 $(.ALLSRC
:M
*gram.dcl
) \
29 $(.ALLSRC
:M
*gram.expr
) \
30 $(.ALLSRC
:M
*gram.exec
) \
31 $(.ALLSRC
:M
*gram.io
) ) > $@
37 DPADD
= defs.h ftypes.h defines.h machdefs.h sysdep.h
39 CPPFLAGS
= -I.
# generated files
40 CPPFLAGS
+= -I
$(F2CSRCDIR
) # grammar
43 # grep -n . <tokens | sed "s/\([^:]*\):\(.*\)/#define \2 \1/" >tokdefs.h
47 # Handle obsolete systems like Solaris:
49 if
$(CC
) sysdeptest.c
; then echo
'/*OK*/' > sysdep.hd
; \
50 elif
$(CC
) -DNO_MKDTEMP sysdeptest.c
; then echo
'#define NO_MKDTEMP' > sysdep.hd
; \
51 else { echo
'#define NO_MKDTEMP'; echo
'#define NO_MKSTEMP'; } > sysdep.hd
; fi
54 CLEANFILES
+= sysdep.hd
# sysdep.hd tokdefs.h f2c.t
58 sed
-e
's!/usr!${PREFIX}!g' -e
's!lib/libc.a!usr/lib/libc.a!g' $> > $@
62 .
include "bsd.prog.mk"