1 # SPDX-License-Identifier: GPL-2.0 << 2 # Makefile for the Sparc boot stuff. << 3 # 1 # 4 # Copyright (C) 1995 David S. Miller (davem@ca !! 2 # arch/ppc/boot/Makefile 5 # Copyright (C) 1997,1998 Jakub Jelinek (jj@ul !! 3 # >> 4 # This file is subject to the terms and conditions of the GNU General Public >> 5 # License. See the file "COPYING" in the main directory of this archive >> 6 # for more details. >> 7 # >> 8 # Copyright (C) 1994 by Linus Torvalds >> 9 # Adapted for PowerPC by Gary Thomas >> 10 # modified by Cort (cort@cs.nmt.edu) >> 11 # >> 12 >> 13 GZIP_FLAGS = -v9f >> 14 >> 15 CFLAGS += -fno-builtin -D__BOOTER__ -I$(TOPDIR)/arch/$(ARCH)/boot/include >> 16 >> 17 AFLAGS += -D__BOOTER__ >> 18 OBJCOPY_ARGS = -O elf32-powerpc >> 19 >> 20 MKIMAGE := $(TOPDIR)/scripts/mkuboot.sh >> 21 >> 22 lib/zlib.a: lib/zlib.c >> 23 $(MAKE) -C lib 6 24 7 ROOT_IMG := /usr/src/root.img !! 25 images/vmlinux.gz: $(TOPDIR)/vmlinux 8 ELFTOAOUT := elftoaout !! 26 $(MAKE) -C images vmlinux.gz 9 27 10 hostprogs := piggyback !! 28 # Subdirs and tools needed for each. Assume we always need to go into 11 targets := tftpboot.img image zImage v !! 29 # 'simple' unless told otherwise. 12 clean-files := System.map !! 30 subdir-y := lib common simple 13 !! 31 subdir-$(CONFIG_ALL_PPC) := chrp pmac prep 14 quiet_cmd_elftoaout = ELFTOAOUT $@ !! 32 tools-$(CONFIG_ALL_PPC) := addnote mknote hack-coff mkprep 15 cmd_elftoaout = $(ELFTOAOUT) $(obj)/ !! 33 tools-$(CONFIG_4xx) := mktree 16 quiet_cmd_piggy = PIGGY $@ !! 34 tools-$(CONFIG_LOPEC) := mkbugboot mkprep 17 cmd_piggy = $(obj)/piggyback $(B !! 35 tools-$(CONFIG_PPLUS) := mkbugboot mkprep 18 quiet_cmd_strip = STRIP $@ !! 36 tools-$(CONFIG_PRPMC750) := mkbugboot mkprep 19 cmd_strip = $(STRIP) -R .comment !! 37 tools-$(CONFIG_SPRUCE) := mktree 20 << 21 ifeq ($(CONFIG_SPARC64),y) << 22 << 23 # Actual linking << 24 << 25 $(obj)/zImage: $(obj)/image FORCE << 26 $(call if_changed,gzip) << 27 @$(kecho) 'Kernel: $@ is ready' '(#'$( << 28 << 29 $(obj)/vmlinux.aout: vmlinux FORCE << 30 $(call if_changed,elftoaout) << 31 @$(kecho) 'Kernel: $@ is ready' '(#'$( << 32 else << 33 << 34 $(obj)/zImage: $(obj)/image FORCE << 35 $(call if_changed,strip) << 36 @$(kecho) 'Kernel: $@ is ready' '(#'$( << 37 << 38 # The following lines make a readable image fo << 39 # uImage - Binary file read by U-boot << 40 # uImage.o - object file of uImage for loadin << 41 # flash programmer understanding E << 42 << 43 OBJCOPYFLAGS_image.bin := -S -O binary -R .not << 44 $(obj)/image.bin: $(obj)/image FORCE << 45 $(call if_changed,objcopy) << 46 << 47 $(obj)/image.gz: $(obj)/image.bin FORCE << 48 $(call if_changed,gzip) << 49 << 50 UIMAGE_LOADADDR = $(CONFIG_UBOOT_LOAD_ADDR) << 51 UIMAGE_ENTRYADDR = $(CONFIG_UBOOT_ENTRY_ADDR) << 52 UIMAGE_COMPRESSION = gzip << 53 << 54 quiet_cmd_uimage.o = UIMAGE.O $@ << 55 cmd_uimage.o = $(LD) -Tdata $(CONFIG_UBO << 56 -r -b binary $@ -o $@.o << 57 << 58 targets += uImage << 59 $(obj)/uImage: $(obj)/image.gz FORCE << 60 $(call if_changed,uimage) << 61 $(call if_changed,uimage.o) << 62 @$(kecho) 'Kernel: $@ is ready' '(#'$( << 63 38 >> 39 # These are dirs we don't want to go into on BOOT_TARGETS. We have them for >> 40 # the 'depend' stage. >> 41 NONBOOT := lib common >> 42 >> 43 # These are the subdirs we want to use >> 44 BOOTDIRS = $(filter-out $(NONBOOT), $(subdir-y)) >> 45 >> 46 makeof1275: >> 47 $(MAKE) -C of1275 >> 48 >> 49 # This will make the tools we need. We do it like this to ensure that we use >> 50 # HOSTCC. -- Tom >> 51 maketools: >> 52 $(MAKE) -C utils $(tools-y) >> 53 >> 54 # The targets all boards support for boot images. >> 55 BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd >> 56 >> 57 $(BOOT_TARGETS): vmapus lib/zlib.a images/vmlinux.gz makeof1275 maketools >> 58 ifneq ($(BOOTDIRS),) >> 59 for d in $(BOOTDIRS); do $(MAKE) -C $$d $@; done >> 60 endif >> 61 >> 62 vmapus: $(TOPDIR)/vmlinux >> 63 ifdef CONFIG_APUS >> 64 $(STRIP) $(TOPDIR)/vmlinux -o images/vmapus >> 65 gzip $(GZIP_FLAGS) images/vmapus 64 endif 66 endif 65 67 66 $(obj)/image: vmlinux FORCE !! 68 # Make an image for PPCBoot / U-Boot. 67 $(call if_changed,strip) !! 69 uImage: $(MKIMAGE) images/vmlinux.gz 68 @$(kecho) 'Kernel: $@ is ready' '(#'$( !! 70 $(CONFIG_SHELL) $(MKIMAGE) -A ppc -O linux -T kernel \ 69 !! 71 -C gzip -a 00000000 -e 00000000 \ 70 $(obj)/tftpboot.img: $(obj)/image $(obj)/piggy !! 72 -n 'Linux-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)' \ 71 $(call if_changed,elftoaout) !! 73 -d images/vmlinux.gz images/vmlinux.UBoot 72 $(call if_changed,piggy) !! 74 ln -sf vmlinux.UBoot images/uImage >> 75 rm -f ./mkuboot >> 76 >> 77 # These are subdirs with files not normally rm'ed. -- Tom >> 78 clean: >> 79 $(MAKE) -C images clean >> 80 $(MAKE) -C utils clean >> 81 >> 82 include $(TOPDIR)/Rules.make
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.