From 7a4a1ac162fe8783d425fdf614562c829f37276f Mon Sep 17 00:00:00 2001 From: Anton Farygin Date: Mon, 12 Apr 2004 20:49:45 +0000 Subject: [PATCH] build only diet version of insmod; make version.h with versions defines --- Makefile | 12 ++++++++---- Makefile.common | 4 ++-- config-stage1.h | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 2f56828..1f1d169 100644 --- a/Makefile +++ b/Makefile @@ -38,11 +38,10 @@ top_dir = . + include $(top_dir)/Makefile.common -VERSION = $(CFGversion) - -DEFS = -DVERSION=\"$(VERSION)\" -DSPAWN_SHELL -DDISTRIB_NAME=\"$(CFGdistribname)\" +DEFS = -DSPAWN_SHELL COMPILE = $(CC) $(DEFS) $(CFLAGS) @@ -157,7 +156,7 @@ DIRS += mar pci-resource usb-resource $(INSMOD) slang newt bzlib USBNET_DEFS_GEN = -DENABLE_USB -DENABLE_USBNET USBNET_DEFS = $(USBNET_DEFS_GEN) -DDISABLE_PCINET -all: unpack dirs $(BINS) +all: unpack version.h dirs $(BINS) unpack: rm -rf $(top_dir)/$(TMP_PKG) @@ -218,6 +217,10 @@ $(STAGE1OBJS-FULL): %-FULL.o: %.c .c.o: $(COMPILE) $(INCLUDES) -c $< +version.h: + echo "#define VERSION \"$$VERSION\"" >version.h; \ + echo "#define DISTRIB_NAME \"$$ORIGIN $$VERSION $$SUITE ($$CODENAME)\"" >>version.h + clean: @for n in $(DIRS); do \ @@ -225,6 +228,7 @@ clean: done rm -rf $(TMP_PKG) rm -f *.o .depend *.rdz *.img $(BINS) + rm -f version.h tar-mkinitrd_helper: clean diff --git a/Makefile.common b/Makefile.common index be67df0..a575ef7 100644 --- a/Makefile.common +++ b/Makefile.common @@ -14,11 +14,11 @@ # #***************************************************************************** -include $(DISTRCONF) - ARCH := $(patsubst i%86,i386,$(shell uname -m)) ARCH := $(patsubst sparc%,sparc,$(ARCH)) +include $(DISTRCONF) + #- default lib is dietlibc (honoured by main Makefile whenever possible) L = DIETLIBC #L = GLIBC diff --git a/config-stage1.h b/config-stage1.h index 51a7bc4..272f336 100644 --- a/config-stage1.h +++ b/config-stage1.h @@ -16,7 +16,7 @@ #define _CONFIG_STAGE1_H_ #define _GNU_SOURCE 1 - +#include "version.h" /* If we have more than that amount of memory (in Mbytes), we assume we can load the second stage as a ramdisk */ #define MEM_LIMIT_RAMDISK 80