--- ./arch/um/include/sysdep-i386/sigcontext.h.fix 2004-02-05 16:45:10.000000000 +0100 +++ ./arch/um/include/sysdep-i386/sigcontext.h 2004-02-08 17:11:13.000000000 +0100 @@ -6,7 +6,7 @@ #ifndef __SYS_SIGCONTEXT_I386_H #define __SYS_SIGCONTEXT_I386_H -#include "sc.h" +#include "sysdep/sc.h" #define IP_RESTART_SYSCALL(ip) ((ip) -= 2) --- ./arch/um/kernel/skas/Makefile.fix 2004-02-06 20:02:43.000000000 +0100 +++ ./arch/um/kernel/skas/Makefile 2004-02-08 17:07:57.000000000 +0100 @@ -27,5 +27,5 @@ endef filechk_gen_header = $< -$(TOPDIR)/arch/um/include/skas_ptregs.h : $(src)/util/mk_ptregs +$(objtree)/include/skas_ptregs.h : $(src)/util/mk_ptregs $(call filechk,gen_header) --- ./arch/um/kernel/Makefile.fix 2004-02-06 20:02:43.000000000 +0100 +++ ./arch/um/kernel/Makefile 2004-02-08 17:09:36.000000000 +0100 @@ -35,11 +35,11 @@ CFLAGS_user_syms.o = -D__AUTOCONF_INCLUDED__ $(DMODULES-y) $(DMODVERSIONS-y) \ -I/usr/include -I../include -QUOTE = 'my $$config=`cat $(TOPDIR)/.config`; $$config =~ s/"/\\"/g ; $$config =~ s/\n/\\n"\n"/g ; while() { $$_ =~ s/CONFIG/$$config/; print $$_ }' +QUOTE = 'my $$config=`cat $(objtree)/.config`; $$config =~ s/"/\\"/g ; $$config =~ s/\n/\\n"\n"/g ; while() { $$_ =~ s/CONFIG/$$config/; print $$_ }' quiet_cmd_quote = QUOTE $@ cmd_quote = $(PERL) -e $(QUOTE) < $< > $@ targets += config.c -$(obj)/config.c : $(src)/config.c.in $(TOPDIR)/.config FORCE +$(obj)/config.c : $(src)/config.c.in $(objtree)/.config FORCE $(call if_changed,quote) --- ./arch/um/util/Makefile.fix 2004-02-06 20:02:43.000000000 +0100 +++ ./arch/um/util/Makefile 2004-02-08 17:05:20.000000000 +0100 @@ -14,5 +14,16 @@ $(obj)/mk_constants_user.o : $(src)/mk_constants_user.c $(HOSTCC) -c $< -o $@ +# Normally this pass (in short s/-I/-I$(srctree)) is done by +# scripts/Makefile.lib; here we must do it ourselves. + +ifeq ($(KBUILD_SRC),) +_CFLAGS = $(CFLAGS) +else +flags = $(foreach o,$($(1)),\ + $(if $(filter -I%,$(o)),$(patsubst -I%,-I$(srctree)/%,$(o)),$(o))) +_CFLAGS = $(call flags,CFLAGS) -I$(objtree)/include -I$(objtree)/include2 +endif + $(obj)/mk_constants_kern.o : $(src)/mk_constants_kern.c - $(HOSTCC) $(CFLAGS) -c $< -o $@ + $(HOSTCC) $(_CFLAGS) -c $< -o $@ --- ./arch/um/Makefile.fix 2004-02-06 20:02:43.000000000 +0100 +++ ./arch/um/Makefile 2004-02-08 17:18:12.000000000 +0100 @@ -23,10 +23,11 @@ include/asm-um/ptrace.h include/asm-um/arch-signal.h \ include/asm-um/module.h -ARCH_SYMLINKS = include/asm-um/arch $(ARCH_DIR)/include/sysdep $(ARCH_DIR)/os \ - $(SYMLINK_HEADERS) $(ARCH_DIR)/include/uml-config.h +ARCH_SYMLINKS = include/asm-um/arch include/sysdep \ + $(objtree)/include2/sysdep $(ARCH_DIR)/os $(SYMLINK_HEADERS) \ + include/uml-config.h -GEN_HEADERS += $(ARCH_DIR)/include/task.h $(ARCH_DIR)/include/kern_constants.h +GEN_HEADERS += include/task.h include/kern_constants.h # This target adds dependencies to "prepare". They are defined in the included # Makefiles (see Makefile-i386). @@ -38,15 +39,16 @@ MAKEFILE-$(CONFIG_MODE_SKAS) += Makefile-skas ifneq ($(MAKEFILE-y),) - include $(addprefix $(ARCH_DIR)/,$(MAKEFILE-y)) + include $(addprefix $(src)/$(ARCH_DIR)/,$(MAKEFILE-y)) endif -include $(ARCH_DIR)/Makefile-$(SUBARCH) -include $(ARCH_DIR)/Makefile-os-$(OS) +include $(src)/$(ARCH_DIR)/Makefile-$(SUBARCH) +include $(src)/$(ARCH_DIR)/Makefile-os-$(OS) EXTRAVERSION := $(EXTRAVERSION)-1um ARCH_INCLUDE = -I$(ARCH_DIR)/include +#+ $(if $(KBUILD_SRC),-I$(ARCH_DIR)/include2) # -Derrno=kernel_errno - This turns all kernel references to errno into # kernel_errno to separate them from the libc errno. This allows -fno-common @@ -68,7 +70,7 @@ SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000) ifeq ($(CONFIG_MODE_SKAS), y) -$(SYS_HEADERS) : $(TOPDIR)/$(ARCH_DIR)/include/skas_ptregs.h +$(SYS_HEADERS) : $(objtree)/include/skas_ptregs.h endif include/linux/version.h: arch/$(ARCH)/Makefile @@ -76,7 +78,11 @@ $(ARCH_DIR)/vmlinux.lds.S : touch $@ -prepare: $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS) +.PHONY: mksysdep +mksysdep: + mkdir -p $(objtree)/include/sysdep-$(SUBARCH) + +prepare: mksysdep $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS) LDFLAGS_vmlinux = -r @@ -152,7 +158,7 @@ USER_CFLAGS += -D_GNU_SOURCE CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/uml.lds.s \ - $(ARCH_DIR)/dyn_link.ld.s $(ARCH_DIR)/include/uml-config.h \ + $(ARCH_DIR)/dyn_link.ld.s include/uml-config.h \ $(GEN_HEADERS) MRPROPER_FILES += $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) \ @@ -184,32 +190,36 @@ ln -sf $(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $(notdir $@) include/asm-um/arch: - cd $(TOPDIR)/include/asm-um && ln -sf ../asm-$(SUBARCH) arch + cd $(objtree)/include/asm-um && ln -sf ../asm-$(SUBARCH) arch + +include/sysdep: + cd include && ln -sf sysdep-$(SUBARCH) sysdep -$(ARCH_DIR)/include/sysdep: - cd $(ARCH_DIR)/include && ln -sf sysdep-$(SUBARCH) sysdep +$(objtree)/include2/sysdep: + ln -sf $(srctree)/$(ARCH_DIR)/include/sysdep-$(SUBARCH) \ + $(objtree)/include2/sysdep $(ARCH_DIR)/os: - cd $(ARCH_DIR) && ln -sf os-$(OS) os + ln -sf $(srctree)/$(ARCH_DIR)/os-$(OS) $(objtree)/$(ARCH_DIR)/os #Generated files define filechk_umlconfig sed 's/ CONFIG/ UML_CONFIG/' endef -filechk_$(ARCH_DIR)/include/task.h := $(ARCH_DIR)/util/mk_task +filechk_include/task.h := $(ARCH_DIR)/util/mk_task -filechk_$(ARCH_DIR)/include/kern_constants.h := $(ARCH_DIR)/util/mk_constants +filechk_include/kern_constants.h := $(ARCH_DIR)/util/mk_constants filechk_gen_header = $< -$(ARCH_DIR)/include/uml-config.h : $(TOPDIR)/include/linux/autoconf.h +include/uml-config.h : $(objtree)/include/linux/autoconf.h $(call filechk,umlconfig) -$(ARCH_DIR)/include/task.h : $(ARCH_DIR)/util/mk_task +include/task.h : $(ARCH_DIR)/util/mk_task $(call filechk,gen_header) -$(ARCH_DIR)/include/kern_constants.h : $(ARCH_DIR)/util/mk_constants +include/kern_constants.h : $(ARCH_DIR)/util/mk_constants $(call filechk,gen_header) $(ARCH_DIR)/util/mk_task $(ARCH_DIR)/util/mk_constants : $(ARCH_DIR)/util \ --- ./arch/um/Makefile-skas.fix 2004-02-06 20:02:43.000000000 +0100 +++ ./arch/um/Makefile-skas 2004-02-08 17:08:00.000000000 +0100 @@ -9,12 +9,12 @@ CFLAGS-$(CONFIG_GPROF) += $(PROFILE) LINK-$(CONFIG_GPROF) += $(PROFILE) -MODE_INCLUDE += -I$(TOPDIR)/$(ARCH_DIR)/kernel/skas/include +MODE_INCLUDE += -I$(ARCH_DIR)/kernel/skas/include LINK_SKAS = -Wl,-rpath,/lib LD_SCRIPT_SKAS = dyn.lds.s -GEN_HEADERS += $(TOPDIR)/$(ARCH_DIR)/include/skas_ptregs.h +GEN_HEADERS += $(objtree)/include/skas_ptregs.h -$(TOPDIR)/$(ARCH_DIR)/include/skas_ptregs.h : +$(objtree)/include/skas_ptregs.h : $(Q)$(MAKE) $(build)=$(ARCH_DIR)/kernel/skas $@ --- ./arch/um/Makefile-i386.fix 2004-02-06 20:02:43.000000000 +0100 +++ ./arch/um/Makefile-i386 2004-02-08 16:52:47.000000000 +0100 @@ -11,15 +11,13 @@ OBJCOPYFLAGS := -O binary -R .note -R .comment -S LDFLAGS_BLOB := --format binary --oformat elf32-i386 -SYS_DIR := $(ARCH_DIR)/include/sysdep-i386 +SYS_DIR := include/sysdep-i386 SYS_UTIL_DIR := $(ARCH_DIR)/sys-i386/util SYS_HEADERS = $(SYS_DIR)/sc.h $(SYS_DIR)/thread.h sys_prepare: $(SYS_DIR)/sc.h -prepare: $(SYS_HEADERS) - filechk_$(SYS_DIR)/sc.h := $(SYS_UTIL_DIR)/mk_sc $(SYS_DIR)/sc.h: $(SYS_UTIL_DIR)/mk_sc --- ./arch/um/Makefile-tt.fix 2003-12-20 17:40:55.000000000 +0100 +++ ./arch/um/Makefile-tt 2004-02-08 16:45:24.000000000 +0100 @@ -3,5 +3,5 @@ # Licensed under the GPL # -MODE_INCLUDE += -I$(TOPDIR)/$(ARCH_DIR)/kernel/tt/include +MODE_INCLUDE += -I$(ARCH_DIR)/kernel/tt/include --- ./scripts/Makefile.lib.fix 2004-02-06 20:02:43.000000000 +0100 +++ ./scripts/Makefile.lib 2004-02-08 17:19:20.000000000 +0100 @@ -186,7 +186,11 @@ #We must strip the NOSTDINC and -D__KERNEL__ (else we mess up /usr/include/asm/*) #and can strip the -DKBUILD... stuff and the -DMODULE, as we don't include #linux headers. +ifeq ($(KBUILD_SRC),) __umUser_c_flags = -Wp,-MD,$(depfile) $(__c_flags) +else +__umUser_c_flags = -Wp,-MD,$(depfile) $(__c_flags) -Iinclude -Iinclude2 +endif c_flags = $(if $(is_user_obj), $(__umUser_c_flags), $(__kernel_c_flags))