From 0081c187002a264d211abcc6f32179a51230e0ba Mon Sep 17 00:00:00 2001 From: hpa Date: Thu, 13 Dec 2001 07:34:25 +0000 Subject: [PATCH] Print a copyright string in memdisk; clean up the handling of dates somewhat. --- Makefile | 20 ++++++++++---------- memdisk/Makefile | 5 ++++- memdisk/setup.c | 5 ++++- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index d764825..1f10169 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,16 @@ OBSOLETE = pxelinux.bin # Things to install in /usr/bin INSTALL_BIN = syslinux gethostip ppmtolss16 lss16toppm +# The DATE is set on the make command line when building binaries for +# official release. Otherwise, substitute a hex string that is pretty much +# guaranteed to be unique to be unique from build to build. +ifndef HEXDATE +HEXDATE := $(shell perl now.pl ldlinux.asm pxelinux.asm isolinux.asm) +endif +ifndef DATE +DATE := $(HEXDATE) +endif + all: $(BTARGET) $(ITARGET) samples memdisk ls -l $(BTARGET) $(ITARGET) memdisk/memdisk @@ -60,16 +70,6 @@ samples: memdisk: $(MAKE) -C memdisk all -# The DATE is set on the make command line when building binaries for -# official release. Otherwise, substitute a hex string that is pretty much -# guaranteed to be unique to be unique from build to build. -ifndef HEXDATE -HEXDATE := $(shell perl now.pl ldlinux.asm pxelinux.asm) -endif -ifndef DATE -DATE := $(HEXDATE) -endif - ldlinux.bin: ldlinux.asm $(NASM) -f bin -dVERSION="'$(VERSION)'" -dDATE_STR="'$(DATE)'" \ -dHEXDATE="$(HEXDATE)" \ diff --git a/memdisk/Makefile b/memdisk/Makefile index 70d6f69..9dfa9b6 100644 --- a/memdisk/Makefile +++ b/memdisk/Makefile @@ -11,9 +11,12 @@ ## ## ----------------------------------------------------------------------- +VERSION := $(shell cat ../version) + CC = gcc CFLAGS = -Wall -O2 -fomit-frame-pointer -march=i386 \ - -malign-functions=0 -malign-jumps=0 -malign-loops=0 + -malign-functions=0 -malign-jumps=0 -malign-loops=0 \ + -DVERSION=\"$(VERSION)\" -DDATE=\"$(DATE)\" LDFLAGS = AS = as LD = ld diff --git a/memdisk/setup.c b/memdisk/setup.c index 1d1c2d5..04c2aaa 100644 --- a/memdisk/setup.c +++ b/memdisk/setup.c @@ -15,6 +15,8 @@ #include "e820.h" #include "conio.h" +#define COPYYEAR "2001" + extern const char _binary_memdisk_bin_start[], _binary_memdisk_bin_end[]; extern const char _binary_memdisk_bin_size[]; /* Weird, I know */ @@ -392,7 +394,8 @@ uint32_t setup(void) int total_size; /* Show signs of life */ - puts("Memdisk: Hello, World!\n"); + puts("MEMDISK " VERSION " " DATE + " Copyright " COPYYEAR " H. Peter Anvin\n"); if ( !shdr->ramdisk_image || !shdr->ramdisk_size ) { puts("MEMDISK: No ramdisk image specified!\n"); -- 2.7.4