diff options
Diffstat (limited to 'ld')
-rw-r--r-- | ld/Makefile | 6 | ||||
-rw-r--r-- | ld/io.c | 11 | ||||
-rw-r--r-- | ld/ld.c | 2 | ||||
-rw-r--r-- | ld/syshead.h | 1 | ||||
-rw-r--r-- | ld/type.h | 1 |
5 files changed, 19 insertions, 2 deletions
diff --git a/ld/Makefile b/ld/Makefile index 393876c..104a740 100644 --- a/ld/Makefile +++ b/ld/Makefile @@ -1,4 +1,8 @@ +ifeq ($(VERSION),) +include Version +endif + LIBDIR =/usr/bin CFLAGS =-O LDFLAGS = @@ -9,7 +13,7 @@ LDFLAGS = # -DSTANDARD_GNU_A_OUT # a.out.h is like GNU normal. # -DNO_AOUT # a.out.h is like nothing known! # -DEFS =-DREL_OUTPUT -DBUGCOMPAT +DEFS =-DREL_OUTPUT -DBUGCOMPAT -DVERSION='"$(VERSION)"' # An alternative file for a non-standard a.out.h (eg i386 linux on an Alpha) # @@ -127,8 +127,10 @@ int level; PUBLIC void executable() { + if (errcount) + unlink(outputname); #ifndef MSDOS - if (errcount == 0) + else chmod(outputname, outputperms); #endif } @@ -620,6 +622,13 @@ PUBLIC void usage() #endif } +PUBLIC void version_msg() +{ + stderr_out(); + putstr("ld86 version: "); + errexit(VERSION); +} + PUBLIC void use_error(message) char *message; { @@ -99,6 +99,8 @@ char **argv; else switch (arg[1]) { + case 'v': + version_msg(); case 'r': /* relocatable output */ #ifndef REL_OUTPUT #ifndef MSDOS diff --git a/ld/syshead.h b/ld/syshead.h index fa5c23a..8ea2a3a 100644 --- a/ld/syshead.h +++ b/ld/syshead.h @@ -25,6 +25,7 @@ #define SEEK_SET 0 #define STDOUT_FILENO 0 #define STDERR_FILENO 0 +#define VERSION "MSDOS Compile" #endif /******************************************************************************/ @@ -119,6 +119,7 @@ void reserved P((char *name)); void size_error P((int seg, bin_off_t count, bin_off_t size)); void undefined P((char *name)); void usage P((void)); +void version_msg P((void)); void use_error P((char *message)); /* ld.c */ |