Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1#
2# linux/arch/s390/boot/compressed/Makefile
3#
4# create a compressed vmlinux image from the original vmlinux
5#
6
7targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
8targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
9targets += misc.o piggy.o sizes.h head.o
10
11KBUILD_CFLAGS := -m64 -D__KERNEL__ $(LINUX_INCLUDE) -O2
12KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
13KBUILD_CFLAGS += $(cflags-y) -fno-delete-null-pointer-checks -msoft-float
14KBUILD_CFLAGS += $(call cc-option,-mpacked-stack)
15KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
16
17GCOV_PROFILE := n
18
19OBJECTS := $(addprefix $(objtree)/arch/s390/kernel/, head.o sclp.o ebcdic.o)
20OBJECTS += $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o
21
22LDFLAGS_vmlinux := --oformat $(LD_BFD) -e startup -T
23$(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS)
24 $(call if_changed,ld)
25
26sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\)$$/\#define SZ\2 0x\1/p'
27
28quiet_cmd_sizes = GEN $@
29 cmd_sizes = $(NM) $< | sed -n $(sed-sizes) > $@
30
31$(obj)/sizes.h: vmlinux
32 $(call if_changed,sizes)
33
34AFLAGS_head.o += -I$(obj)
35$(obj)/head.o: $(obj)/sizes.h
36
37CFLAGS_misc.o += -I$(obj)
38$(obj)/misc.o: $(obj)/sizes.h
39
40OBJCOPYFLAGS_vmlinux.bin := -R .comment -S
41$(obj)/vmlinux.bin: vmlinux
42 $(call if_changed,objcopy)
43
44vmlinux.bin.all-y := $(obj)/vmlinux.bin
45
46suffix-$(CONFIG_KERNEL_GZIP) := gz
47suffix-$(CONFIG_KERNEL_BZIP2) := bz2
48suffix-$(CONFIG_KERNEL_LZ4) := lz4
49suffix-$(CONFIG_KERNEL_LZMA) := lzma
50suffix-$(CONFIG_KERNEL_LZO) := lzo
51suffix-$(CONFIG_KERNEL_XZ) := xz
52
53$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y)
54 $(call if_changed,gzip)
55$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y)
56 $(call if_changed,bzip2)
57$(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y)
58 $(call if_changed,lz4)
59$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y)
60 $(call if_changed,lzma)
61$(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y)
62 $(call if_changed,lzo)
63$(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y)
64 $(call if_changed,xzkern)
65
66LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T
67$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y)
68 $(call if_changed,ld)