diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 28 |
1 files changed, 15 insertions, 13 deletions
@@ -106,12 +106,13 @@ KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) | |||
106 | $(if $(KBUILD_OUTPUT),, \ | 106 | $(if $(KBUILD_OUTPUT),, \ |
107 | $(error output directory "$(saved-output)" does not exist)) | 107 | $(error output directory "$(saved-output)" does not exist)) |
108 | 108 | ||
109 | .PHONY: $(MAKECMDGOALS) | 109 | .PHONY: $(MAKECMDGOALS) cdbuilddir |
110 | $(MAKECMDGOALS) _all: cdbuilddir | ||
110 | 111 | ||
111 | $(filter-out _all,$(MAKECMDGOALS)) _all: | 112 | cdbuilddir: |
112 | $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ | 113 | $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ |
113 | KBUILD_SRC=$(CURDIR) \ | 114 | KBUILD_SRC=$(CURDIR) \ |
114 | KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile $@ | 115 | KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile $(MAKECMDGOALS) |
115 | 116 | ||
116 | # Leave processing to above invocation of make | 117 | # Leave processing to above invocation of make |
117 | skip-makefile := 1 | 118 | skip-makefile := 1 |
@@ -337,8 +338,9 @@ AFLAGS := -D__ASSEMBLY__ | |||
337 | 338 | ||
338 | # Read KERNELRELEASE from .kernelrelease (if it exists) | 339 | # Read KERNELRELEASE from .kernelrelease (if it exists) |
339 | KERNELRELEASE = $(shell cat .kernelrelease 2> /dev/null) | 340 | KERNELRELEASE = $(shell cat .kernelrelease 2> /dev/null) |
341 | KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) | ||
340 | 342 | ||
341 | export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE \ | 343 | export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION \ |
342 | ARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \ | 344 | ARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \ |
343 | CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \ | 345 | CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \ |
344 | HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS | 346 | HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS |
@@ -433,6 +435,7 @@ export KBUILD_DEFCONFIG | |||
433 | config %config: scripts_basic outputmakefile FORCE | 435 | config %config: scripts_basic outputmakefile FORCE |
434 | $(Q)mkdir -p include/linux | 436 | $(Q)mkdir -p include/linux |
435 | $(Q)$(MAKE) $(build)=scripts/kconfig $@ | 437 | $(Q)$(MAKE) $(build)=scripts/kconfig $@ |
438 | $(Q)$(MAKE) .kernelrelease | ||
436 | 439 | ||
437 | else | 440 | else |
438 | # =========================================================================== | 441 | # =========================================================================== |
@@ -542,7 +545,7 @@ export INSTALL_PATH ?= /boot | |||
542 | # makefile but the arguement can be passed to make if needed. | 545 | # makefile but the arguement can be passed to make if needed. |
543 | # | 546 | # |
544 | 547 | ||
545 | MODLIB := $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) | 548 | MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) |
546 | export MODLIB | 549 | export MODLIB |
547 | 550 | ||
548 | 551 | ||
@@ -783,12 +786,10 @@ endif | |||
783 | localver-full = $(localver)$(localver-auto) | 786 | localver-full = $(localver)$(localver-auto) |
784 | 787 | ||
785 | # Store (new) KERNELRELASE string in .kernelrelease | 788 | # Store (new) KERNELRELASE string in .kernelrelease |
786 | kernelrelease = \ | 789 | kernelrelease = $(KERNELVERSION)$(localver-full) |
787 | $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(localver-full) | ||
788 | .kernelrelease: FORCE | 790 | .kernelrelease: FORCE |
789 | $(Q)rm -f .kernelrelease | 791 | $(Q)rm -f $@ |
790 | $(Q)echo $(kernelrelease) > .kernelrelease | 792 | $(Q)echo $(kernelrelease) > $@ |
791 | $(Q)echo " Building kernel $(kernelrelease)" | ||
792 | 793 | ||
793 | 794 | ||
794 | # Things we need to do before we recursively start building the kernel | 795 | # Things we need to do before we recursively start building the kernel |
@@ -898,7 +899,7 @@ define filechk_version.h | |||
898 | ) | 899 | ) |
899 | endef | 900 | endef |
900 | 901 | ||
901 | include/linux/version.h: $(srctree)/Makefile FORCE | 902 | include/linux/version.h: $(srctree)/Makefile .config FORCE |
902 | $(call filechk,version.h) | 903 | $(call filechk,version.h) |
903 | 904 | ||
904 | # --------------------------------------------------------------------------- | 905 | # --------------------------------------------------------------------------- |
@@ -1301,9 +1302,10 @@ checkstack: | |||
1301 | $(PERL) $(src)/scripts/checkstack.pl $(ARCH) | 1302 | $(PERL) $(src)/scripts/checkstack.pl $(ARCH) |
1302 | 1303 | ||
1303 | kernelrelease: | 1304 | kernelrelease: |
1304 | @echo $(KERNELRELEASE) | 1305 | $(if $(wildcard .kernelrelease), $(Q)echo $(KERNELRELEASE), \ |
1306 | $(error kernelrelease not valid - run 'make *config' to update it)) | ||
1305 | kernelversion: | 1307 | kernelversion: |
1306 | @echo $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) | 1308 | @echo $(KERNELVERSION) |
1307 | 1309 | ||
1308 | # FIXME Should go into a make.lib or something | 1310 | # FIXME Should go into a make.lib or something |
1309 | # =========================================================================== | 1311 | # =========================================================================== |