lkml.org 
[lkml]   [2004]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
SubjectRe: kbuild: Support LOCALVERSION
On Wed, Sep 01, 2004 at 11:08:40AM +1000, Ian Wienand wrote:
> With this patch *without* a localversion file I get
>
> ianw@baci:/tmp/kbuild-test$ make
> cat: /tmp/kbuild-test/localversion*: No such file or directory
> make: *** No rule to make target `/tmp/kbuild-test/localversion*', needed by `include/linux/version.h'. Stop.
>
> However, with the right files there it works as you describe.

Sorry to reply to myself, but I forgot to include a suggested patch
(attached).

-i
===== Makefile 1.523 vs edited =====
--- 1.523/Makefile 2004-08-25 06:34:30 +10:00
+++ edited/Makefile 2004-09-01 11:17:27 +10:00
@@ -141,7 +141,14 @@

export srctree objtree VPATH TOPDIR

-KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+nullstring :=
+space := $(nullstring) # end of line
+localversion-files := $(wildcard $(objtree)/localversion* $(srctree)/localversion*)
+
+LOCALVERSION := $(subst $(space),, \
+ $(shell cat /dev/null $(localversion-files)))
+
+KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(LOCALVERSION)

# SUBARCH tells the usermode build what the underlying arch is. That is set
# first, and if a usermode build is happening, the "ARCH=um" on the command
@@ -329,8 +336,8 @@
-fno-strict-aliasing -fno-common
AFLAGS := -D__ASSEMBLY__

-export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
- CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
+export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION LOCALVERSION KERNELRELEASE \
+ ARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \
HOSTCXX HOSTCXXFLAGS LDFLAGS_BLOB LDFLAGS_MODULE CHECK CHECKFLAGS

@@ -763,7 +770,7 @@
)
endef

-include/linux/version.h: Makefile
+include/linux/version.h: $(srctree)/Makefile $(localversion-files)
$(call filechk,version.h)

# ---------------------------------------------------------------------------[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.082 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site