1 # SPDX-License-Identifier: GPL-2.0 !! 1 # >> 2 # linux/arch/i386/boot/compressed/Makefile 2 # 3 # 3 # create a compressed vmlinux image from the o 4 # create a compressed vmlinux image from the original vmlinux 4 # 5 # 5 6 6 targets := vmlinux head.o misc.o piggy !! 7 HEAD = head.o 7 asflags-y := !! 8 SYSTEM = $(TOPDIR)/vmlinux >> 9 >> 10 OBJECTS = $(HEAD) misc.o >> 11 >> 12 ZLDFLAGS = -e startup_32 >> 13 >> 14 # >> 15 # ZIMAGE_OFFSET is the load offset of the compression loader >> 16 # BZIMAGE_OFFSET is the load offset of the high loaded compression loader >> 17 # >> 18 ZIMAGE_OFFSET = 0x1000 >> 19 BZIMAGE_OFFSET = 0x100000 >> 20 >> 21 ZLINKFLAGS = -Ttext $(ZIMAGE_OFFSET) $(ZLDFLAGS) >> 22 BZLINKFLAGS = -Ttext $(BZIMAGE_OFFSET) $(ZLDFLAGS) >> 23 >> 24 all: vmlinux >> 25 >> 26 vmlinux: piggy.o $(OBJECTS) >> 27 $(LD) $(ZLINKFLAGS) -o vmlinux $(OBJECTS) piggy.o >> 28 >> 29 bvmlinux: piggy.o $(OBJECTS) >> 30 $(LD) $(BZLINKFLAGS) -o bvmlinux $(OBJECTS) piggy.o 8 31 9 OBJECTS = $(obj)/head.o $(obj)/misc.o !! 32 head.o: head.S >> 33 $(CC) $(AFLAGS) -traditional -c head.S 10 34 11 LDFLAGS_vmlinux := -T !! 35 comma := , 12 36 13 $(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) !! 37 misc.o: misc.c 14 $(call if_changed,ld) !! 38 $(CC) $(CFLAGS) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c misc.c 15 39 16 LDFLAGS_piggy.o := -r --format binary --oforma !! 40 piggy.o: $(SYSTEM) >> 41 tmppiggy=_tmp_$$$$piggy; \ >> 42 rm -f $$tmppiggy $$tmppiggy.gz $$tmppiggy.lnk; \ >> 43 $(OBJCOPY) $(SYSTEM) $$tmppiggy; \ >> 44 gzip -f -9 < $$tmppiggy > $$tmppiggy.gz; \ >> 45 echo "SECTIONS { .data : { input_len = .; LONG(input_data_end - input_data) input_data = .; *(.data) input_data_end = .; }}" > $$tmppiggy.lnk; \ >> 46 $(LD) -r -o piggy.o -b binary $$tmppiggy.gz -b elf32-i386 -T $$tmppiggy.lnk; \ >> 47 rm -f $$tmppiggy $$tmppiggy.gz $$tmppiggy.lnk 17 48 18 $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/../v !! 49 clean: 19 $(call if_changed,ld) !! 50 rm -f vmlinux bvmlinux _tmp_*
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.