arch/powerpc/boot/addRamDisk.c: Mark several internal functions static
[safe/jmp/linux-2.6] / arch / um / Makefile
index 88c5b0a..fc633db 100644 (file)
@@ -18,28 +18,17 @@ core-y                      += $(ARCH_DIR)/kernel/          \
                           $(ARCH_DIR)/drivers/         \
                           $(ARCH_DIR)/os-$(OS)/
 
-# Have to precede the include because the included Makefiles reference them.
-SYMLINK_HEADERS := archparam.h system.h sigcontext.h processor.h ptrace.h \
-       module.h vm-flags.h elf.h host_ldt.h
-SYMLINK_HEADERS := $(foreach header,$(SYMLINK_HEADERS),include/asm-um/$(header))
-
-# XXX: The "os" symlink is only used by arch/um/include/os.h, which includes
-# ../os/include/file.h
-#
-# These are cleaned up during mrproper. Please DO NOT fix it again, this is
-# the Correct Thing(tm) to do!
-ARCH_SYMLINKS = include/asm-um/arch $(ARCH_DIR)/include/shared/sysdep $(ARCH_DIR)/os \
-       $(SYMLINK_HEADERS) $(ARCH_DIR)/include/shared/uml-config.h
-
 MODE_INCLUDE   += -I$(srctree)/$(ARCH_DIR)/include/shared/skas
 
 include $(srctree)/$(ARCH_DIR)/Makefile-skas
 
-ARCH_INCLUDE   := -I$(ARCH_DIR)/include/shared
+SHARED_HEADERS := $(ARCH_DIR)/include/shared
+ARCH_INCLUDE   := -I$(srctree)/$(SHARED_HEADERS)
+ARCH_INCLUDE   += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH)/shared
 ifneq ($(KBUILD_SRC),)
-ARCH_INCLUDE   += -I$(srctree)/$(ARCH_DIR)/include/shared
+ARCH_INCLUDE   += -I$(SHARED_HEADERS)
 endif
-SYS_DIR                := $(ARCH_DIR)/include/shared/sysdep-$(SUBARCH)
+KBUILD_CPPFLAGS += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH)
 
 # -Dvmap=kernel_vmap prevents anything from referencing the libpcap.o symbol so
 # named - it's a common symbol in libpcap, so we get a binary which crashes.
@@ -65,6 +54,8 @@ include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
 #This will adjust *FLAGS accordingly to the platform.
 include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
 
+KBUILD_CPPFLAGS += -I$(srctree)/arch/$(HEADER_ARCH)/include
+
 # -Derrno=kernel_errno - This turns all kernel references to errno into
 # kernel_errno to separate them from the libc errno.  This allows -fno-common
 # in KBUILD_CFLAGS.  Otherwise, it would cause ld to complain about the two different
@@ -93,14 +84,10 @@ define archhelp
   echo '                  find in the kernel root.'
 endef
 
-ifneq ($(KBUILD_SRC),)
-$(shell mkdir -p $(ARCH_DIR) && ln -fsn $(srctree)/$(ARCH_DIR)/Kconfig.$(SUBARCH) $(ARCH_DIR)/Kconfig.arch)
-else
-$(shell ln -fsn Kconfig.$(SUBARCH) $(ARCH_DIR)/Kconfig.arch)
-endif
+KBUILD_KCONFIG := arch/um/Kconfig.$(HEADER_ARCH)
 
-archprepare: $(ARCH_SYMLINKS) $(ARCH_DIR)/include/shared/user_constants.h
-prepare: $(ARCH_DIR)/include/shared/kern_constants.h
+archprepare: $(SHARED_HEADERS)/user_constants.h
+archprepare: $(SHARED_HEADERS)/kern_constants.h
 
 LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
 LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib
@@ -109,11 +96,10 @@ CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,)
        $(call cc-option, -fno-stack-protector,) \
        $(call cc-option, -fno-stack-protector-all,)
 
