From 352e3b3230dfc6746be6d53325ffe1e33efc5289 Mon Sep 17 00:00:00 2001 From: Robert de Bath Date: Wed, 17 Apr 2002 22:05:01 +0200 Subject: Import Dev86src-0.16.3.tar.gz --- bcc/Makefile | 10 ++++++---- bcc/bcc.c | 16 +++++++++++----- bcc/codefrag.c | 12 ++++++++++++ 3 files changed, 29 insertions(+), 9 deletions(-) (limited to 'bcc') diff --git a/bcc/Makefile b/bcc/Makefile index ed4854f..93b122c 100644 --- a/bcc/Makefile +++ b/bcc/Makefile @@ -12,6 +12,8 @@ BINDIR =$(PREFIX)/bin LIBDIR =$(LIBPRE)/lib/bcc BCCDEFS =-DLOCALPREFIX=$(LIBPRE) -DBINDIR=$(BINDIR) -DDEFARCH=0 +BCFLAGS=$(ANSI) $(CFLAGS) $(LDFLAGS) -DVERSION='"$(VERSION)"' + OBJS = bcc-cc1.o codefrag.o debug.o declare.o express.o exptree.o floatop.o \ function.o gencode.o genloads.o glogcode.o hardop.o input.o label.o \ loadexp.o longop.o output.o preproc.o preserve.o scan.o softop.o \ @@ -26,16 +28,16 @@ install: all install -m 755 bcc-cc1 $(LIBDIR)/bcc-cc1 bcc: bcc.c - $(CC) $(ANSI) $(CFLAGS) $(BCCDEFS) $(LDFLAGS) $^ -o $@ + $(CC) $(BCFLAGS) $(BCCDEFS) $^ -o $@ ncc: bcc.c - $(CC) $(ANSI) $(CFLAGS) -DL_TREE -DDEFARCH=0 $(LDFLAGS) $^ -o $@ + $(CC) $(BCFLAGS) -DL_TREE -DDEFARCH=0 $^ -o $@ bcc09: bcc.c - $(CC) $(ANSI) $(CFLAGS) -DMC6809 $(BCCDEFS) $(LDFLAGS) $^ -o $@ + $(CC) $(BCFLAGS) -DMC6809 $(BCCDEFS) $^ -o $@ ccc: bcc.c - $(CC) $(ANSI) $(CFLAGS) -DCCC $(BCCDEFS) $(LDFLAGS) $^ -o $@ + $(CC) $(BCFLAGS) -DCCC $(BCCDEFS) $^ -o $@ bcc-cc1: $(OBJS) $(CC) $(BCCARCH) $(LDFLAGS) $(OBJS) -o bcc-cc1 diff --git a/bcc/bcc.c b/bcc/bcc.c index 1471aa8..4717315 100644 --- a/bcc/bcc.c +++ b/bcc/bcc.c @@ -41,6 +41,7 @@ #define F_OK 0 /* Test for existence. */ #define L_TREE 1 /* Use different tree style */ #define DEFARCH 0 /* Default to 8086 code */ +#define VERSION "MSDOS Compile" #else #define EXESUF #endif @@ -224,8 +225,6 @@ char ** argv; if (do_compile && next_file->filetype == 'i') run_compile(next_file); if (do_optim && next_file->filetype == 's') run_optim(next_file); if (do_as && next_file->filetype == 's') run_as(next_file); - - if (next_file->filetype == '~') error_count++; } if (do_link && !error_count) @@ -979,7 +978,11 @@ int size; void Usage() { - fatal("Usage: bcc [-ansi] [-options] [-o output] file [files]"); + if (opt_v) + fprintf(stderr, "%s: version %s\n", progname, VERSION); + fprintf(stderr, + "Usage: %s [-ansi] [-options] [-o output] file [files].\n", progname); + exit(1); } void fatal(str) @@ -1134,7 +1137,10 @@ static char ** minienviron[] = { (void) signal(SIGTERM, otsig); (void) signal(SIGCHLD, ocsig); #endif - if (status && file) - file->filetype = '~'; + if (status) + { + if (file) file->filetype = '~'; + error_count++; + } } diff --git a/bcc/codefrag.c b/bcc/codefrag.c index e7961ce..bdcb850 100644 --- a/bcc/codefrag.c +++ b/bcc/codefrag.c @@ -1617,6 +1617,18 @@ offset_T value; outset(); outshex(value); outnl(); +#ifdef FRAMEPOINTER + if (framep) + { + outbyte(LOCALSTARTCHAR); + outstr(funcname); + outbyte(LOCALSTARTCHAR); + outstr(name); + outset(); + outshex(value+sp-framep); + outnl(); + } +#endif } /* shift left register by 1 */ -- cgit v1.2.1