--- ./arch/um/drivers/Makefile.kbuild_clean 2003-12-28 12:51:47.000000000 +0100 +++ ./arch/um/drivers/Makefile 2003-12-30 16:44:42.000000000 +0100 @@ -45,14 +45,3 @@ obj-y += stdio_console.o $(CHAN_OBJS) UML_USER_OBJS += fd.o null.o pty.o tty.o xterm.o - -clean: - -modules: - -fastdep: - -dep: - -archmrproper: clean - --- ./arch/um/kernel/skas/sys-i386/Makefile.kbuild_clean 2003-12-28 12:51:48.000000000 +0100 +++ ./arch/um/kernel/skas/sys-i386/Makefile 2003-12-30 16:44:42.000000000 +0100 @@ -6,5 +6,3 @@ obj-y = sigcontext.o UML_USER_OBJS += sigcontext.o - -clean : --- ./arch/um/kernel/skas/util/Makefile.kbuild_clean 2003-12-20 17:20:03.000000000 +0100 +++ ./arch/um/kernel/skas/util/Makefile 2003-12-30 16:44:18.000000000 +0100 @@ -6,5 +6,4 @@ mk_ptregs.o : mk_ptregs.c $(CC) -c $< -clean : - $(RM) -f mk_ptregs *.o *~ +clean-files := mk_ptregs *.o *~ --- ./arch/um/kernel/skas/Makefile.kbuild_clean 2003-12-28 12:51:48.000000000 +0100 +++ ./arch/um/kernel/skas/Makefile 2003-12-30 16:44:42.000000000 +0100 @@ -12,13 +12,20 @@ UML_USER_OBJS += process.o time.o -$(TOPDIR)/arch/um/include/skas_ptregs.h : $(src)/util/mk_ptregs - @echo -n ' Generating $@' - @$< > $@.tmp - @if [ -r $@ ] && cmp -s $@ $@.tmp; then \ - echo ' (unchanged)'; \ - rm -f $@.tmp; \ - else \ - echo ' (updated)'; \ - mv -f $@.tmp $@; \ +#Copied from the main Makefile. +define filechk + @set -e; \ + echo ' CHK $@'; \ + mkdir -p $(dir $@); \ + $(filechk_$(1)) < $< > $@.tmp; \ + if [ -r $@ ] && cmp -s $@ $@.tmp; then \ + rm -f $@.tmp; \ + else \ + echo ' UPD $@'; \ + mv -f $@.tmp $@; \ fi +endef + +filechk_gen_header = $< +$(TOPDIR)/arch/um/include/skas_ptregs.h : $(src)/util/mk_ptregs + $(call filechk,gen_header) --- ./arch/um/kernel/tt/ptproxy/Makefile.kbuild_clean 2003-12-28 12:51:48.000000000 +0100 +++ ./arch/um/kernel/tt/ptproxy/Makefile 2003-12-30 16:44:42.000000000 +0100 @@ -6,5 +6,3 @@ obj-y = proxy.o ptrace.o sysdep.o wait.o UML_USER_OBJS := $(obj-y) - -clean: --- ./arch/um/kernel/tt/sys-i386/Makefile.kbuild_clean 2003-12-28 12:51:48.000000000 +0100 +++ ./arch/um/kernel/tt/sys-i386/Makefile 2003-12-30 16:44:42.000000000 +0100 @@ -6,5 +6,3 @@ obj-y = sigcontext.o UML_USER_OBJS += sigcontext.o - -clean : --- ./arch/um/kernel/tt/Makefile.kbuild_clean 2003-12-28 12:51:48.000000000 +0100 +++ ./arch/um/kernel/tt/Makefile 2003-12-30 16:44:42.000000000 +0100 @@ -21,5 +21,3 @@ $(obj)/unmap_fin.o : $(src)/unmap.o ld -r -o $@ $< -lc -L/usr/lib - -clean : --- ./arch/um/kernel/Makefile.kbuild_clean 2003-12-28 12:51:48.000000000 +0100 +++ ./arch/um/kernel/Makefile 2003-12-30 16:38:25.000000000 +0100 @@ -21,37 +21,25 @@ obj-$(CONFIG_MODE_TT) += tt/ obj-$(CONFIG_MODE_SKAS) += skas/ -clean-files := config.c - -user-objs-$(CONFIG_TTY_LOG) += tty_log.o - -UML_USER_OBJS += $(user-objs-y) config.o helper.o \ - process.o tempfile.o time.o tty_log.o umid.o user_util.o user_syms.o \ +UML_USER_OBJS += config.o helper.o process.o tempfile.o time.o tty_log.o \ + umid.o user_util.o user_syms.o \ frame.o DMODULES-$(CONFIG_MODULES) = -D__CONFIG_MODULES__ DMODVERSIONS-$(CONFIG_MODVERSIONS) = -D__CONFIG_MODVERSIONS__ +# This has to be compiled with frame pointers regardless of how the rest of the +# kernel is built. +CFLAGS_frame.o := -fno-omit-frame-pointer + CFLAGS_user_syms.o = -D__AUTOCONF_INCLUDED__ $(DMODULES-y) $(DMODVERSIONS-y) \ -I/usr/include -I../include -# This has to be separate because it needs be compiled with frame pointers -# regardless of how the rest of the kernel is built. - -#$(obj)/frame.o: $(src)/frame.c -# $(CC) $(CFLAGS_$(notdir $@)) -c -o $@ $< -CFLAGS_frame.o := -fno-omit-frame-pointer - QUOTE = 'my $$config=`cat $(TOPDIR)/.config`; $$config =~ s/"/\\"/g ; $$config =~ s/\n/\\n"\n"/g ; while() { $$_ =~ s/CONFIG/$$config/; print $$_ }' -$(obj)/config.c : $(src)/config.c.in $(TOPDIR)/.config - $(PERL) -e $(QUOTE) < $(src)/config.c.in > $@ - -modules: - -fastdep: - -dep: - -archmrproper: clean +quiet_cmd_quote = QUOTE $@ + cmd_quote = $(PERL) -e $(QUOTE) < $< > $@ +targets += config.c +$(obj)/config.c : $(src)/config.c.in $(TOPDIR)/.config FORCE + $(call if_changed,quote) --- ./arch/um/os-Linux/Makefile.kbuild_clean 2003-12-28 12:51:48.000000000 +0100 +++ ./arch/um/os-Linux/Makefile 2003-12-30 16:44:42.000000000 +0100 @@ -6,7 +6,3 @@ obj-y = file.o process.o tty.o drivers/ UML_USER_OBJS += file.o process.o tty.o - -clean : - -archmrproper: --- ./arch/um/sys-i386/util/Makefile.kbuild_clean 2003-12-20 17:47:17.000000000 +0100 +++ ./arch/um/sys-i386/util/Makefile 2003-12-30 16:44:42.000000000 +0100 @@ -10,8 +10,3 @@ $(obj)/mk_thread_user.o : $(src)/mk_thread_user.c $(CC) $(USER_CFLAGS) -c -o $@ $< - -clean : - $(RM) -f $(build-targets) - -archmrproper : clean --- ./arch/um/sys-i386/Makefile.kbuild_clean 2003-12-28 12:51:48.000000000 +0100 +++ ./arch/um/sys-i386/Makefile 2003-12-30 17:31:22.000000000 +0100 @@ -24,17 +24,3 @@ $(call make_link,$@) subdir- := util - -fastdep: - -dep: - -archmrproper: - rm -f $(SYMLINKS) - -archclean: - -archdep: - -modules: - --- ./arch/um/sys-ia64/Makefile.kbuild_clean 2003-12-20 17:18:46.000000000 +0100 +++ ./arch/um/sys-ia64/Makefile 2003-12-30 16:44:42.000000000 +0100 @@ -7,18 +7,5 @@ $(OBJ): $(OBJS) rm -f $@ $(LD) $(LINKFLAGS) --start-group $^ --end-group -o $@ -clean: - rm -f $(OBJS) -fastdep: - -archmrproper: - -archclean: - rm -f link.ld - @$(MAKEBOOT) clean - -archdep: - @$(MAKEBOOT) dep - -modules: +clean-files := $(OBJS) link.ld --- ./arch/um/sys-ppc/Makefile.kbuild_clean 2003-12-20 17:56:43.000000000 +0100 +++ ./arch/um/sys-ppc/Makefile 2003-12-30 16:44:42.000000000 +0100 @@ -66,13 +66,4 @@ $(CC) $(EXTRA_AFLAGS) $(AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o rm -f asm -clean: - rm -f $(OBJS) - rm -f ppc_defs.h - rm -f checksum.S semaphore.c mk_defs.c - -fastdep: - -dep: - -modules: +clean-files := $(OBJS) ppc_defs.h checksum.S semaphore.c mk_defs.c --- ./arch/um/util/Makefile.kbuild_clean 2003-12-20 17:47:17.000000000 +0100 +++ ./arch/um/util/Makefile 2003-12-30 16:44:42.000000000 +0100 @@ -16,8 +16,3 @@ $(obj)/mk_constants_kern.o : $(src)/mk_constants_kern.c $(CC) $(CFLAGS) -c $< -o $@ - -clean: - $(RM) $(build-targets) - -archmrproper: --- ./arch/um/Makefile.kbuild_clean 2003-12-28 12:51:48.000000000 +0100 +++ ./arch/um/Makefile 2003-12-30 17:53:54.000000000 +0100 @@ -28,10 +28,6 @@ GEN_HEADERS += $(ARCH_DIR)/include/task.h $(ARCH_DIR)/include/kern_constants.h -.PHONY: sys_prepare -sys_prepare: - @: - MAKEFILE-$(CONFIG_MODE_TT) += Makefile-tt MAKEFILE-$(CONFIG_MODE_SKAS) += Makefile-skas @@ -142,28 +138,28 @@ $(ARCH_DIR)/dyn_link.ld.s $(ARCH_DIR)/include/uml-config.h \ $(GEN_HEADERS) -$(ARCH_DIR)/main.o: $(ARCH_DIR)/main.c sys_prepare +MRPROPER_FILES += $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) \ + $(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS)) + +$(ARCH_DIR)/main.o: $(ARCH_DIR)/main.c FORCE $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< archmrproper: - for d in $(ARCH_SUBDIRS) $(ARCH_DIR)/util; \ + $(Q)for d in $(ARCH_SUBDIRS) $(ARCH_DIR)/util; \ do \ $(MAKE) -C $$d archmrproper; \ done - rm -f $(CLEAN_FILES) $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) include/asm \ - $(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS)) +# rm -f $(CLEAN_FILES) $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) include/asm \ +# $(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS)) archclean: sysclean - for d in $(ARCH_SUBDIRS) $(ARCH_DIR)/util; \ - do \ - $(MAKE) -C $$d clean; \ - done - find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \ +# $(Q)for d in $(ARCH_SUBDIRS) $(ARCH_DIR)/util; \ +# do \ +# $(MAKE) $(clean)=$$d; \ +# done + @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \ -o -name '*.gcov' \) -type f -print | xargs rm -f - rm -f linux x.i gmon.out $(ARCH_DIR)/link.ld $(GEN_HEADERS) - -archdep: - for d in $(ARCH_SUBDIRS); do $(MAKE) -C $$d fastdep; done +# rm -f $(CLEAN_FILES) $(SYMLINK_HEADERS): cd $(TOPDIR)/$(dir $@) ; \ @@ -178,23 +174,30 @@ $(ARCH_DIR)/os: cd $(ARCH_DIR) && ln -sf os-$(OS) os -$(ARCH_DIR)/include/uml-config.h : $(TOPDIR)/include/linux/autoconf.h - sed 's/ CONFIG/ UML_CONFIG/' $(TOPDIR)/include/linux/autoconf.h > $@ +#Generated files +define filechk_umlconfig + sed 's/ CONFIG/ UML_CONFIG/' +endef filechk_$(ARCH_DIR)/include/task.h := $(ARCH_DIR)/util/mk_task -$(ARCH_DIR)/include/task.h : $(ARCH_DIR)/util/mk_task - $(call filechk,$@) - filechk_$(ARCH_DIR)/include/kern_constants.h := $(ARCH_DIR)/util/mk_constants +filechk_gen_header = $< + +$(ARCH_DIR)/include/uml-config.h : $(TOPDIR)/include/linux/autoconf.h + $(call filechk,umlconfig) + +$(ARCH_DIR)/include/task.h : $(ARCH_DIR)/util/mk_task + $(call filechk,gen_header) + $(ARCH_DIR)/include/kern_constants.h : $(ARCH_DIR)/util/mk_constants - $(call filechk,$@) + $(call filechk,gen_header) $(ARCH_DIR)/util/mk_task $(ARCH_DIR)/util/mk_constants : $(ARCH_DIR)/util \ - sys_prepare FORCE ; + FORCE ; $(ARCH_DIR)/util: FORCE - $(MAKE) -f scripts/Makefile.build obj=$@ + $(Q)$(MAKE) $(build)=$@ export SUBARCH USER_CFLAGS OS --- ./arch/um/Makefile-i386.kbuild_clean 2003-12-28 12:51:48.000000000 +0100 +++ ./arch/um/Makefile-i386 2003-12-30 16:44:42.000000000 +0100 @@ -31,13 +31,12 @@ $(call filechk,$@) $(SYS_UTIL_DIR)/mk_sc: scripts/fixdep include/config/MARKER FORCE ; - +@$(call descend,$(SYS_UTIL_DIR),$@) + $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) $@ $(SYS_UTIL_DIR)/mk_thread: $(ARCH_SYMLINKS) $(GEN_HEADERS) sys_prepare FORCE ; - +@$(call descend,$(SYS_UTIL_DIR),$@) + $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) $@ $(SYS_UTIL_DIR): include/asm FORCE - +@$(call descend,$@,) + $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) -sysclean : - rm -f $(SYS_HEADERS) +CLEAN_FILES += $(SYS_HEADERS) --- ./arch/um/Makefile-skas.kbuild_clean 2003-12-28 12:51:48.000000000 +0100 +++ ./arch/um/Makefile-skas 2003-12-30 16:25:55.000000000 +0100 @@ -17,4 +17,4 @@ GEN_HEADERS += $(TOPDIR)/$(ARCH_DIR)/include/skas_ptregs.h $(TOPDIR)/$(ARCH_DIR)/include/skas_ptregs.h : - $(call descend,$(ARCH_DIR)/kernel/skas,$@) + $(Q)$(MAKE) $(build)=$(ARCH_DIR)/kernel/skas $@ --- ./fs/hostfs/Makefile.kbuild_clean 2003-12-28 12:51:49.000000000 +0100 +++ ./fs/hostfs/Makefile 2003-12-30 16:25:55.000000000 +0100 @@ -19,13 +19,3 @@ UML_USER_OBJS := hostfs_user.o CFLAGS_hostfs_user.o += -DSTAT64_INO_FIELD=$(STAT64_INO_FIELD) - -clean: - -modules: - -fastdep: - -dep: - -archmrproper: clean