Makefile: use CFLAGS+= instead of CFLAGS=. Don't use the f2c's malloc.

main.c: reinstitute the -o option to rename C output file.
This commit is contained in:
Jean-Marc Zucconi 1995-09-28 20:43:33 +00:00
parent 5d60853225
commit c28f850118
2 changed files with 15 additions and 7 deletions

View File

@ -2,15 +2,14 @@
PROG= f2c PROG= f2c
g = -O CFLAGS += -DANSI_Libraries -I${.CURDIR} -I.
CFLAGS = $g -DANSI_Libraries -I${.CURDIR} -I.
SHELL = /bin/sh SHELL = /bin/sh
SRCSd = main.c init.c gram.c lex.c proc.c equiv.c data.c format.c \ 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 \ 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 \ 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 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\ GRAMFILES = ${.CURDIR}/gram.head ${.CURDIR}/gram.dcl ${.CURDIR}/gram.expr\
${.CURDIR}/gram.exec ${.CURDIR}/gram.io ${.CURDIR}/gram.exec ${.CURDIR}/gram.io

View File

@ -95,11 +95,13 @@ int krparens = NO;
int hsize; /* for padding under -h */ int hsize; /* for padding under -h */
int htype; /* for wr_equiv_init under -h */ int htype; /* for wr_equiv_init under -h */
chainp Iargs; chainp Iargs;
char *o_coutput = 0;
#define f2c_entry(swit,count,type,store,size) \ #define f2c_entry(swit,count,type,store,size) \
p_entry ("-", swit, 0, count, type, store, size) p_entry ("-", swit, 0, count, type, store, size)
static arg_info table[] = { 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 ("w66", P_NO_ARGS, P_INT, &ftn66flag, YES),
f2c_entry ("w", P_NO_ARGS, P_INT, &nowarnflag, YES), f2c_entry ("w", P_NO_ARGS, P_INT, &nowarnflag, YES),
f2c_entry ("66", P_NO_ARGS, P_INT, &no66flag, 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) { if (file_name && *file_name) {
cdfilename = coutput; cdfilename = coutput;
if (debugflag != 1) { if (debugflag != 1) {
coutput = c_name(file_name,'c'); if (!o_coutput)
cdfilename = copys(outbtail); coutput = c_name(file_name,'c');
if (Castargs1 >= 2) else
coutput = o_coutput;
cdfilename = copys(outbtail);
if (Castargs1 >= 2)
proto_fname = c_name(file_name,'P'); proto_fname = c_name(file_name,'P');
} }
if (skipC) if (skipC)
coutput = 0; coutput = 0;
if (coutput[0] == '-') {
c_output = stdout;
coutput = 0;
}
else if (!(c_output = fopen(coutput, textwrite))) { else if (!(c_output = fopen(coutput, textwrite))) {
file_name = coutput; file_name = coutput;
coutput = 0; /* don't delete read-only .c file */ coutput = 0; /* don't delete read-only .c file */