-CONFIG_KERNEL_STACK_ORDER ?= 2
-STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] )
-
-CPPFLAGS_vmlinux.lds = -U$(SUBARCH) -DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \
-       -DELF_FORMAT="$(ELF_FORMAT)" -DKERNEL_STACK_SIZE=$(STACK_SIZE)
+# Options used by linker script
+export LDS_START      := $(START)
+export LDS_ELF_ARCH   := $(ELF_ARCH)
+export LDS_ELF_FORMAT := $(ELF_FORMAT)
 
 # The wrappers will select whether using "malloc" or the kernel allocator.
 LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
@@ -132,61 +118,15 @@ endef
 
 # When cleaning we don't include .config, so we don't include
 # TT or skas makefiles and don't clean skas_ptregs.h.
-CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/include/shared/uml-config.h \
-       $(ARCH_DIR)/include/shared/user_constants.h \
-       $(ARCH_DIR)/include/shared/kern_constants.h $(ARCH_DIR)/Kconfig.arch
-
-MRPROPER_FILES += $(ARCH_SYMLINKS)
+CLEAN_FILES += linux x.i gmon.out \
+       $(SHARED_HEADERS)/user_constants.h \
+       $(SHARED_HEADERS)/kern_constants.h
 
 archclean:
        @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
                -o -name '*.gcov' \) -type f -print | xargs rm -f
 
-$(SYMLINK_HEADERS):
-       @echo '  SYMLINK $@'
-ifneq ($(KBUILD_SRC),)
-       $(Q)mkdir -p $(objtree)/include/asm-um
-       $(Q)ln -fsn $(srctree)/include/asm-um/$(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $@
-else
-       $(Q)ln -sf $(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $@
-endif
-
-include/asm-um/arch:
-       @echo '  SYMLINK $@'
-ifneq ($(KBUILD_SRC),)
-       $(Q)mkdir -p $(objtree)/include/asm-um
-       $(Q)ln -fsn $(srctree)/include/asm-$(HEADER_ARCH) $@
-else
-       $(Q)ln -fsn ../asm-$(HEADER_ARCH) $@
-endif
-
-$(objtree)/$(ARCH_DIR)/include/shared:
-       @echo '  MKDIR $@'
-       $(Q)mkdir -p $@
-
-$(ARCH_DIR)/include/shared/sysdep: $(objtree)/$(ARCH_DIR)/include/shared
-       @echo '  SYMLINK $@'
-ifneq ($(KBUILD_SRC),)
-       $(Q)ln -fsn $(srctree)/$(ARCH_DIR)/include/shared/sysdep-$(SUBARCH) $@
-else
-       $(Q)ln -fsn sysdep-$(SUBARCH) $@
-endif
-
-$(ARCH_DIR)/os:
-       @echo '  SYMLINK $@'
-ifneq ($(KBUILD_SRC),)
-       $(Q)ln -fsn $(srctree)/$(ARCH_DIR)/os-$(OS) $@
-else
-       $(Q)ln -fsn os-$(OS) $@
-endif
-
 # Generated files
-define filechk_umlconfig
-       sed 's/ CONFIG/ UML_CONFIG/'
-endef
-
-$(ARCH_DIR)/include/shared/uml-config.h : include/linux/autoconf.h
-       $(call filechk,umlconfig)
 
 $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s: FORCE
        $(Q)$(MAKE) $(build)=$(ARCH_DIR)/sys-$(SUBARCH) $@
@@ -204,11 +144,11 @@ define filechk_gen-asm-offsets
          echo ""; )
 endef
 
-$(ARCH_DIR)/include/shared/user_constants.h: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s
+$(SHARED_HEADERS)/user_constants.h: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s
        $(call filechk,gen-asm-offsets)
 
-$(ARCH_DIR)/include/shared/kern_constants.h: $(objtree)/$(ARCH_DIR)/include/shared
-       @echo '  SYMLINK $@'
-       $(Q)ln -sf ../../../../include/asm-um/asm-offsets.h $@
+$(SHARED_HEADERS)/kern_constants.h:
+       $(Q)mkdir -p $(dir $@)
+       $(Q)echo '#include "../../../../include/asm/asm-offsets.h"' >$@
 
-export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH
+export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH DEV_NULL_PATH