diff options
author | Robert de Bath <rdebath@poboxes.com> | 2002-04-17 22:05:01 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2013-10-23 23:48:46 +0200 |
commit | 352e3b3230dfc6746be6d53325ffe1e33efc5289 (patch) | |
tree | 4c169beb4657a1ed3a046817db01cbe49b17017c /as | |
parent | df538463687d768b6ee8247ff4412b78850e7404 (diff) | |
download | dev86-352e3b3230dfc6746be6d53325ffe1e33efc5289.tar.gz |
Import Dev86src-0.16.3.tar.gzv0.16.3
Diffstat (limited to 'as')
-rw-r--r-- | as/Makefile | 7 | ||||
-rw-r--r-- | as/as.c | 22 | ||||
-rw-r--r-- | as/syshead.h | 1 |
3 files changed, 28 insertions, 2 deletions
diff --git a/as/Makefile b/as/Makefile index 4dedc8d..5873f14 100644 --- a/as/Makefile +++ b/as/Makefile @@ -1,4 +1,8 @@ +ifeq ($(VERSION),) +include Version +endif + CFLAGS=-O LDFLAGS=-s LIBDIR=/usr/bin @@ -30,6 +34,9 @@ install: all clean realclean clobber: rm -f *.o as86 as86_encap +.c.o: + $(CC) -DVERSION='"$(VERSION)"' $(CFLAGS) -c $< + as.o: const.h type.h byteord.h macro.h file.h flag.h globvar.h assemble.o: const.h type.h address.h globvar.h opcode.h scan.h error.o: const.h type.h @@ -25,6 +25,9 @@ PRIVATE struct schain_s hid_mcpar[MACPSIZ]; /* MACRO params */ PRIVATE struct macro_s hid_macstak[MAXBLOCK]; /* macro stack */ PRIVATE struct sym_s *hid_spt[SPTSIZ]; /* hash table */ +PRIVATE char * binfilename = 0; +PRIVATE char * objfilename = 0; + FORWARD void initp1 P((void)); FORWARD int my_creat P((char *name, char *message)); FORWARD void process_args P((int argc, char **argv)); @@ -77,6 +80,16 @@ PUBLIC void finishup() if (lstfil != STDOUT && (toterr != 0 || totwarn != 0)) summary(STDOUT); statistics(); + + /* If an output binary is in error remove it */ + close(binfil); binfil=0; + close(objfil); objfil=0; + if (toterr != 0) + { + if(binfilename) unlink(binfilename); + if(objfilename) unlink(objfilename); + } + exit(toterr != 0 ? 1 : 0); /* should close output files and check */ } @@ -175,6 +188,11 @@ char **argv; } switch (arg[1]) { + case 'v': + outfd = STDOUT; + writes("as86 version: "); + writesn(VERSION); + exit(1); #ifdef I80386 case '0': case '1': case '2': idefsize = defsize = 0x2; @@ -191,7 +209,7 @@ char **argv; case 'b': if (!isnextarg || binfil != 0) usage(); - binfil = my_creat(nextarg, "error creating binary file"); + binfil = my_creat(binfilename=nextarg, "error creating binary file"); binaryg = TRUE; --argc; ++argv; @@ -234,7 +252,7 @@ char **argv; if (!isnextarg || objfil != 0) usage(); objectg = TRUE; - objfil = my_creat(nextarg, "error creating object file"); + objfil = my_creat(objfilename=nextarg, "error creating object file"); --argc; ++argv; break; diff --git a/as/syshead.h b/as/syshead.h index b3ca9eb..2e06496 100644 --- a/as/syshead.h +++ b/as/syshead.h @@ -18,6 +18,7 @@ #include <fcntl.h> #undef min #undef POSIX_HEADERS_MISSING +#define VERSION "MSDOS Compile" #endif #if __STDC__ && !defined(__minix) |