From 3ebc2913631c7b53207cac9503f0a0141f628900 Mon Sep 17 00:00:00 2001 From: jmz Date: Thu, 28 Sep 1995 20:43:33 +0000 Subject: Makefile: use CFLAGS+= instead of CFLAGS=. Don't use the f2c's malloc. main.c: reinstitute the -o option to rename C output file. --- usr.bin/f2c/Makefile | 5 ++--- usr.bin/f2c/main.c | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'usr.bin/f2c') diff --git a/usr.bin/f2c/Makefile b/usr.bin/f2c/Makefile index 0f6df6e..1a699d2 100644 --- a/usr.bin/f2c/Makefile +++ b/usr.bin/f2c/Makefile @@ -2,15 +2,14 @@ PROG= f2c -g = -O -CFLAGS = $g -DANSI_Libraries -I${.CURDIR} -I. +CFLAGS += -DANSI_Libraries -I${.CURDIR} -I. SHELL = /bin/sh SRCSd = main.c init.c gram.c lex.c proc.c equiv.c data.c format.c \ expr.c exec.c intr.c io.c misc.c error.c mem.c names.c \ output.c p1output.c pread.c put.c putpcc.c vax.c formatdata.c \ parse_args.c niceprintf.c cds.c sysdep.c version.c -SRCS = $(SRCSd) malloc.c +SRCS = $(SRCSd) # malloc.c GRAMFILES = ${.CURDIR}/gram.head ${.CURDIR}/gram.dcl ${.CURDIR}/gram.expr\ ${.CURDIR}/gram.exec ${.CURDIR}/gram.io diff --git a/usr.bin/f2c/main.c b/usr.bin/f2c/main.c index d3d1417c..f58a177 100644 --- a/usr.bin/f2c/main.c +++ b/usr.bin/f2c/main.c @@ -95,11 +95,13 @@ int krparens = NO; int hsize; /* for padding under -h */ int htype; /* for wr_equiv_init under -h */ chainp Iargs; +char *o_coutput = 0; #define f2c_entry(swit,count,type,store,size) \ p_entry ("-", swit, 0, count, type, store, size) static arg_info table[] = { + f2c_entry ("o", P_ONE_ARG, P_STRING, &o_coutput, YES), f2c_entry ("w66", P_NO_ARGS, P_INT, &ftn66flag, YES), f2c_entry ("w", P_NO_ARGS, P_INT, &nowarnflag, YES), f2c_entry ("66", P_NO_ARGS, P_INT, &no66flag, YES), @@ -499,13 +501,20 @@ main(int argc, char **argv) if (file_name && *file_name) { cdfilename = coutput; if (debugflag != 1) { - coutput = c_name(file_name,'c'); - cdfilename = copys(outbtail); - if (Castargs1 >= 2) + if (!o_coutput) + coutput = c_name(file_name,'c'); + else + coutput = o_coutput; + cdfilename = copys(outbtail); + if (Castargs1 >= 2) proto_fname = c_name(file_name,'P'); - } + } if (skipC) coutput = 0; + if (coutput[0] == '-') { + c_output = stdout; + coutput = 0; + } else if (!(c_output = fopen(coutput, textwrite))) { file_name = coutput; coutput = 0; /* don't delete read-only .c file */ -- cgit v1.1