Commit ea253a53 authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Small fixes

o When using "make -j<n>", the order in modversions.h could change,
  thus causing unnecessary rebuilds.
o Move a comment in Rules.make which I forgot when I moved the
  associated code.
o When descending into init/ during the final vmlinux link,
  add a '+' do tell make to use its normal "-j" jobserver handling.
o It'd be nice to get the logic between make clean and make mrproper
  clearer. I think make clean should remove all targets used in the
  actual build,
  make mrproper should remove the rest, build-specific files, like
  e.g. the .*.cmd files used to save dependencies and command lines
  and other temporary files.
  A real small step in the direction: Remove .tmpversion/.tmp-export-objs
  at mrproper time.
parent 68587662
...@@ -225,7 +225,7 @@ define rule_link_vmlinux ...@@ -225,7 +225,7 @@ define rule_link_vmlinux
echo Generating build number echo Generating build number
. scripts/mkversion > .tmpversion . scripts/mkversion > .tmpversion
mv -f .tmpversion .version mv -f .tmpversion .version
$(MAKE) -C init +$(MAKE) -C init
$(call cmd,cmd_link_vmlinux) $(call cmd,cmd_link_vmlinux)
$(cmd_link_vmlinux) $(cmd_link_vmlinux)
echo 'cmd_$@ := $(cmd_link_vmlinux)' > $(@D)/.$(@F).cmd echo 'cmd_$@ := $(cmd_link_vmlinux)' > $(@D)/.$(@F).cmd
...@@ -353,7 +353,7 @@ include/linux/modversions.h: scripts/fixdep prepare FORCE ...@@ -353,7 +353,7 @@ include/linux/modversions.h: scripts/fixdep prepare FORCE
@( echo "#ifndef _LINUX_MODVERSIONS_H";\ @( echo "#ifndef _LINUX_MODVERSIONS_H";\
echo "#define _LINUX_MODVERSIONS_H"; \ echo "#define _LINUX_MODVERSIONS_H"; \
echo "#include <linux/modsetver.h>"; \ echo "#include <linux/modsetver.h>"; \
for f in `cd .tmp_export-objs; find modules -name \*.ver -print`; do \ for f in `cd .tmp_export-objs; find modules -name \*.ver -print | sort`; do \
echo "#include <linux/$${f}>"; \ echo "#include <linux/$${f}>"; \
done; \ done; \
echo "#endif"; \ echo "#endif"; \
...@@ -574,9 +574,8 @@ make_with_config: .config ...@@ -574,9 +574,8 @@ make_with_config: .config
# files removed with 'make clean' # files removed with 'make clean'
CLEAN_FILES += \ CLEAN_FILES += \
kernel/ksyms.lst include/linux/compile.h \ include/linux/compile.h \
vmlinux System.map \ vmlinux System.map \
.tmp* \
drivers/char/consolemap_deftbl.c drivers/video/promcon_tbl.c \ drivers/char/consolemap_deftbl.c drivers/video/promcon_tbl.c \
drivers/char/conmakehash \ drivers/char/conmakehash \
drivers/char/drm/*-mod.c \ drivers/char/drm/*-mod.c \
...@@ -616,9 +615,11 @@ MRPROPER_FILES += \ ...@@ -616,9 +615,11 @@ MRPROPER_FILES += \
.hdepend scripts/split-include scripts/docproc \ .hdepend scripts/split-include scripts/docproc \
scripts/fixdep $(TOPDIR)/include/linux/modversions.h \ scripts/fixdep $(TOPDIR)/include/linux/modversions.h \
tags TAGS kernel.spec \ tags TAGS kernel.spec \
.tmpversion
# directories removed with 'make mrproper' # directories removed with 'make mrproper'
MRPROPER_DIRS += \ MRPROPER_DIRS += \
.tmp_export-objs \
include/config \ include/config \
$(TOPDIR)/include/linux/modules $(TOPDIR)/include/linux/modules
...@@ -631,7 +632,7 @@ clean: archclean ...@@ -631,7 +632,7 @@ clean: archclean
@find . \( -name \*.[oas] -o -name core -o -name .\*.cmd -o \ @find . \( -name \*.[oas] -o -name core -o -name .\*.cmd -o \
-name .\*.tmp -o -name .\*.d \) -type f -print \ -name .\*.tmp -o -name .\*.d \) -type f -print \
| grep -v lxdialog/ | xargs rm -f | grep -v lxdialog/ | xargs rm -f
@rm -rf $(CLEAN_FILES) @rm -f $(CLEAN_FILES)
@$(MAKE) -C Documentation/DocBook clean @$(MAKE) -C Documentation/DocBook clean
mrproper: clean archmrproper mrproper: clean archmrproper
......
...@@ -88,6 +88,9 @@ real-objs-m := $(foreach m, $(obj-m), $(if $($(m:.o=-objs)),$($(m:.o=-objs)),$(m ...@@ -88,6 +88,9 @@ real-objs-m := $(foreach m, $(obj-m), $(if $($(m:.o=-objs)),$($(m:.o=-objs)),$(m
# Get things started. # Get things started.
# ========================================================================== # ==========================================================================
# If a Makefile does define neither O_TARGET nor L_TARGET,
# use a standard O_TARGET named "built-in.o"
ifndef O_TARGET ifndef O_TARGET
ifndef L_TARGET ifndef L_TARGET
O_TARGET := built-in.o O_TARGET := built-in.o
...@@ -173,9 +176,6 @@ cmd_as_o_S = $(CC) -Wp,-MD,.$(subst /,_,$@).d $(a_flags) -c -o $@ $< ...@@ -173,9 +176,6 @@ cmd_as_o_S = $(CC) -Wp,-MD,.$(subst /,_,$@).d $(a_flags) -c -o $@ $<
%.o: %.S FORCE %.o: %.S FORCE
$(call if_changed_dep,as_o_S) $(call if_changed_dep,as_o_S)
# If a Makefile does define neither O_TARGET nor L_TARGET,
# use a standard O_TARGET named "built-in.o"
# Build the compiled-in targets # Build the compiled-in targets
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment