a0f97e06a4
The variable CFLAGS is a wellknown variable and the usage by kbuild may result in unexpected behaviour. On top of that several people over time has asked for a way to pass in additional flags to gcc. This patch replace use of CFLAGS with KBUILD_CFLAGS all over the tree and enabling one to use: make CFLAGS=... to specify additional gcc commandline options. One usecase is when trying to find gcc bugs but other use cases has been requested too. Patch was tested on following architectures: alpha, arm, i386, x86_64, mips, sparc, sparc64, ia64, m68k Test was simple to do a defconfig build, apply the patch and check that nothing got rebuild. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
51 lines
1.4 KiB
Plaintext
51 lines
1.4 KiB
Plaintext
#
|
|
# linux/arch/x86/boot/compressed/Makefile
|
|
#
|
|
# create a compressed vmlinux image from the original vmlinux
|
|
#
|
|
|
|
targets := vmlinux vmlinux.bin vmlinux.bin.gz head_32.o misc_32.o piggy.o \
|
|
vmlinux.bin.all vmlinux.relocs
|
|
EXTRA_AFLAGS := -traditional
|
|
|
|
LDFLAGS_vmlinux := -T
|
|
hostprogs-y := relocs
|
|
|
|
KBUILD_CFLAGS := -m32 -D__KERNEL__ $(LINUX_INCLUDE) -O2 \
|
|
-fno-strict-aliasing -fPIC \
|
|
$(call cc-option,-ffreestanding) \
|
|
$(call cc-option,-fno-stack-protector)
|
|
LDFLAGS := -m elf_i386
|
|
|
|
$(obj)/vmlinux: $(src)/vmlinux_32.lds $(obj)/head_32.o $(obj)/misc_32.o $(obj)/piggy.o FORCE
|
|
$(call if_changed,ld)
|
|
@:
|
|
|
|
$(obj)/vmlinux.bin: vmlinux FORCE
|
|
$(call if_changed,objcopy)
|
|
|
|
quiet_cmd_relocs = RELOCS $@
|
|
cmd_relocs = $(obj)/relocs $< > $@;$(obj)/relocs --abs-relocs $<
|
|
$(obj)/vmlinux.relocs: vmlinux $(obj)/relocs FORCE
|
|
$(call if_changed,relocs)
|
|
|
|
vmlinux.bin.all-y := $(obj)/vmlinux.bin
|
|
vmlinux.bin.all-$(CONFIG_RELOCATABLE) += $(obj)/vmlinux.relocs
|
|
quiet_cmd_relocbin = BUILD $@
|
|
cmd_relocbin = cat $(filter-out FORCE,$^) > $@
|
|
$(obj)/vmlinux.bin.all: $(vmlinux.bin.all-y) FORCE
|
|
$(call if_changed,relocbin)
|
|
|
|
ifdef CONFIG_RELOCATABLE
|
|
$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE
|
|
$(call if_changed,gzip)
|
|
else
|
|
$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
|
|
$(call if_changed,gzip)
|
|
endif
|
|
|
|
LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T
|
|
|
|
$(obj)/piggy.o: $(src)/vmlinux_32.scr $(obj)/vmlinux.bin.gz FORCE
|
|
$(call if_changed,ld)
|