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