diff options
author | Robert de Bath <rdebath@poboxes.com> | 2003-09-20 19:44:36 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2013-10-23 23:48:49 +0200 |
commit | 22950ba3df3a0b739786243679d69cd4094e8b20 (patch) | |
tree | 942907e918e556d340dcbcb8ffdc0f7d020a275e /bcc | |
parent | 5613ba3c0749fa494d35c4dc36b57c5b4e6edb55 (diff) | |
download | dev86-22950ba3df3a0b739786243679d69cd4094e8b20.tar.gz |
Import Dev86src-0.16.13.tar.gzv0.16.13
Diffstat (limited to 'bcc')
-rw-r--r-- | bcc/Makefile | 10 | ||||
-rw-r--r-- | bcc/bcc.c | 30 |
2 files changed, 29 insertions, 11 deletions
diff --git a/bcc/Makefile b/bcc/Makefile index 93b122c..8c2c19b 100644 --- a/bcc/Makefile +++ b/bcc/Makefile @@ -12,7 +12,7 @@ BINDIR =$(PREFIX)/bin LIBDIR =$(LIBPRE)/lib/bcc BCCDEFS =-DLOCALPREFIX=$(LIBPRE) -DBINDIR=$(BINDIR) -DDEFARCH=0 -BCFLAGS=$(ANSI) $(CFLAGS) $(LDFLAGS) -DVERSION='"$(VERSION)"' +BCFLAGS=$(ANSI) $(CFLAGS) $(LDFLAGS) 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 \ @@ -28,16 +28,16 @@ install: all install -m 755 bcc-cc1 $(LIBDIR)/bcc-cc1 bcc: bcc.c - $(CC) $(BCFLAGS) $(BCCDEFS) $^ -o $@ + $(CC) $(BCFLAGS) $(BCCDEFS) bcc.c -o $@ ncc: bcc.c - $(CC) $(BCFLAGS) -DL_TREE -DDEFARCH=0 $^ -o $@ + $(CC) $(BCFLAGS) -DL_TREE -DDEFARCH=0 bcc.c -o $@ bcc09: bcc.c - $(CC) $(BCFLAGS) -DMC6809 $(BCCDEFS) $^ -o $@ + $(CC) $(BCFLAGS) -DMC6809 $(BCCDEFS) bcc.c -o $@ ccc: bcc.c - $(CC) $(BCFLAGS) -DCCC $(BCCDEFS) $^ -o $@ + $(CC) $(BCFLAGS) -DCCC $(BCCDEFS) bcc.c -o $@ bcc-cc1: $(OBJS) $(CC) $(BCCARCH) $(LDFLAGS) $(OBJS) -o bcc-cc1 @@ -32,6 +32,7 @@ #include <sys/wait.h> #include <signal.h> #endif +#include "version.h" #ifdef MSDOS #define LOCALPREFIX /linux86 @@ -307,8 +308,8 @@ struct file_list * file; !do_unproto && do_compile); - if (combined_cpp && !do_optim && !do_as ) last_stage =1; - if (!combined_cpp && !do_unproto && !do_compile ) last_stage =1; + if (combined_cpp && !do_optim && !do_as ) last_stage =1; + if (!combined_cpp && !do_compile ) last_stage =1; newfilename(file, last_stage, (combined_cpp?'s':'i'), (opt_arch<5)); @@ -455,10 +456,10 @@ run_link() default: command.cmd = LD; break; } command_reset(); - if (executable_name == 0) executable_name = "a.out"; - - command_opt("-o"); - command_opt(executable_name); + if (executable_name) { + command_opt("-o"); + command_opt(executable_name); + } if (opt_arch < 2) command_opt("-y"); @@ -742,6 +743,20 @@ char ** argv; for(ar=1; ar<argc; ) if (argv[ar][0] != '-') { +#ifdef __CYGWIN__ + if ( executable_name == 0 ) { + char * p = strrchr(argv[ar], '.'); + if (p && p == argv[ar] + strlen(argv[ar]) - 2) + { + /* This will actually create a COM file, but windows doesn't + * care and cygwin will only do PATH searches for EXE files. + */ + *p=0; + executable_name = catstr(argv[ar], ".exe"); + *p = '.'; + } + } +#endif append_file(argv[ar++], 0); file_count++; } @@ -937,6 +952,9 @@ char ** argv; #ifdef MSDOS if (opt_M==0) opt_M = 'd'; #endif +#ifdef __CYGWIN__ + if (opt_M==0) opt_M = 'd'; +#endif if (opt_M==0) opt_M = (opt_arch==1 ?'l':'n'); switch(opt_M) { |