Back to home page

LXR

 
 

    


0001 #
0002 # linux/arch/sh/boot/compressed/Makefile
0003 #
0004 # create a compressed vmlinux image from the original vmlinux
0005 #
0006 
0007 targets         := vmlinux vmlinux.bin vmlinux.bin.gz \
0008                    vmlinux.bin.bz2 vmlinux.bin.lzma \
0009                    vmlinux.bin.xz vmlinux.bin.lzo \
0010                    head_$(BITS).o misc.o piggy.o
0011 
0012 OBJECTS = $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/cache.o
0013 
0014 GCOV_PROFILE := n
0015 
0016 #
0017 # IMAGE_OFFSET is the load offset of the compression loader
0018 #
0019 ifeq ($(CONFIG_32BIT),y)
0020 IMAGE_OFFSET    := $(shell /bin/bash -c 'printf "0x%08x" \
0021                      $$[$(CONFIG_MEMORY_START)  + \
0022                         $(CONFIG_BOOT_LINK_OFFSET)]')
0023 else
0024 IMAGE_OFFSET    := $(shell /bin/bash -c 'printf "0x%08x" \
0025                      $$[$(CONFIG_PAGE_OFFSET)  + \
0026                         $(KERNEL_MEMORY) + \
0027                         $(CONFIG_BOOT_LINK_OFFSET)]')
0028 endif
0029 
0030 ifeq ($(CONFIG_MCOUNT),y)
0031 ORIG_CFLAGS := $(KBUILD_CFLAGS)
0032 KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
0033 endif
0034 
0035 LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \
0036                    -T $(obj)/../../kernel/vmlinux.lds
0037 
0038 #
0039 # Pull in the necessary libgcc bits from the in-kernel implementation.
0040 #
0041 lib1funcs-$(CONFIG_SUPERH32)    := ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S \
0042                                    lshrsi3.S
0043 lib1funcs-obj                   := \
0044         $(addsuffix .o, $(basename $(addprefix $(obj)/, $(lib1funcs-y))))
0045 
0046 lib1funcs-dir           := $(srctree)/arch/$(SRCARCH)/lib
0047 ifeq ($(BITS),64)
0048         lib1funcs-dir   := $(addsuffix $(BITS), $(lib1funcs-dir))
0049 endif
0050 
0051 KBUILD_CFLAGS += -I$(lib1funcs-dir) -DDISABLE_BRANCH_PROFILING
0052 
0053 $(addprefix $(obj)/,$(lib1funcs-y)): $(obj)/%: $(lib1funcs-dir)/% FORCE
0054         $(call cmd,shipped)
0055 
0056 $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(lib1funcs-obj) FORCE
0057         $(call if_changed,ld)
0058 
0059 $(obj)/vmlinux.bin: vmlinux FORCE
0060         $(call if_changed,objcopy)
0061 
0062 vmlinux.bin.all-y := $(obj)/vmlinux.bin
0063 
0064 $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
0065         $(call if_changed,gzip)
0066 $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
0067         $(call if_changed,bzip2)
0068 $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
0069         $(call if_changed,lzma)
0070 $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE
0071         $(call if_changed,xzkern)
0072 $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE
0073         $(call if_changed,lzo)
0074 
0075 OBJCOPYFLAGS += -R .empty_zero_page
0076 
0077 LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T
0078 
0079 $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE
0080         $(call if_changed,ld)