diff options
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) { |