Commit c3ef0e83 authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: More cleaning work...

o Having .config depend on all Config.in's via a find is
  annoying, since it causes a long break before "make" actually
  gets going. Comment it out for now.

o Fix some "make -j" issues with generating module versions.

o Unify "make distclean" and "make mrproper", they were doing nearly the
  same thing anyway.

o Use the new "make clean" infrastructure for arch/i386/boot/ and
  scripts/

o Reorganize the "make clean" stuff a little, do the 
  find -name '*.[oas]' | xargs rm -f from the top-level Makefile again
  and only use the per-subdir rule for special cases like generated files,
  host-progs and the like.
parent 20d4607f
......@@ -239,7 +239,7 @@ ifdef include-config
# If .config doesn't exist - tough luck
.config: arch/$(ARCH)/config.in $(shell find . -name Config.in)
.config: arch/$(ARCH)/config.in # FIXME $(shell find . -name Config.in)
@echo '***'
@if [ -f $@ ]; then \
echo '*** The tree was updated, so your .config may be'; \
......@@ -456,18 +456,23 @@ include/linux/version.h: Makefile
depend dep: .hdepend
# .hdepend is our (misnomed) marker for whether we've run
# .hdepend is our (misnomed) marker for whether we've
# generated module versions
.hdepend: $(if $(filter dep depend,$(MAKECMDGOALS)),FORCE)
make-versions := $(strip $(if $(filter dep depend,$(MAKECMDGOALS)),1) \
$(if $(wildcard .hdepend),,1))
.hdepend: prepare FORCE
ifneq ($(make-versions),)
@$(MAKE) include/linux/modversions.h
@touch $@
endif
ifdef CONFIG_MODVERSIONS
# Update modversions.h, but only if it would change.
include/linux/modversions.h: scripts/fixdep prepare FORCE
include/linux/modversions.h: FORCE
@rm -rf .tmp_export-objs
@$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS))
@echo -n ' Generating $@'
......@@ -688,42 +693,34 @@ MRPROPER_DIRS += \
include/config \
include/linux/modules
# clean - Delete all intermidiate files
# clean - Delete all intermediate files
#
clean-dirs += $(ALL_SUBDIRS) Documentation/DocBook
cleanprint:
@echo ' Cleaning the srctree'
clean-dirs += $(ALL_SUBDIRS) Documentation/DocBook scripts
$(addprefix _clean_,$(clean-dirs)): cleanprint
$(addprefix _clean_,$(clean-dirs)):
+@$(call descend,$(patsubst _clean_%,%,$@), subdirclean)
quiet_cmd_rmclean = RM $$(CLEAN_FILES)
cmd_rmclean = rm -f $(CLEAN_FILES)
clean: archclean $(addprefix _clean_,$(clean-dirs))
$(call cmd,rmclean)
@find . $(RCS_FIND_IGNORE) \
\( -name '*.[oas]' -o -name '.*.cmd' -o -name '.*.d' \
-o -name '.*.tmp' \) -type f -print | xargs rm -f
# mrproper - delete configuration + modules + core files
#
quiet_cmd_mrproper = RM $$(MRPROPER_DIRS) + $$(MRPROPER_FILES)
cmd_mrproper = rm -rf $(MRPROPER_DIRS) && rm -f $(MRPROPER_FILES)
mrproper: clean archmrproper
@echo ' Making mrproper in the srctree'
@find . $(RCS_FIND_IGNORE) \
\( -name .depend -o -name .\*.cmd -o -name core \) \
-type f -print | xargs rm -f
$(call cmd,mrproper)
+@$(call descend,scripts,mrproper)
# distclean - remove all temporaries left behind by patch, vi, emacs etc.
#
distclean: mrproper
@echo ' Making distclean in the srctree'
mrproper distclean: clean archmrproper
@echo ' Making $@ in the srctree'
@find . $(RCS_FIND_IGNORE) \
\( -not -type d \) -and \
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f \
-print | xargs rm -f
-o -name '.*.rej' -o -size 0 \
-o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
-type f -print | xargs rm -f
$(call cmd,mrproper)
# Generate tags for editors
# ---------------------------------------------------------------------------
......
......@@ -155,11 +155,17 @@ depfile = $(subst $(comma),_,$(@D)/.$(@F).d)
# targets (That happens when someone does make some/dir/foo.[ois])
ifeq ($(MAKECMDGOALS),subdirclean)
__clean-files := $(wildcard $(EXTRA_TARGETS) $(host-progs) $(clean-files))
subdirclean: $(subdir-ymn)
ifneq ($(strip $(__clean-files) $(clean-rule)),)
rm -f $(__clean-files)
$(clean-rule)
else
@/bin/true
@rm -f $(EXTRA_TARGETS) $(host-progs) $(clean-files) \
$(addprefix $(obj)/,*.[oas] .*.cmd .*.tmp .*.d)
@$(clean-rule)
endif
else
ifeq ($(MAKECMDGOALS),fastdep)
......@@ -180,7 +186,7 @@ else
# This sets version suffixes on exported symbols
# ---------------------------------------------------------------------------
MODVERDIR := include/linux/modules/
MODVERDIR := include/linux/modules
#
# Added the SMP separator to stop module accidents between uniprocessor
......
......@@ -86,6 +86,6 @@ install: vmlinux
+@$(call makeboot,BOOTIMAGE=$(BOOTIMAGE) install)
archclean:
+@$(call makeboot,clean)
+@$(call makeboot,subdirclean)
archmrproper:
......@@ -28,6 +28,8 @@ SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
EXTRA_TARGETS := vmlinux.bin bootsect bootsect.o \
setup setup.o zImage bzImage
subdir- := compressed
host-progs := tools/build
# Default
......@@ -79,11 +81,6 @@ zlilo: $(BOOTIMAGE)
install: $(BOOTIMAGE)
sh $(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
clean:
@echo 'Cleaning up (boot)'
@rm -f $(host-progs) $(EXTRA_TARGETS)
+@$(call descend,$(obj)/compressed) clean
archhelp:
@echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)'
@echo ' install - Install kernel using'
......
......@@ -24,7 +24,3 @@ LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T
$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
$(call if_changed,ld)
clean:
@echo 'Cleaning up (boot/compressed)'
@rm -f $(EXTRA_TARGETS)
......@@ -11,6 +11,8 @@
EXTRA_TARGETS := fixdep split-include docproc conmakehash
subdir- := lxdialog
# Yikes. We need to build this stuff here even if the user only wants
# modules.
......@@ -24,6 +26,8 @@ KBUILD_BUILTIN := 1
host-progs := fixdep split-include conmakehash docproc tkparse
tkparse-objs := tkparse.o tkcond.o tkgen.o
clean-files := kconfig.tk
include $(TOPDIR)/Rules.make
# In reality kconfig.tk should depend on all Config.in files,
......@@ -56,8 +60,3 @@ lxdialog:
# fixdep is needed to compile other host programs
$(obj)/split-include $(obj)/docproc $(addprefix $(obj)/,$(tkparse-objs)) \
$(obj)/conmakehash lxdialog: $(obj)/fixdep
mrproper:
@rm -f $(host-progs) $(addprefix $(obj)/,$(tkparse-objs) kconfig.tk core)
@$(call descend,scripts/lxdialog,mrproper)
......@@ -42,6 +42,3 @@ ncurses:
echo ;\
exit 1 ;\
fi
mrproper:
@rm -f $(host-progs) $(addprefix $(obj)/,$(lxdialog-objs))
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