Share the gen-id stuff between core and memdisk
authorH. Peter Anvin <hpa@zytor.com>
Mon, 7 Jul 2008 22:32:21 +0000 (15:32 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 7 Jul 2008 22:32:21 +0000 (15:32 -0700)
Both core and memdisk wants to use the gen-id stuff, so let it.

core/Makefile
core/config.inc
gen-id.sh [moved from core/gen-id.sh with 100% similarity]
memdisk/Makefile
memdisk/memdisk16.asm
now.pl [moved from core/now.pl with 100% similarity]

index f5b9b4e..a04a84f 100644 (file)
@@ -69,10 +69,10 @@ ALLSRC   = $(NASMSRC) $(NASMHDR) $(CSRC) $(CHDR) $(OTHERSRC)
 # 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 $(SRCS))
+HEXDATE := $(shell $(PERL) ../now.pl $(SRCS))
 endif
 ifndef DATE
-DATE    := $(shell sh gen-id.sh $(HEXDATE))
+DATE    := $(shell sh ../gen-id.sh $(HEXDATE))
 endif
 
 all: $(BTARGET)
index 9ff7b85..8dd9ca6 100644 (file)
@@ -46,9 +46,7 @@ MAX_FKEYS     equ 12                  ; Number of F-key help files
 ;
 ; Version number definitinons
 ;
-%ifndef DEPEND                         ; Generated file
 %include "../version.gen"
-%endif
 
 ;
 ; Copyright year...
similarity index 100%
rename from core/gen-id.sh
rename to gen-id.sh
index 005ab1d..073d32c 100644 (file)
@@ -38,6 +38,18 @@ NINCLUDE =
 OBJCOPY  = objcopy
 PERL     = perl
 
+SRCS    = $(wildcard *.asm *.c *.h)
+
+# 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 $(SRCS))
+endif
+ifndef DATE
+DATE    := $(shell sh ../gen-id.sh $(HEXDATE))
+endif
+
 # Important: init.o16 must be first!!
 OBJS16   = init.o16 init32.o
 OBJS32   = start32.o setup.o msetup.o e820func.o conio.o memcpy.o memset.o \
index d73ddc5..d43404e 100644 (file)
@@ -19,6 +19,8 @@
 ;; com32.inc in the main SYSLINUX distribution.
 ;;
 
+%include '../version.gen'
+
 MY_CS          equ 0x0800              ; Segment address to use
 CS_BASE                equ (MY_CS << 4)        ; Corresponding address
 
@@ -79,7 +81,7 @@ b_edx         dd 0                    ; EDX for boot sector invocation
 
                section .rodata
 memdisk_version:
-               db "MEMDISK ", VERSION, " ", DATE, 0
+               db "MEMDISK ", VERSION_STR, " ", DATE, 0
 
 ;; -----------------------------------------------------------------------
 ;;  End kernel image header
similarity index 100%
rename from core/now.pl
rename to now.pl