Merge branch 'next-tpm' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[sfrench/cifs-2.6.git] / arch / parisc / boot / compressed / Makefile
1 #
2 # linux/arch/parisc/boot/compressed/Makefile
3 #
4 # create a compressed self-extracting vmlinux image from the original vmlinux
5 #
6
7 KCOV_INSTRUMENT := n
8 GCOV_PROFILE := n
9 UBSAN_SANITIZE := n
10
11 targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
12 targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
13 targets += misc.o piggy.o sizes.h head.o real2.o firmware.o
14
15 KBUILD_CFLAGS := -D__KERNEL__ -O2 -DBOOTLOADER
16 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
17 KBUILD_CFLAGS += $(cflags-y) -fno-delete-null-pointer-checks -fno-builtin-printf
18 KBUILD_CFLAGS += -fno-PIE -mno-space-regs -mdisable-fpregs -Os
19 ifndef CONFIG_64BIT
20 KBUILD_CFLAGS += -mfast-indirect-calls
21 endif
22
23 OBJECTS += $(obj)/head.o $(obj)/real2.o $(obj)/firmware.o $(obj)/misc.o $(obj)/piggy.o
24
25 LDFLAGS_vmlinux := -X -e startup --as-needed -T
26 $(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) $(LIBGCC)
27         $(call if_changed,ld)
28
29 sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\|parisc_kernel_start\)$$/\#define SZ\2 0x\1/p'
30
31 quiet_cmd_sizes = GEN $@
32       cmd_sizes = $(NM) $< | sed -n $(sed-sizes) > $@
33
34 $(obj)/sizes.h: vmlinux
35         $(call if_changed,sizes)
36
37 AFLAGS_head.o += -I$(objtree)/$(obj) -DBOOTLOADER
38 $(obj)/head.o: $(obj)/sizes.h
39
40 CFLAGS_misc.o += -I$(objtree)/$(obj)
41 $(obj)/misc.o: $(obj)/sizes.h
42
43 $(obj)/firmware.o: $(obj)/firmware.c
44 $(obj)/firmware.c: $(srctree)/arch/$(SRCARCH)/kernel/firmware.c
45         $(call cmd,shipped)
46
47 AFLAGS_real2.o += -DBOOTLOADER
48 $(obj)/real2.o: $(obj)/real2.S
49 $(obj)/real2.S: $(srctree)/arch/$(SRCARCH)/kernel/real2.S
50         $(call cmd,shipped)
51
52 $(obj)/misc.o: $(obj)/sizes.h
53
54 CPPFLAGS_vmlinux.lds += -I$(objtree)/$(obj) -DBOOTLOADER
55 $(obj)/vmlinux.lds: $(obj)/sizes.h
56
57 $(obj)/vmlinux.bin: vmlinux
58         $(call if_changed,objcopy)
59
60 vmlinux.bin.all-y := $(obj)/vmlinux.bin
61
62 suffix-$(CONFIG_KERNEL_GZIP)  := gz
63 suffix-$(CONFIG_KERNEL_BZIP2) := bz2
64 suffix-$(CONFIG_KERNEL_LZ4)  := lz4
65 suffix-$(CONFIG_KERNEL_LZMA)  := lzma
66 suffix-$(CONFIG_KERNEL_LZO)  := lzo
67 suffix-$(CONFIG_KERNEL_XZ)  := xz
68
69 $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y)
70         $(call if_changed,gzip)
71 $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y)
72         $(call if_changed,bzip2)
73 $(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y)
74         $(call if_changed,lz4)
75 $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y)
76         $(call if_changed,lzma)
77 $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y)
78         $(call if_changed,lzo)
79 $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y)
80         $(call if_changed,xzkern)
81
82 LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T
83 $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y)
84         $(call if_changed,ld)