Commit 66f1fd2f authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Remove HPATH, general cleanup

HPATH won't work with separate obj/src dirs, since it doesn't specify
if we want to look at source or generated files. Fortunately, most uses
in arch/*/Makefile were superfluous anyway, the others were converted to
explicitly $(srctree) or $(objtree).

Additionally, a bit more of srctree / objtree related cleanup.
parent c341552d
......@@ -43,9 +43,6 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else echo sh; fi ; fi)
TOPDIR := $(CURDIR)
HPATH = $(TOPDIR)/include
FINDHPATH = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net
HOSTCC = gcc
HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
......@@ -151,7 +148,7 @@ EXPORT_FLAGS =
NOSTDINC_FLAGS = -nostdinc -iwithprefix include
export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
CONFIG_SHELL TOPDIR HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
CONFIG_SHELL TOPDIR HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
CPP AR NM STRIP OBJCOPY OBJDUMP MAKE MAKEFILES GENKSYMS PERL
export CPPFLAGS EXPORT_FLAGS NOSTDINC_FLAGS OBJCOPYFLAGS
......@@ -233,7 +230,7 @@ export MODLIB
# standard CFLAGS
#
CPPFLAGS := -D__KERNEL__ -I$(HPATH)
CPPFLAGS := -D__KERNEL__ -I$(objtree)/include
CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
-fomit-frame-pointer -fno-strict-aliasing -fno-common
......@@ -434,7 +431,7 @@ ifdef CONFIG_MODULES
# Build modules
ifdef CONFIG_MODVERSIONS
MODFLAGS += -include $(HPATH)/linux/modversions.h
MODFLAGS += -include $(objtree)/include/linux/modversions.h
endif
.PHONY: modules
......@@ -571,28 +568,28 @@ xconfig:
menuconfig:
@$(MAKE) -C scripts lxdialog
$(CONFIG_SHELL) scripts/Menuconfig arch/$(ARCH)/config.in
$(CONFIG_SHELL) $(src)/scripts/Menuconfig arch/$(ARCH)/config.in
config:
$(CONFIG_SHELL) scripts/Configure arch/$(ARCH)/config.in
$(CONFIG_SHELL) $(src)/scripts/Configure arch/$(ARCH)/config.in
oldconfig:
$(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in
$(CONFIG_SHELL) $(src)/scripts/Configure -d arch/$(ARCH)/config.in
randconfig:
$(CONFIG_SHELL) scripts/Configure -r arch/$(ARCH)/config.in
$(CONFIG_SHELL) $(src)/scripts/Configure -r arch/$(ARCH)/config.in
allyesconfig:
$(CONFIG_SHELL) scripts/Configure -y arch/$(ARCH)/config.in
$(CONFIG_SHELL) $(src)/scripts/Configure -y arch/$(ARCH)/config.in
allnoconfig:
$(CONFIG_SHELL) scripts/Configure -n arch/$(ARCH)/config.in
$(CONFIG_SHELL) $(src)/scripts/Configure -n arch/$(ARCH)/config.in
allmodconfig:
$(CONFIG_SHELL) scripts/Configure -m arch/$(ARCH)/config.in
$(CONFIG_SHELL) $(src)/scripts/Configure -m arch/$(ARCH)/config.in
defconfig:
yes '' | $(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in
yes '' | $(CONFIG_SHELL) $(src)/scripts/Configure -d arch/$(ARCH)/config.in
# Cleaning up
# ---------------------------------------------------------------------------
......
......@@ -81,7 +81,7 @@ tools/bootph: bootpheader $(OBJSTRIP)
$(OBJSTRIP) -vb bootpheader tools/bootph
$(OBJSTRIP): $(OBJSTRIP).c
$(HOSTCC) $(HOSTCFLAGS) -I$(HPATH) $(OBJSTRIP).c -o $(OBJSTRIP)
$(HOSTCC) $(HOSTCFLAGS) $< -o $@
tools/mkbb: tools/mkbb.c
$(HOSTCC) tools/mkbb.c -o tools/mkbb
......
......@@ -97,8 +97,7 @@ MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
vmlinux: arch/$(ARCH)/vmlinux.lds
arch/$(ARCH)/vmlinux.lds: arch/$(ARCH)/vmlinux.lds.S FORCE
$(CPP) -D__ASSEMBLY__ -C -P -I$(HPATH) -I$(HPATH)/asm-$(ARCH) \
-traditional arch/$(ARCH)/vmlinux.lds.S > $@
$(CPP) $(AFLAGS) -C -P -traditional $< > $@
compressed: vmlinux
$(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux-tmp
......
......@@ -7,7 +7,6 @@
#
TOPDIR=../../../..
HPATH = $(TOPDIR)/include
LIB = ../../lib/lib.a
......
......@@ -12,7 +12,6 @@
#
# Select the object file format to substitute into the linker script.
#
CPP=$(CC) -E
ifdef CONFIG_CPU_LITTLE_ENDIAN
tool-prefix = mips64el-linux-
else
......@@ -150,7 +149,7 @@ endif
vmlinux: arch/mips64/ld.script.elf32
arch/mips64/ld.script.elf32: arch/mips64/ld.script.elf32.S
$(CPP) -C -P -I$(HPATH) -imacros $(HPATH)/asm-mips64/sn/mapped_kernel.h -Umips arch/mips64/ld.script.elf32.S > arch/mips64/ld.script.elf32
$(CPP) $(CPPFLAGS) -C -P -imacros $(srctree)/include/asm-mips64/sn/mapped_kernel.h -Umips $< > $@
ifdef CONFIG_MAPPED_KERNEL
vmlinux.64: vmlinux
......
......@@ -24,7 +24,7 @@ CROSS32_COMPILE =
#CROSS32_COMPILE = /usr/local/ppc/bin/powerpc-linux-
BOOTCC = $(CROSS32_COMPILE)gcc
BOOTCFLAGS = $(HOSTCFLAGS) -I$(HPATH)
BOOTCFLAGS = $(HOSTCFLAGS) -I$(objtree)/include
BOOTLD = $(CROSS32_COMPILE)ld
BOOTAS = $(CROSS32_COMPILE)as
BOOTAFLAGS = -D__ASSEMBLY__ $(HOSTCFLAGS)
......
......@@ -73,7 +73,7 @@ endif
vmlinux: arch/sh/vmlinux.lds
arch/sh/vmlinux.lds: arch/sh/vmlinux.lds.S FORCE
$(CPP) -traditional -C -P -I$(HPATH) -Ush arch/sh/vmlinux.lds.S >arch/sh/vmlinux.lds
$(CPP) $(CPPFLAGS) -traditional -C -P -Ush $< > $@
FORCE: ;
......
......@@ -30,6 +30,8 @@ endif
include $(TOPDIR)/Rules.make
HPATH := $(objtree)/include
check_asm: FORCE
@if [ ! -r $(HPATH)/asm/asm_offsets.h ] ; then \
touch $(HPATH)/asm/asm_offsets.h ; \
......
......@@ -25,9 +25,9 @@
# early bootup linking needs 32bit. You can either use real 32bit tools
# here or 64bit tools in 32bit mode.
#
IA32_CC := $(CROSS_COMPILE)gcc -m32 -O2 -fomit-frame-pointer -nostdinc -I $(HPATH)
IA32_LD := $(CROSS_COMPILE)ld -m elf_i386
IA32_AS := $(CROSS_COMPILE)gcc -m32 -Wa,--32 -D__ASSEMBLY__ -traditional -c -nostdinc -I $(HPATH)
IA32_CC := $(CC) $(CPPFLAGS) -m32 -O2 -fomit-frame-pointer
IA32_LD := $(LD) -m elf_i386
IA32_AS := $(CC) $(AFLAGS) -m32 -Wa,--32 -traditional -c
IA32_OBJCOPY := $(CROSS_COMPILE)objcopy
IA32_CPP := $(CROSS_COMPILE)gcc -m32 -E
export IA32_CC IA32_LD IA32_AS IA32_OBJCOPY IA32_CPP
......
......@@ -19,4 +19,4 @@ $(obj)/version.o: $(objtree)/include/linux/compile.h
$(objtree)/include/linux/compile.h: FORCE
@echo -n ' Generating $@'
@../scripts/mkcompile_h $@ "$(ARCH)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)"
@$(srctree)/scripts/mkcompile_h $@ "$(ARCH)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)"
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