fix for "make O=..."
Subsystems (2)
PATCH 1/1 fix for "make O=..."
Hi,
uml needs the patch below to build with separated source and object trees.
Gerd
------------------------------------------------------------------
arch/um/Makefile +3 -3
@@ -42,11 +42,11 @@ MAKEFILE-$(CONFIG_MODE_SKAS) += Makefile-skas ifneq ($(MAKEFILE-y),) - include $(addprefix $(ARCH_DIR)/,$(MAKEFILE-y)) + include $(addprefix $(srctree)/$(ARCH_DIR)/,$(MAKEFILE-y)) endif -include $(ARCH_DIR)/Makefile-$(SUBARCH) -include $(ARCH_DIR)/Makefile-os-$(OS) +include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH) +include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) #EXTRAVERSION := $(EXTRAVERSION)-1um
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Alle 20:38, lunedì 29 marzo 2004, Gerd Knorr ha scritto:
Quoted 4 lines
Hi,
uml needs the patch below to build with separated source and object trees.
That is needed; but I think that still O=... won't work properly - I expect comments on this.
By "work properly" I mean not only to produce a correct binary (probably this works) but also to avoid writing any file in the source tree. I tried to achieve this some time ago but I had a lot of problem with generated headers. Actually I had to add -I$(srctree)/arch/um/include and -I$(objtree)/arch/um/include, but Kbuild thinks I am silly and adds by itself, in both cases, the $(srctree) part, and some other Makefiles rely on this, so changing it is hard. I didn't think to make it understand that a full path must not be corrected (which would probably work).
Also, there were heavy changes to do to the include files location. I'm attaching the patch I built at that time (i.e. 2.6.0 + my MODVERSION patch which changes a lot of Makefiles..., so it won't apply directly). With the above fix you could make it work, maybe.
Bye
Signature · 2 lines
Paolo Giarrusso, aka Blaisorblade Linux registered user n. 292729
arch/um/include/sysdep-i386/sigcontext.h renamed from arch/um/include/sysdep-i386/sigcontext.h.fix +1 -1
@@ -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 renamed from arch/um/kernel/skas/Makefile.fix +1 -1
@@ -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 renamed from arch/um/kernel/Makefile.fix +2 -2
@@ -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(<STDIN>) { $$_ =~ s/CONFIG/$$config/; print $$_ }' +QUOTE = 'my $$config=`cat $(objtree)/.config`; $$config =~ s/"/\\"/g ; $$config =~ s/\n/\\n"\n"/g ; while(<STDIN>) { $$_ =~ 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 renamed from arch/um/util/Makefile.fix +12 -1
@@ -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 renamed from arch/um/Makefile.fix +28 -18
106 lines not on this page · raw message
arch/um/Makefile-skas renamed from arch/um/Makefile-skas.fix +3 -3
@@ -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 renamed from arch/um/Makefile-i386.fix +1 -3
@@ -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 renamed from arch/um/Makefile-tt.fix +1 -1
@@ -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 renamed from scripts/Makefile.lib.fix +4 -0
@@ -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))