18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci# Makefile for making ELF bootable images for booting on CHRP
38c2ecf20Sopenharmony_ci# using Open Firmware.
48c2ecf20Sopenharmony_ci#
58c2ecf20Sopenharmony_ci# Geert Uytterhoeven	September 1997
68c2ecf20Sopenharmony_ci#
78c2ecf20Sopenharmony_ci# Based on coffboot by Paul Mackerras
88c2ecf20Sopenharmony_ci# Simplified for ppc64 by Todd Inglett
98c2ecf20Sopenharmony_ci#
108c2ecf20Sopenharmony_ci# NOTE:	this code may be built for 32 bit in ELF32 format even though
118c2ecf20Sopenharmony_ci#	it packages a 64 bit kernel.  We do this to simplify the
128c2ecf20Sopenharmony_ci#	bootloader and increase compatibility with OpenFirmware.
138c2ecf20Sopenharmony_ci#
148c2ecf20Sopenharmony_ci#	To this end we need to define BOOTCC, etc, as the tools
158c2ecf20Sopenharmony_ci#	needed to build the 32 bit image.  That's normally the same
168c2ecf20Sopenharmony_ci#	compiler for the rest of the kernel, with the -m32 flag added.
178c2ecf20Sopenharmony_ci#	To make it easier to setup a cross compiler,
188c2ecf20Sopenharmony_ci#	CROSS32_COMPILE is setup as a prefix just like CROSS_COMPILE
198c2ecf20Sopenharmony_ci#	in the toplevel makefile.
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ciall: $(obj)/zImage
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ciifdef CROSS32_COMPILE
248c2ecf20Sopenharmony_ci    BOOTCC := $(CROSS32_COMPILE)gcc
258c2ecf20Sopenharmony_ci    BOOTAR := $(CROSS32_COMPILE)ar
268c2ecf20Sopenharmony_cielse
278c2ecf20Sopenharmony_ci    BOOTCC := $(CC)
288c2ecf20Sopenharmony_ci    BOOTAR := $(AR)
298c2ecf20Sopenharmony_ciendif
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ciBOOTCFLAGS    := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
328c2ecf20Sopenharmony_ci		 -fno-strict-aliasing -O2 -msoft-float -mno-altivec -mno-vsx \
338c2ecf20Sopenharmony_ci		 $(call cc-option,-mno-spe) $(call cc-option,-mspe=no) \
348c2ecf20Sopenharmony_ci		 -pipe -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \
358c2ecf20Sopenharmony_ci		 $(LINUXINCLUDE)
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ciifdef CONFIG_PPC64_BOOT_WRAPPER
388c2ecf20Sopenharmony_ciBOOTCFLAGS	+= -m64
398c2ecf20Sopenharmony_cielse
408c2ecf20Sopenharmony_ciBOOTCFLAGS	+= -m32
418c2ecf20Sopenharmony_ciendif
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ciBOOTCFLAGS	+= -isystem $(shell $(BOOTCC) -print-file-name=include)
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ciifdef CONFIG_CPU_BIG_ENDIAN
468c2ecf20Sopenharmony_ciBOOTCFLAGS	+= -mbig-endian
478c2ecf20Sopenharmony_cielse
488c2ecf20Sopenharmony_ciBOOTCFLAGS	+= -mlittle-endian
498c2ecf20Sopenharmony_ciBOOTCFLAGS	+= $(call cc-option,-mabi=elfv2)
508c2ecf20Sopenharmony_ciendif
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ciBOOTAFLAGS	:= -D__ASSEMBLY__ $(BOOTCFLAGS) -nostdinc
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ciBOOTARFLAGS	:= -crD
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ciifdef CONFIG_CC_IS_CLANG
578c2ecf20Sopenharmony_ciBOOTCFLAGS += $(CLANG_FLAGS)
588c2ecf20Sopenharmony_ciBOOTAFLAGS += $(CLANG_FLAGS)
598c2ecf20Sopenharmony_ciendif
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ciifdef CONFIG_DEBUG_INFO
628c2ecf20Sopenharmony_ciBOOTCFLAGS	+= -g
638c2ecf20Sopenharmony_ciendif
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ciifeq ($(call cc-option-yn, -fstack-protector),y)
668c2ecf20Sopenharmony_ciBOOTCFLAGS	+= -fno-stack-protector
678c2ecf20Sopenharmony_ciendif
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ciBOOTCFLAGS	+= -I$(objtree)/$(obj) -I$(srctree)/$(obj)
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ciDTC_FLAGS	?= -p 1024
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci$(obj)/4xx.o: BOOTCFLAGS += -mcpu=405
748c2ecf20Sopenharmony_ci$(obj)/ebony.o: BOOTCFLAGS += -mcpu=440
758c2ecf20Sopenharmony_ci$(obj)/cuboot-hotfoot.o: BOOTCFLAGS += -mcpu=405
768c2ecf20Sopenharmony_ci$(obj)/cuboot-taishan.o: BOOTCFLAGS += -mcpu=440
778c2ecf20Sopenharmony_ci$(obj)/cuboot-katmai.o: BOOTCFLAGS += -mcpu=440
788c2ecf20Sopenharmony_ci$(obj)/cuboot-acadia.o: BOOTCFLAGS += -mcpu=405
798c2ecf20Sopenharmony_ci$(obj)/treeboot-iss4xx.o: BOOTCFLAGS += -mcpu=405
808c2ecf20Sopenharmony_ci$(obj)/treeboot-currituck.o: BOOTCFLAGS += -mcpu=405
818c2ecf20Sopenharmony_ci$(obj)/treeboot-akebono.o: BOOTCFLAGS += -mcpu=405
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci# The pre-boot decompressors pull in a lot of kernel headers and other source
848c2ecf20Sopenharmony_ci# files. This creates a bit of a dependency headache since we need to copy
858c2ecf20Sopenharmony_ci# these files into the build dir, fix up any includes and ensure that dependent
868c2ecf20Sopenharmony_ci# files are copied in the right order.
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci# these need to be seperate variables because they are copied out of different
898c2ecf20Sopenharmony_ci# directories in the kernel tree. Sure you COULd merge them, but it's a
908c2ecf20Sopenharmony_ci# cure-is-worse-than-disease situation.
918c2ecf20Sopenharmony_cizlib-decomp-$(CONFIG_KERNEL_GZIP) := decompress_inflate.c
928c2ecf20Sopenharmony_cizlib-$(CONFIG_KERNEL_GZIP) := inffast.c inflate.c inftrees.c
938c2ecf20Sopenharmony_cizlibheader-$(CONFIG_KERNEL_GZIP) := inffast.h inffixed.h inflate.h inftrees.h infutil.h
948c2ecf20Sopenharmony_cizliblinuxheader-$(CONFIG_KERNEL_GZIP) := zlib.h zconf.h zutil.h
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci$(addprefix $(obj)/, decompress.o): \
978c2ecf20Sopenharmony_ci	$(addprefix $(obj)/,$(zlib-decomp-y))
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci$(addprefix $(obj)/, $(zlib-decomp-y)): \
1008c2ecf20Sopenharmony_ci	$(addprefix $(obj)/,$(zliblinuxheader-y)) \
1018c2ecf20Sopenharmony_ci	$(addprefix $(obj)/,$(zlibheader-y)) \
1028c2ecf20Sopenharmony_ci	$(addprefix $(obj)/,$(zlib-y))
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci$(addprefix $(obj)/,$(zlib-y)): \
1058c2ecf20Sopenharmony_ci	$(addprefix $(obj)/,$(zliblinuxheader-y)) \
1068c2ecf20Sopenharmony_ci	$(addprefix $(obj)/,$(zlibheader-y))
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_cilibfdt       := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
1098c2ecf20Sopenharmony_cilibfdtheader := fdt.h libfdt.h libfdt_internal.h
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci$(addprefix $(obj)/,$(libfdt) libfdt-wrapper.o simpleboot.o epapr.o opal.o \
1128c2ecf20Sopenharmony_ci	treeboot-akebono.o treeboot-currituck.o treeboot-iss4xx.o): \
1138c2ecf20Sopenharmony_ci	$(addprefix $(obj)/,$(libfdtheader))
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_cisrc-wlib-y := string.S crt0.S stdio.c decompress.c main.c \
1168c2ecf20Sopenharmony_ci		$(libfdt) libfdt-wrapper.c \
1178c2ecf20Sopenharmony_ci		ns16550.c serial.c simple_alloc.c div64.S util.S \
1188c2ecf20Sopenharmony_ci		elf_util.c $(zlib-y) devtree.c stdlib.c \
1198c2ecf20Sopenharmony_ci		oflib.c ofconsole.c cuboot.c
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_cisrc-wlib-$(CONFIG_PPC_MPC52xx) += mpc52xx-psc.c
1228c2ecf20Sopenharmony_cisrc-wlib-$(CONFIG_PPC64_BOOT_WRAPPER) += opal-calls.S opal.c
1238c2ecf20Sopenharmony_ciifndef CONFIG_PPC64_BOOT_WRAPPER
1248c2ecf20Sopenharmony_cisrc-wlib-y += crtsavres.S
1258c2ecf20Sopenharmony_ciendif
1268c2ecf20Sopenharmony_cisrc-wlib-$(CONFIG_40x) += 4xx.c planetcore.c
1278c2ecf20Sopenharmony_cisrc-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo.c
1288c2ecf20Sopenharmony_cisrc-wlib-$(CONFIG_PPC_8xx) += mpc8xx.c planetcore.c fsl-soc.c
1298c2ecf20Sopenharmony_cisrc-wlib-$(CONFIG_PPC_82xx) += pq2.c fsl-soc.c planetcore.c
1308c2ecf20Sopenharmony_cisrc-wlib-$(CONFIG_EMBEDDED6xx) += ugecon.c fsl-soc.c
1318c2ecf20Sopenharmony_cisrc-wlib-$(CONFIG_CPM) += cpm-serial.c
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_cisrc-plat-y := of.c epapr.c
1348c2ecf20Sopenharmony_cisrc-plat-$(CONFIG_40x) += fixed-head.S cuboot-hotfoot.c \
1358c2ecf20Sopenharmony_ci				cuboot-acadia.c \
1368c2ecf20Sopenharmony_ci				cuboot-kilauea.c simpleboot.c
1378c2ecf20Sopenharmony_cisrc-plat-$(CONFIG_44x) += treeboot-ebony.c cuboot-ebony.c treeboot-bamboo.c \
1388c2ecf20Sopenharmony_ci				cuboot-bamboo.c cuboot-sam440ep.c \
1398c2ecf20Sopenharmony_ci				cuboot-sequoia.c cuboot-rainier.c \
1408c2ecf20Sopenharmony_ci				cuboot-taishan.c cuboot-katmai.c \
1418c2ecf20Sopenharmony_ci				cuboot-warp.c cuboot-yosemite.c \
1428c2ecf20Sopenharmony_ci				treeboot-iss4xx.c treeboot-currituck.c \
1438c2ecf20Sopenharmony_ci				treeboot-akebono.c \
1448c2ecf20Sopenharmony_ci				simpleboot.c fixed-head.S
1458c2ecf20Sopenharmony_cisrc-plat-$(CONFIG_PPC_8xx) += cuboot-8xx.c fixed-head.S ep88xc.c redboot-8xx.c
1468c2ecf20Sopenharmony_cisrc-plat-$(CONFIG_PPC_MPC52xx) += cuboot-52xx.c
1478c2ecf20Sopenharmony_cisrc-plat-$(CONFIG_PPC_82xx) += cuboot-pq2.c fixed-head.S ep8248e.c cuboot-824x.c
1488c2ecf20Sopenharmony_cisrc-plat-$(CONFIG_PPC_83xx) += cuboot-83xx.c fixed-head.S redboot-83xx.c
1498c2ecf20Sopenharmony_cisrc-plat-$(CONFIG_FSL_SOC_BOOKE) += cuboot-85xx.c cuboot-85xx-cpm2.c
1508c2ecf20Sopenharmony_cisrc-plat-$(CONFIG_EMBEDDED6xx) += cuboot-pq2.c cuboot-mpc7448hpc2.c \
1518c2ecf20Sopenharmony_ci					gamecube-head.S gamecube.c \
1528c2ecf20Sopenharmony_ci					wii-head.S wii.c holly.c \
1538c2ecf20Sopenharmony_ci					fixed-head.S mvme5100.c
1548c2ecf20Sopenharmony_cisrc-plat-$(CONFIG_AMIGAONE) += cuboot-amigaone.c
1558c2ecf20Sopenharmony_cisrc-plat-$(CONFIG_PPC_PS3) += ps3-head.S ps3-hvcall.S ps3.c
1568c2ecf20Sopenharmony_cisrc-plat-$(CONFIG_EPAPR_BOOT) += epapr.c epapr-wrapper.c
1578c2ecf20Sopenharmony_cisrc-plat-$(CONFIG_PPC_PSERIES) += pseries-head.S
1588c2ecf20Sopenharmony_cisrc-plat-$(CONFIG_PPC_POWERNV) += pseries-head.S
1598c2ecf20Sopenharmony_cisrc-plat-$(CONFIG_PPC_IBM_CELL_BLADE) += pseries-head.S
1608c2ecf20Sopenharmony_cisrc-plat-$(CONFIG_MVME7100) += motload-head.S mvme7100.c
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_cisrc-wlib := $(sort $(src-wlib-y))
1638c2ecf20Sopenharmony_cisrc-plat := $(sort $(src-plat-y))
1648c2ecf20Sopenharmony_cisrc-boot := $(src-wlib) $(src-plat) empty.c
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_cisrc-boot := $(addprefix $(obj)/, $(src-boot))
1678c2ecf20Sopenharmony_ciobj-boot := $(addsuffix .o, $(basename $(src-boot)))
1688c2ecf20Sopenharmony_ciobj-wlib := $(addsuffix .o, $(basename $(addprefix $(obj)/, $(src-wlib))))
1698c2ecf20Sopenharmony_ciobj-plat := $(addsuffix .o, $(basename $(addprefix $(obj)/, $(src-plat))))
1708c2ecf20Sopenharmony_ciobj-plat: $(libfdt)
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ciquiet_cmd_copy_kern_src = COPY    $@
1738c2ecf20Sopenharmony_ci      cmd_copy_kern_src = sed -f $(srctree)/arch/powerpc/boot/fixup-headers.sed $< > $@
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ci$(addprefix $(obj)/,$(zlib-y)): $(obj)/%: $(srctree)/lib/zlib_inflate/%
1768c2ecf20Sopenharmony_ci	$(call cmd,copy_kern_src)
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci$(addprefix $(obj)/,$(zlibheader-y)): $(obj)/%: $(srctree)/lib/zlib_inflate/%
1798c2ecf20Sopenharmony_ci	$(call cmd,copy_kern_src)
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_ci$(addprefix $(obj)/,$(zliblinuxheader-y)): $(obj)/%: $(srctree)/include/linux/%
1828c2ecf20Sopenharmony_ci	$(call cmd,copy_kern_src)
1838c2ecf20Sopenharmony_ci
1848c2ecf20Sopenharmony_ci$(addprefix $(obj)/,$(zlib-decomp-y)): $(obj)/%: $(srctree)/lib/%
1858c2ecf20Sopenharmony_ci	$(call cmd,copy_kern_src)
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ciquiet_cmd_copy_libfdt = COPY    $@
1888c2ecf20Sopenharmony_ci      cmd_copy_libfdt = cp $< $@
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci$(addprefix $(obj)/,$(libfdt) $(libfdtheader)): $(obj)/%: $(srctree)/scripts/dtc/libfdt/%
1918c2ecf20Sopenharmony_ci	$(call cmd,copy_libfdt)
1928c2ecf20Sopenharmony_ci
1938c2ecf20Sopenharmony_ci$(obj)/empty.c:
1948c2ecf20Sopenharmony_ci	$(Q)touch $@
1958c2ecf20Sopenharmony_ci
1968c2ecf20Sopenharmony_ci$(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : $(obj)/%: $(srctree)/$(src)/%.S
1978c2ecf20Sopenharmony_ci	$(Q)cp $< $@
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_ciclean-files := $(zlib-) $(zlibheader-) $(zliblinuxheader-) \
2008c2ecf20Sopenharmony_ci		$(zlib-decomp-) $(libfdt) $(libfdtheader) \
2018c2ecf20Sopenharmony_ci		empty.c zImage.coff.lds zImage.ps3.lds zImage.lds
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ciquiet_cmd_bootcc = BOOTCC  $@
2048c2ecf20Sopenharmony_ci      cmd_bootcc = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $<
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_ciquiet_cmd_bootas = BOOTAS  $@
2078c2ecf20Sopenharmony_ci      cmd_bootas = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $<
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_ciquiet_cmd_bootar = BOOTAR  $@
2108c2ecf20Sopenharmony_ci      cmd_bootar = $(BOOTAR) $(BOOTARFLAGS) $@.$$$$ $(real-prereqs); mv $@.$$$$ $@
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci$(obj-libfdt): $(obj)/%.o: $(srctree)/scripts/dtc/libfdt/%.c FORCE
2138c2ecf20Sopenharmony_ci	$(call if_changed_dep,bootcc)
2148c2ecf20Sopenharmony_ci$(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c FORCE
2158c2ecf20Sopenharmony_ci	$(Q)mkdir -p $(dir $@)
2168c2ecf20Sopenharmony_ci	$(call if_changed_dep,bootcc)
2178c2ecf20Sopenharmony_ci$(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S FORCE
2188c2ecf20Sopenharmony_ci	$(Q)mkdir -p $(dir $@)
2198c2ecf20Sopenharmony_ci	$(call if_changed_dep,bootas)
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ci$(obj)/wrapper.a: $(obj-wlib) FORCE
2228c2ecf20Sopenharmony_ci	$(call if_changed,bootar)
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_cihostprogs	:= addnote hack-coff mktree
2258c2ecf20Sopenharmony_ci
2268c2ecf20Sopenharmony_citargets		+= $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a)
2278c2ecf20Sopenharmony_ciextra-y		:= $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
2288c2ecf20Sopenharmony_ci		   $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds
2298c2ecf20Sopenharmony_ci
2308c2ecf20Sopenharmony_cidtstree		:= $(srctree)/$(src)/dts
2318c2ecf20Sopenharmony_ci
2328c2ecf20Sopenharmony_ciwrapper		:=$(srctree)/$(src)/wrapper
2338c2ecf20Sopenharmony_ciwrapperbits	:= $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \
2348c2ecf20Sopenharmony_ci			$(wrapper) FORCE
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci#############
2378c2ecf20Sopenharmony_ci# Bits for building various flavours of zImage
2388c2ecf20Sopenharmony_ci
2398c2ecf20Sopenharmony_ciifneq ($(CROSS32_COMPILE),)
2408c2ecf20Sopenharmony_ciCROSSWRAP := -C "$(CROSS32_COMPILE)"
2418c2ecf20Sopenharmony_cielse
2428c2ecf20Sopenharmony_ciifneq ($(CROSS_COMPILE),)
2438c2ecf20Sopenharmony_ciCROSSWRAP := -C "$(CROSS_COMPILE)"
2448c2ecf20Sopenharmony_ciendif
2458c2ecf20Sopenharmony_ciendif
2468c2ecf20Sopenharmony_ci
2478c2ecf20Sopenharmony_cicompressor-$(CONFIG_KERNEL_GZIP) := gz
2488c2ecf20Sopenharmony_cicompressor-$(CONFIG_KERNEL_XZ)   := xz
2498c2ecf20Sopenharmony_cicompressor-$(CONFIG_KERNEL_LZMA)   := lzma
2508c2ecf20Sopenharmony_cicompressor-$(CONFIG_KERNEL_LZO) := lzo
2518c2ecf20Sopenharmony_ci
2528c2ecf20Sopenharmony_ci# args (to if_changed): 1 = (this rule), 2 = platform, 3 = dts 4=dtb 5=initrd
2538c2ecf20Sopenharmony_ciquiet_cmd_wrap	= WRAP    $@
2548c2ecf20Sopenharmony_ci      cmd_wrap	=$(CONFIG_SHELL) $(wrapper) -Z $(compressor-y) -c -o $@ -p $2 \
2558c2ecf20Sopenharmony_ci		$(CROSSWRAP) $(if $3, -s $3)$(if $4, -d $4)$(if $5, -i $5) \
2568c2ecf20Sopenharmony_ci		vmlinux
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_ciimage-$(CONFIG_PPC_PSERIES)		+= zImage.pseries
2598c2ecf20Sopenharmony_ciimage-$(CONFIG_PPC_POWERNV)		+= zImage.pseries
2608c2ecf20Sopenharmony_ciimage-$(CONFIG_PPC_MAPLE)		+= zImage.maple
2618c2ecf20Sopenharmony_ciimage-$(CONFIG_PPC_IBM_CELL_BLADE)	+= zImage.pseries
2628c2ecf20Sopenharmony_ciimage-$(CONFIG_PPC_PS3)			+= dtbImage.ps3
2638c2ecf20Sopenharmony_ciimage-$(CONFIG_PPC_CHRP)		+= zImage.chrp
2648c2ecf20Sopenharmony_ciimage-$(CONFIG_PPC_EFIKA)		+= zImage.chrp
2658c2ecf20Sopenharmony_ciimage-$(CONFIG_PPC_PMAC)		+= zImage.pmac
2668c2ecf20Sopenharmony_ciimage-$(CONFIG_PPC_HOLLY)		+= dtbImage.holly
2678c2ecf20Sopenharmony_ciimage-$(CONFIG_DEFAULT_UIMAGE)		+= uImage
2688c2ecf20Sopenharmony_ciimage-$(CONFIG_EPAPR_BOOT)		+= zImage.epapr
2698c2ecf20Sopenharmony_ci
2708c2ecf20Sopenharmony_ci#
2718c2ecf20Sopenharmony_ci# Targets which embed a device tree blob
2728c2ecf20Sopenharmony_ci#
2738c2ecf20Sopenharmony_ci# Theses are default targets to build images which embed device tree blobs.
2748c2ecf20Sopenharmony_ci# They are only required on boards which do not have FDT support in firmware.
2758c2ecf20Sopenharmony_ci# Boards with newish u-boot firmware can use the uImage target above
2768c2ecf20Sopenharmony_ci#
2778c2ecf20Sopenharmony_ci
2788c2ecf20Sopenharmony_ci# Board ports in arch/powerpc/platform/40x/Kconfig
2798c2ecf20Sopenharmony_ciimage-$(CONFIG_HOTFOOT)			+= cuImage.hotfoot
2808c2ecf20Sopenharmony_ciimage-$(CONFIG_ACADIA)			+= cuImage.acadia
2818c2ecf20Sopenharmony_ciimage-$(CONFIG_OBS600)			+= uImage.obs600
2828c2ecf20Sopenharmony_ci
2838c2ecf20Sopenharmony_ci# Board ports in arch/powerpc/platform/44x/Kconfig
2848c2ecf20Sopenharmony_ciimage-$(CONFIG_EBONY)			+= treeImage.ebony cuImage.ebony
2858c2ecf20Sopenharmony_ciimage-$(CONFIG_BAMBOO)			+= treeImage.bamboo cuImage.bamboo
2868c2ecf20Sopenharmony_ciimage-$(CONFIG_SAM440EP)		+= cuImage.sam440ep
2878c2ecf20Sopenharmony_ciimage-$(CONFIG_SEQUOIA)			+= cuImage.sequoia
2888c2ecf20Sopenharmony_ciimage-$(CONFIG_RAINIER)			+= cuImage.rainier
2898c2ecf20Sopenharmony_ciimage-$(CONFIG_TAISHAN)			+= cuImage.taishan
2908c2ecf20Sopenharmony_ciimage-$(CONFIG_KATMAI)			+= cuImage.katmai
2918c2ecf20Sopenharmony_ciimage-$(CONFIG_WARP)			+= cuImage.warp
2928c2ecf20Sopenharmony_ciimage-$(CONFIG_YOSEMITE)		+= cuImage.yosemite
2938c2ecf20Sopenharmony_ciimage-$(CONFIG_ISS4xx)			+= treeImage.iss4xx \
2948c2ecf20Sopenharmony_ci					   treeImage.iss4xx-mpic
2958c2ecf20Sopenharmony_ciimage-$(CONFIG_CURRITUCK)			+= treeImage.currituck
2968c2ecf20Sopenharmony_ciimage-$(CONFIG_AKEBONO)			+= treeImage.akebono
2978c2ecf20Sopenharmony_ci
2988c2ecf20Sopenharmony_ci# Board ports in arch/powerpc/platform/8xx/Kconfig
2998c2ecf20Sopenharmony_ciimage-$(CONFIG_MPC86XADS)		+= cuImage.mpc866ads
3008c2ecf20Sopenharmony_ciimage-$(CONFIG_MPC885ADS)		+= cuImage.mpc885ads
3018c2ecf20Sopenharmony_ciimage-$(CONFIG_PPC_EP88XC)		+= dtbImage.ep88xc
3028c2ecf20Sopenharmony_ciimage-$(CONFIG_PPC_ADDER875)		+= cuImage.adder875-uboot \
3038c2ecf20Sopenharmony_ci					   dtbImage.adder875-redboot
3048c2ecf20Sopenharmony_ci
3058c2ecf20Sopenharmony_ci# Board ports in arch/powerpc/platform/52xx/Kconfig
3068c2ecf20Sopenharmony_ciimage-$(CONFIG_PPC_LITE5200)		+= cuImage.lite5200
3078c2ecf20Sopenharmony_ciimage-$(CONFIG_PPC_LITE5200)		+= cuImage.lite5200b
3088c2ecf20Sopenharmony_ciimage-$(CONFIG_PPC_MEDIA5200)		+= cuImage.media5200
3098c2ecf20Sopenharmony_ci
3108c2ecf20Sopenharmony_ci# Board ports in arch/powerpc/platform/82xx/Kconfig
3118c2ecf20Sopenharmony_ciimage-$(CONFIG_MPC8272_ADS)		+= cuImage.mpc8272ads
3128c2ecf20Sopenharmony_ciimage-$(CONFIG_PQ2FADS)			+= cuImage.pq2fads
3138c2ecf20Sopenharmony_ciimage-$(CONFIG_EP8248E)			+= dtbImage.ep8248e
3148c2ecf20Sopenharmony_ci
3158c2ecf20Sopenharmony_ci# Board ports in arch/powerpc/platform/83xx/Kconfig
3168c2ecf20Sopenharmony_ciimage-$(CONFIG_MPC832x_MDS)		+= cuImage.mpc832x_mds
3178c2ecf20Sopenharmony_ciimage-$(CONFIG_MPC832x_RDB)		+= cuImage.mpc832x_rdb
3188c2ecf20Sopenharmony_ciimage-$(CONFIG_MPC834x_ITX)		+= cuImage.mpc8349emitx \
3198c2ecf20Sopenharmony_ci					   cuImage.mpc8349emitxgp
3208c2ecf20Sopenharmony_ciimage-$(CONFIG_MPC834x_MDS)		+= cuImage.mpc834x_mds
3218c2ecf20Sopenharmony_ciimage-$(CONFIG_MPC836x_MDS)		+= cuImage.mpc836x_mds
3228c2ecf20Sopenharmony_ciimage-$(CONFIG_ASP834x)			+= dtbImage.asp834x-redboot
3238c2ecf20Sopenharmony_ci
3248c2ecf20Sopenharmony_ci# Board ports in arch/powerpc/platform/85xx/Kconfig
3258c2ecf20Sopenharmony_ciimage-$(CONFIG_MPC8540_ADS)		+= cuImage.mpc8540ads
3268c2ecf20Sopenharmony_ciimage-$(CONFIG_MPC8560_ADS)		+= cuImage.mpc8560ads
3278c2ecf20Sopenharmony_ciimage-$(CONFIG_MPC85xx_CDS)		+= cuImage.mpc8541cds \
3288c2ecf20Sopenharmony_ci					   cuImage.mpc8548cds_32b \
3298c2ecf20Sopenharmony_ci					   cuImage.mpc8555cds
3308c2ecf20Sopenharmony_ciimage-$(CONFIG_MPC85xx_MDS)		+= cuImage.mpc8568mds
3318c2ecf20Sopenharmony_ciimage-$(CONFIG_MPC85xx_DS)		+= cuImage.mpc8544ds \
3328c2ecf20Sopenharmony_ci					   cuImage.mpc8572ds
3338c2ecf20Sopenharmony_ciimage-$(CONFIG_TQM8540)			+= cuImage.tqm8540
3348c2ecf20Sopenharmony_ciimage-$(CONFIG_TQM8541)			+= cuImage.tqm8541
3358c2ecf20Sopenharmony_ciimage-$(CONFIG_TQM8548)			+= cuImage.tqm8548
3368c2ecf20Sopenharmony_ciimage-$(CONFIG_TQM8555)			+= cuImage.tqm8555
3378c2ecf20Sopenharmony_ciimage-$(CONFIG_TQM8560)			+= cuImage.tqm8560
3388c2ecf20Sopenharmony_ciimage-$(CONFIG_SBC8548)			+= cuImage.sbc8548
3398c2ecf20Sopenharmony_ciimage-$(CONFIG_KSI8560)			+= cuImage.ksi8560
3408c2ecf20Sopenharmony_ci
3418c2ecf20Sopenharmony_ci# Board ports in arch/powerpc/platform/86xx/Kconfig
3428c2ecf20Sopenharmony_ciimage-$(CONFIG_MVME7100)                += dtbImage.mvme7100
3438c2ecf20Sopenharmony_ci
3448c2ecf20Sopenharmony_ci# Board ports in arch/powerpc/platform/embedded6xx/Kconfig
3458c2ecf20Sopenharmony_ciimage-$(CONFIG_STORCENTER)		+= cuImage.storcenter
3468c2ecf20Sopenharmony_ciimage-$(CONFIG_MPC7448HPC2)		+= cuImage.mpc7448hpc2
3478c2ecf20Sopenharmony_ciimage-$(CONFIG_GAMECUBE)		+= dtbImage.gamecube
3488c2ecf20Sopenharmony_ciimage-$(CONFIG_WII)			+= dtbImage.wii
3498c2ecf20Sopenharmony_ciimage-$(CONFIG_MVME5100)		+= dtbImage.mvme5100
3508c2ecf20Sopenharmony_ci
3518c2ecf20Sopenharmony_ci# Board port in arch/powerpc/platform/amigaone/Kconfig
3528c2ecf20Sopenharmony_ciimage-$(CONFIG_AMIGAONE)		+= cuImage.amigaone
3538c2ecf20Sopenharmony_ci
3548c2ecf20Sopenharmony_ci# For 32-bit powermacs, build the COFF and miboot images
3558c2ecf20Sopenharmony_ci# as well as the ELF images.
3568c2ecf20Sopenharmony_ciifdef CONFIG_PPC32
3578c2ecf20Sopenharmony_ciimage-$(CONFIG_PPC_PMAC)	+= zImage.coff zImage.miboot
3588c2ecf20Sopenharmony_ciendif
3598c2ecf20Sopenharmony_ci
3608c2ecf20Sopenharmony_ci# Allow extra targets to be added to the defconfig
3618c2ecf20Sopenharmony_ciimage-y	+= $(subst ",,$(CONFIG_EXTRA_TARGETS))
3628c2ecf20Sopenharmony_ci
3638c2ecf20Sopenharmony_ciinitrd-  := $(patsubst zImage%, zImage.initrd%, $(image-))
3648c2ecf20Sopenharmony_ciinitrd-y := $(patsubst zImage%, zImage.initrd%, \
3658c2ecf20Sopenharmony_ci		$(patsubst dtbImage%, dtbImage.initrd%, \
3668c2ecf20Sopenharmony_ci		$(patsubst simpleImage%, simpleImage.initrd%, \
3678c2ecf20Sopenharmony_ci		$(patsubst treeImage%, treeImage.initrd%, $(image-y)))))
3688c2ecf20Sopenharmony_ciinitrd-y := $(filter-out $(image-y), $(initrd-y))
3698c2ecf20Sopenharmony_citargets	+= $(image-y) $(initrd-y)
3708c2ecf20Sopenharmony_citargets += $(foreach x, dtbImage uImage cuImage simpleImage treeImage, \
3718c2ecf20Sopenharmony_ci		$(patsubst $(x).%, dts/%.dtb, $(filter $(x).%, $(image-y))))
3728c2ecf20Sopenharmony_citargets += $(foreach x, dtbImage uImage cuImage simpleImage treeImage, \
3738c2ecf20Sopenharmony_ci		$(patsubst $(x).%, dts/fsl/%.dtb, $(filter $(x).%, $(image-y))))
3748c2ecf20Sopenharmony_ci
3758c2ecf20Sopenharmony_ci$(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz
3768c2ecf20Sopenharmony_ci
3778c2ecf20Sopenharmony_ci# Don't put the ramdisk on the pattern rule; when its missing make will try
3788c2ecf20Sopenharmony_ci# the pattern rule with less dependencies that also matches (even with the
3798c2ecf20Sopenharmony_ci# hard dependency listed).
3808c2ecf20Sopenharmony_ci$(obj)/zImage.initrd.%: vmlinux $(wrapperbits) FORCE
3818c2ecf20Sopenharmony_ci	$(call if_changed,wrap,$*,,,$(obj)/ramdisk.image.gz)
3828c2ecf20Sopenharmony_ci
3838c2ecf20Sopenharmony_ci$(addprefix $(obj)/, $(sort $(filter zImage.%, $(image-y)))): vmlinux $(wrapperbits) FORCE
3848c2ecf20Sopenharmony_ci	$(call if_changed,wrap,$(subst $(obj)/zImage.,,$@))
3858c2ecf20Sopenharmony_ci
3868c2ecf20Sopenharmony_ci# dtbImage% - a dtbImage is a zImage with an embedded device tree blob
3878c2ecf20Sopenharmony_ci$(obj)/dtbImage.initrd.%: vmlinux $(wrapperbits) $(obj)/dts/%.dtb FORCE
3888c2ecf20Sopenharmony_ci	$(call if_changed,wrap,$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
3898c2ecf20Sopenharmony_ci
3908c2ecf20Sopenharmony_ci$(obj)/dtbImage.%: vmlinux $(wrapperbits) $(obj)/dts/%.dtb FORCE
3918c2ecf20Sopenharmony_ci	$(call if_changed,wrap,$*,,$(obj)/dts/$*.dtb)
3928c2ecf20Sopenharmony_ci
3938c2ecf20Sopenharmony_ci# This cannot be in the root of $(src) as the zImage rule always adds a $(obj)
3948c2ecf20Sopenharmony_ci# prefix
3958c2ecf20Sopenharmony_ci$(obj)/vmlinux.strip: vmlinux
3968c2ecf20Sopenharmony_ci	$(STRIP) -s -R .comment $< -o $@
3978c2ecf20Sopenharmony_ci
3988c2ecf20Sopenharmony_ci$(obj)/uImage: vmlinux $(wrapperbits) FORCE
3998c2ecf20Sopenharmony_ci	$(call if_changed,wrap,uboot)
4008c2ecf20Sopenharmony_ci
4018c2ecf20Sopenharmony_ci$(obj)/uImage.initrd.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
4028c2ecf20Sopenharmony_ci	$(call if_changed,wrap,uboot-$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
4038c2ecf20Sopenharmony_ci
4048c2ecf20Sopenharmony_ci$(obj)/uImage.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
4058c2ecf20Sopenharmony_ci	$(call if_changed,wrap,uboot-$*,,$(obj)/dts/$*.dtb)
4068c2ecf20Sopenharmony_ci
4078c2ecf20Sopenharmony_ci$(obj)/cuImage.initrd.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
4088c2ecf20Sopenharmony_ci	$(call if_changed,wrap,cuboot-$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
4098c2ecf20Sopenharmony_ci
4108c2ecf20Sopenharmony_ci$(obj)/cuImage.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
4118c2ecf20Sopenharmony_ci	$(call if_changed,wrap,cuboot-$*,,$(obj)/dts/$*.dtb)
4128c2ecf20Sopenharmony_ci
4138c2ecf20Sopenharmony_ci$(obj)/simpleImage.initrd.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
4148c2ecf20Sopenharmony_ci	$(call if_changed,wrap,simpleboot-$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
4158c2ecf20Sopenharmony_ci
4168c2ecf20Sopenharmony_ci$(obj)/simpleImage.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
4178c2ecf20Sopenharmony_ci	$(call if_changed,wrap,simpleboot-$*,,$(obj)/dts/$*.dtb)
4188c2ecf20Sopenharmony_ci
4198c2ecf20Sopenharmony_ci$(obj)/treeImage.initrd.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
4208c2ecf20Sopenharmony_ci	$(call if_changed,wrap,treeboot-$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
4218c2ecf20Sopenharmony_ci
4228c2ecf20Sopenharmony_ci$(obj)/treeImage.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
4238c2ecf20Sopenharmony_ci	$(call if_changed,wrap,treeboot-$*,,$(obj)/dts/$*.dtb)
4248c2ecf20Sopenharmony_ci
4258c2ecf20Sopenharmony_ci# Needed for the above targets to work with dts/fsl/ files
4268c2ecf20Sopenharmony_ci$(obj)/dts/%.dtb: $(obj)/dts/fsl/%.dtb
4278c2ecf20Sopenharmony_ci	@cp $< $@
4288c2ecf20Sopenharmony_ci
4298c2ecf20Sopenharmony_ci# If there isn't a platform selected then just strip the vmlinux.
4308c2ecf20Sopenharmony_ciifeq (,$(image-y))
4318c2ecf20Sopenharmony_ciimage-y := vmlinux.strip
4328c2ecf20Sopenharmony_ciendif
4338c2ecf20Sopenharmony_ci
4348c2ecf20Sopenharmony_ci$(obj)/zImage:		$(addprefix $(obj)/, $(image-y))
4358c2ecf20Sopenharmony_ci	$(Q)rm -f $@; ln $< $@
4368c2ecf20Sopenharmony_ci$(obj)/zImage.initrd:	$(addprefix $(obj)/, $(initrd-y))
4378c2ecf20Sopenharmony_ci	$(Q)rm -f $@; ln $< $@
4388c2ecf20Sopenharmony_ci
4398c2ecf20Sopenharmony_ci# Only install the vmlinux
4408c2ecf20Sopenharmony_ciinstall: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
4418c2ecf20Sopenharmony_ci	sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)"
4428c2ecf20Sopenharmony_ci
4438c2ecf20Sopenharmony_ci# Install the vmlinux and other built boot targets.
4448c2ecf20Sopenharmony_cizInstall: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
4458c2ecf20Sopenharmony_ci	sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $^
4468c2ecf20Sopenharmony_ci
4478c2ecf20Sopenharmony_ciPHONY += install zInstall
4488c2ecf20Sopenharmony_ci
4498c2ecf20Sopenharmony_ci# anything not in $(targets)
4508c2ecf20Sopenharmony_ciclean-files += $(image-) $(initrd-) cuImage.* dtbImage.* treeImage.* \
4518c2ecf20Sopenharmony_ci	zImage zImage.initrd zImage.chrp zImage.coff zImage.holly \
4528c2ecf20Sopenharmony_ci	zImage.miboot zImage.pmac zImage.pseries \
4538c2ecf20Sopenharmony_ci	zImage.maple simpleImage.* otheros.bld
4548c2ecf20Sopenharmony_ci
4558c2ecf20Sopenharmony_ci# clean up files cached by wrapper
4568c2ecf20Sopenharmony_ciclean-kernel-base := vmlinux.strip vmlinux.bin
4578c2ecf20Sopenharmony_ciclean-kernel := $(addsuffix .gz,$(clean-kernel-base))
4588c2ecf20Sopenharmony_ciclean-kernel += $(addsuffix .xz,$(clean-kernel-base))
4598c2ecf20Sopenharmony_ci# If not absolute clean-files are relative to $(obj).
4608c2ecf20Sopenharmony_ciclean-files += $(addprefix $(objtree)/, $(clean-kernel))
4618c2ecf20Sopenharmony_ci
4628c2ecf20Sopenharmony_ciWRAPPER_OBJDIR := /usr/lib/kernel-wrapper
4638c2ecf20Sopenharmony_ciWRAPPER_DTSDIR := /usr/lib/kernel-wrapper/dts
4648c2ecf20Sopenharmony_ciWRAPPER_BINDIR := /usr/sbin
4658c2ecf20Sopenharmony_ciINSTALL := install
4668c2ecf20Sopenharmony_ci
4678c2ecf20Sopenharmony_ciextra-installed		:= $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y))
4688c2ecf20Sopenharmony_cihostprogs-installed	:= $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs))
4698c2ecf20Sopenharmony_ciwrapper-installed	:= $(DESTDIR)$(WRAPPER_BINDIR)/wrapper
4708c2ecf20Sopenharmony_cidts-installed		:= $(patsubst $(dtstree)/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(dtstree)/*.dts))
4718c2ecf20Sopenharmony_ci
4728c2ecf20Sopenharmony_ciall-installed		:= $(extra-installed) $(hostprogs-installed) $(wrapper-installed) $(dts-installed)
4738c2ecf20Sopenharmony_ci
4748c2ecf20Sopenharmony_ciquiet_cmd_mkdir           = MKDIR   $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
4758c2ecf20Sopenharmony_ci      cmd_mkdir           = mkdir -p $@
4768c2ecf20Sopenharmony_ci
4778c2ecf20Sopenharmony_ciquiet_cmd_install	  = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,%,$@)
4788c2ecf20Sopenharmony_ci      cmd_install	  = $(INSTALL)  -m0644 $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,$(obj)/%,$@) $@
4798c2ecf20Sopenharmony_ci
4808c2ecf20Sopenharmony_ciquiet_cmd_install_dts	  = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,dts/%,$@)
4818c2ecf20Sopenharmony_ci      cmd_install_dts	  = $(INSTALL)  -m0644 $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,$(srctree)/$(obj)/dts/%,$@) $@
4828c2ecf20Sopenharmony_ci
4838c2ecf20Sopenharmony_ciquiet_cmd_install_exe	  = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@)
4848c2ecf20Sopenharmony_ci      cmd_install_exe	  = $(INSTALL)  -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(obj)/%,$@) $@
4858c2ecf20Sopenharmony_ci
4868c2ecf20Sopenharmony_ciquiet_cmd_install_wrapper = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@)
4878c2ecf20Sopenharmony_ci      cmd_install_wrapper = $(INSTALL)  -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(srctree)/$(obj)/%,$@) $@ ;\
4888c2ecf20Sopenharmony_ci				sed -i $@ -e 's%^object=.*%object=$(WRAPPER_OBJDIR)%' \
4898c2ecf20Sopenharmony_ci					  -e 's%^objbin=.*%objbin=$(WRAPPER_BINDIR)%' \
4908c2ecf20Sopenharmony_ci
4918c2ecf20Sopenharmony_ci
4928c2ecf20Sopenharmony_ci$(DESTDIR)$(WRAPPER_OBJDIR) $(DESTDIR)$(WRAPPER_DTSDIR) $(DESTDIR)$(WRAPPER_BINDIR):
4938c2ecf20Sopenharmony_ci	$(call cmd,mkdir)
4948c2ecf20Sopenharmony_ci
4958c2ecf20Sopenharmony_ci$(extra-installed)	: $(DESTDIR)$(WRAPPER_OBJDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_OBJDIR)
4968c2ecf20Sopenharmony_ci	$(call cmd,install)
4978c2ecf20Sopenharmony_ci
4988c2ecf20Sopenharmony_ci$(hostprogs-installed)  : $(DESTDIR)$(WRAPPER_BINDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_BINDIR)
4998c2ecf20Sopenharmony_ci	$(call cmd,install_exe)
5008c2ecf20Sopenharmony_ci
5018c2ecf20Sopenharmony_ci$(dts-installed)	: $(DESTDIR)$(WRAPPER_DTSDIR)/% : $(srctree)/$(obj)/dts/% | $(DESTDIR)$(WRAPPER_DTSDIR)
5028c2ecf20Sopenharmony_ci	$(call cmd,install_dts)
5038c2ecf20Sopenharmony_ci
5048c2ecf20Sopenharmony_ci$(wrapper-installed): $(DESTDIR)$(WRAPPER_BINDIR) $(srctree)/$(obj)/wrapper | $(DESTDIR)$(WRAPPER_BINDIR)
5058c2ecf20Sopenharmony_ci	$(call cmd,install_wrapper)
5068c2ecf20Sopenharmony_ci
5078c2ecf20Sopenharmony_ci$(obj)/bootwrapper_install: $(all-installed)
508