1 # SPDX-License-Identifier: GPL-2.0 !! 1 # 2 # Makefile for making ELF bootable images for !! 2 # This file is subject to the terms and conditions of the GNU General Public 3 # using Open Firmware. !! 3 # License. See the file "COPYING" in the main directory of this archive 4 # !! 4 # for more details. 5 # Geert Uytterhoeven September 1997 !! 5 # 6 # !! 6 # Copyright (C) 1995, 1998, 2001, 2002 by Ralf Baechle 7 # Based on coffboot by Paul Mackerras !! 7 # Copyright (C) 2004 Maciej W. Rozycki 8 # Simplified for ppc64 by Todd Inglett !! 8 # 9 # << 10 # NOTE: this code may be built for 32 bit in E << 11 # it packages a 64 bit kernel. We do th << 12 # bootloader and increase compatibility << 13 # << 14 # To this end we need to define BOOTCC, << 15 # needed to build the 32 bit image. Tha << 16 # compiler for the rest of the kernel, w << 17 # To make it easier to setup a cross com << 18 # CROSS32_COMPILE is setup as a prefix j << 19 # in the toplevel makefile. << 20 << 21 all: $(obj)/zImage << 22 << 23 ifdef CROSS32_COMPILE << 24 ifdef CONFIG_CC_IS_CLANG << 25 BOOTCC := $(CROSS32_COMPILE)clang << 26 else << 27 BOOTCC := $(CROSS32_COMPILE)gcc << 28 endif << 29 BOOTAR := $(CROSS32_COMPILE)ar << 30 else << 31 BOOTCC := $(CC) << 32 BOOTAR := $(AR) << 33 endif << 34 9 35 ifdef CONFIG_PPC64_BOOT_WRAPPER !! 10 # 36 BOOTTARGETFLAGS += -m64 !! 11 # Some DECstations need all possible sections of an ECOFF executable 37 BOOTTARGETFLAGS += -mabi=elfv2 !! 12 # 38 ifdef CONFIG_PPC64_ELF_ABI_V2 !! 13 ifdef CONFIG_MACH_DECSTATION 39 BOOTTARGETFLAGS += $(call cc-option,-mabi=elfv !! 14 e2eflag := -a 40 endif << 41 else << 42 BOOTTARGETFLAGS := -m32 << 43 endif 15 endif 44 16 45 ifdef CONFIG_TARGET_CPU_BOOL !! 17 # 46 BOOTTARGETFLAGS += -mcpu=$(CONFIG_TARGET_CPU) !! 18 # Drop some uninteresting sections in the kernel. 47 else ifdef CONFIG_PPC64_BOOT_WRAPPER !! 19 # This is only relevant for ELF kernels but doesn't hurt a.out 48 ifdef CONFIG_CPU_LITTLE_ENDIAN !! 20 # 49 BOOTTARGETFLAGS += -mcpu=powerpc64le !! 21 drop-sections := .reginfo .mdebug .comment .note .pdr .options .MIPS.options 50 else !! 22 strip-flags := $(addprefix --remove-section=,$(drop-sections)) 51 BOOTTARGETFLAGS += -mcpu=powerpc64 << 52 endif << 53 endif << 54 23 55 $(obj)/4xx.o: BOOTTARGETFLAGS += -mcpu=405 !! 24 hostprogs-y := elf2ecoff 56 $(obj)/ebony.o: BOOTTARGETFLAGS += -mcpu=440 << 57 $(obj)/cuboot-taishan.o: BOOTTARGETFLAGS += -m << 58 $(obj)/cuboot-katmai.o: BOOTTARGETFLAGS += -mc << 59 $(obj)/treeboot-iss4xx.o: BOOTTARGETFLAGS += - << 60 $(obj)/treeboot-currituck.o: BOOTTARGETFLAGS + << 61 $(obj)/treeboot-akebono.o: BOOTTARGETFLAGS += << 62 << 63 ifdef CONFIG_CPU_BIG_ENDIAN << 64 BOOTTARGETFLAGS += -mbig-endian << 65 else << 66 BOOTTARGETFLAGS += -mlittle-endian << 67 endif << 68 25 69 BOOTCPPFLAGS := -nostdinc $(LINUXINCLUDE) !! 26 suffix-y := bin 70 BOOTCPPFLAGS += -isystem $(shell $(BOOTCC) !! 27 suffix-$(CONFIG_KERNEL_BZIP2) := bz2 >> 28 suffix-$(CONFIG_KERNEL_GZIP) := gz >> 29 suffix-$(CONFIG_KERNEL_LZMA) := lzma >> 30 suffix-$(CONFIG_KERNEL_LZO) := lzo 71 31 72 BOOTCFLAGS := $(BOOTTARGETFLAGS) \ !! 32 targets := vmlinux.ecoff 73 -Wall -Wundef -Wstrict-prot !! 33 quiet_cmd_ecoff = ECOFF $@ 74 -fno-strict-aliasing -O2 \ !! 34 cmd_ecoff = $(obj)/elf2ecoff $(VMLINUX) $@ $(e2eflag) 75 -msoft-float -mno-altivec - !! 35 $(obj)/vmlinux.ecoff: $(obj)/elf2ecoff $(VMLINUX) FORCE 76 $(call cc-option,-mno-prefi !! 36 $(call if_changed,ecoff) 77 $(call cc-option,-mno-pcrel << 78 $(call cc-option,-mno-mma) << 79 $(call cc-option,-mno-spe) << 80 -fomit-frame-pointer -fno-b << 81 << 82 BOOTAFLAGS := $(BOOTTARGETFLAGS) -D__ASSE << 83 << 84 BOOTARFLAGS := -crD << 85 << 86 ifdef CONFIG_CC_IS_CLANG << 87 BOOTCFLAGS += $(CLANG_FLAGS) << 88 BOOTAFLAGS += $(CLANG_FLAGS) << 89 endif << 90 37 91 ifdef CONFIG_DEBUG_INFO !! 38 targets += vmlinux.bin 92 BOOTCFLAGS += -g !! 39 quiet_cmd_bin = OBJCOPY $@ 93 endif !! 40 cmd_bin = $(OBJCOPY) -O binary $(strip-flags) $(VMLINUX) $@ >> 41 $(obj)/vmlinux.bin: $(VMLINUX) FORCE >> 42 $(call if_changed,bin) 94 43 95 ifeq ($(call cc-option-yn, -fstack-protector), !! 44 targets += vmlinux.srec 96 BOOTCFLAGS += -fno-stack-protector !! 45 quiet_cmd_srec = OBJCOPY $@ 97 endif !! 46 cmd_srec = $(OBJCOPY) -S -O srec $(strip-flags) $(VMLINUX) $@ >> 47 $(obj)/vmlinux.srec: $(VMLINUX) FORCE >> 48 $(call if_changed,srec) >> 49 >> 50 UIMAGE_LOADADDR = $(VMLINUX_LOAD_ADDRESS) >> 51 UIMAGE_ENTRYADDR = $(VMLINUX_ENTRY_ADDRESS) >> 52 >> 53 # >> 54 # Compressed vmlinux images >> 55 # 98 56 99 BOOTCFLAGS += -include $(srctree)/include !! 57 extra-y += vmlinux.bin.bz2 100 BOOTCFLAGS += -I$(objtree)/$(obj) -I$(src !! 58 extra-y += vmlinux.bin.gz >> 59 extra-y += vmlinux.bin.lzma >> 60 extra-y += vmlinux.bin.lzo 101 61 102 DTC_FLAGS ?= -p 1024 !! 62 $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE >> 63 $(call if_changed,bzip2) 103 64 104 # The pre-boot decompressors pull in a lot of !! 65 $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE 105 # files. This creates a bit of a dependency he !! 66 $(call if_changed,gzip) 106 # these files into the build dir, fix up any i << 107 # files are copied in the right order. << 108 << 109 # these need to be separate variables because << 110 # directories in the kernel tree. Sure you COU << 111 # cure-is-worse-than-disease situation. << 112 zlib-decomp-$(CONFIG_KERNEL_GZIP) := decompres << 113 zlib-$(CONFIG_KERNEL_GZIP) := inffast.c inflat << 114 zlibheader-$(CONFIG_KERNEL_GZIP) := inffast.h << 115 zliblinuxheader-$(CONFIG_KERNEL_GZIP) := zlib. << 116 << 117 $(addprefix $(obj)/, decompress.o): \ << 118 $(addprefix $(obj)/,$(zlib-decomp-y)) << 119 << 120 $(addprefix $(obj)/, $(zlib-decomp-y)): \ << 121 $(addprefix $(obj)/,$(zliblinuxheader- << 122 $(addprefix $(obj)/,$(zlibheader-y)) \ << 123 $(addprefix $(obj)/,$(zlib-y)) << 124 << 125 $(addprefix $(obj)/,$(zlib-y)): \ << 126 $(addprefix $(obj)/,$(zliblinuxheader- << 127 $(addprefix $(obj)/,$(zlibheader-y)) << 128 << 129 libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_s << 130 libfdtheader := fdt.h libfdt.h libfdt_internal << 131 << 132 $(addprefix $(obj)/,$(libfdt) libfdt-wrapper.o << 133 treeboot-akebono.o treeboot-currituck. << 134 $(addprefix $(obj)/,$(libfdtheader)) << 135 << 136 src-wlib-y := string.S crt0.S stdio.c decompre << 137 $(libfdt) libfdt-wrapper.c \ << 138 ns16550.c serial.c simple_allo << 139 elf_util.c $(zlib-y) devtree.c << 140 oflib.c ofconsole.c cuboot.c << 141 << 142 src-wlib-$(CONFIG_PPC_MPC52xx) += mpc52xx-psc. << 143 src-wlib-$(CONFIG_PPC_POWERNV) += opal-calls.S << 144 ifndef CONFIG_PPC64_BOOT_WRAPPER << 145 src-wlib-y += crtsavres.S << 146 endif << 147 src-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo << 148 src-wlib-$(CONFIG_PPC_8xx) += mpc8xx.c planetc << 149 src-wlib-$(CONFIG_PPC_82xx) += pq2.c fsl-soc.c << 150 src-wlib-$(CONFIG_EMBEDDED6xx) += ugecon.c fsl << 151 src-wlib-$(CONFIG_CPM) += cpm-serial.c << 152 << 153 src-plat-y := of.c epapr.c << 154 src-plat-$(CONFIG_44x) += treeboot-ebony.c cub << 155 cuboot-bamboo. << 156 cuboot-sequoia << 157 cuboot-taishan << 158 cuboot-warp.c << 159 treeboot-iss4x << 160 treeboot-akebo << 161 simpleboot.c f << 162 src-plat-$(CONFIG_PPC_8xx) += cuboot-8xx.c fix << 163 src-plat-$(CONFIG_PPC_MPC52xx) += cuboot-52xx. << 164 src-plat-$(CONFIG_PPC_82xx) += cuboot-pq2.c fi << 165 src-plat-$(CONFIG_PPC_83xx) += cuboot-83xx.c f << 166 src-plat-$(CONFIG_FSL_SOC_BOOKE) += cuboot-85x << 167 src-plat-$(CONFIG_EMBEDDED6xx) += cuboot-pq2.c << 168 gamecu << 169 wii-he << 170 fixed- << 171 src-plat-$(CONFIG_AMIGAONE) += cuboot-amigaone << 172 src-plat-$(CONFIG_PPC_PS3) += ps3-head.S ps3-h << 173 src-plat-$(CONFIG_EPAPR_BOOT) += epapr.c epapr << 174 src-plat-$(CONFIG_PPC_PSERIES) += pseries-head << 175 src-plat-$(CONFIG_PPC_POWERNV) += pseries-head << 176 src-plat-$(CONFIG_PPC_IBM_CELL_BLADE) += pseri << 177 src-plat-$(CONFIG_MVME7100) += motload-head.S << 178 << 179 src-plat-$(CONFIG_PPC_MICROWATT) += fixed-head << 180 << 181 src-wlib := $(sort $(src-wlib-y)) << 182 src-plat := $(sort $(src-plat-y)) << 183 src-boot := $(src-wlib) $(src-plat) empty.c << 184 << 185 src-boot := $(addprefix $(obj)/, $(src-boot)) << 186 obj-boot := $(addsuffix .o, $(basename $(src-b << 187 obj-wlib := $(addsuffix .o, $(basename $(addpr << 188 obj-plat := $(addsuffix .o, $(basename $(addpr << 189 obj-plat: $(libfdt) << 190 << 191 quiet_cmd_copy_kern_src = COPY $@ << 192 cmd_copy_kern_src = sed -f $(srctree)/ar << 193 << 194 $(addprefix $(obj)/,$(zlib-y)): $(obj)/%: $(sr << 195 $(call cmd,copy_kern_src) << 196 << 197 $(addprefix $(obj)/,$(zlibheader-y)): $(obj)/% << 198 $(call cmd,copy_kern_src) << 199 << 200 $(addprefix $(obj)/,$(zliblinuxheader-y)): $(o << 201 $(call cmd,copy_kern_src) << 202 << 203 $(addprefix $(obj)/,$(zlib-decomp-y)): $(obj)/ << 204 $(call cmd,copy_kern_src) << 205 << 206 quiet_cmd_copy_libfdt = COPY $@ << 207 cmd_copy_libfdt = cp $< $@ << 208 << 209 $(addprefix $(obj)/,$(libfdt) $(libfdtheader)) << 210 $(call cmd,copy_libfdt) << 211 << 212 $(obj)/empty.c: << 213 $(Q)touch $@ << 214 << 215 $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : << 216 $(Q)cp $< $@ << 217 << 218 clean-files := $(zlib-) $(zlibheader-) $(zlibl << 219 $(zlib-decomp-) $(libfdt) $(li << 220 empty.c zImage.coff.lds zImage << 221 << 222 quiet_cmd_bootcc = BOOTCC $@ << 223 cmd_bootcc = $(BOOTCC) -Wp,-MD,$(depfile << 224 << 225 quiet_cmd_bootas = BOOTAS $@ << 226 cmd_bootas = $(BOOTCC) -Wp,-MD,$(depfile << 227 << 228 quiet_cmd_bootar = BOOTAR $@ << 229 cmd_bootar = $(BOOTAR) $(BOOTARFLAGS) $@ << 230 << 231 $(obj-libfdt): $(obj)/%.o: $(srctree)/scripts/ << 232 $(call if_changed_dep,bootcc) << 233 $(patsubst %.c,%.o, $(filter %.c, $(src-boot)) << 234 $(Q)mkdir -p $(dir $@) << 235 $(call if_changed_dep,bootcc) << 236 $(patsubst %.S,%.o, $(filter %.S, $(src-boot)) << 237 $(Q)mkdir -p $(dir $@) << 238 $(call if_changed_dep,bootas) << 239 << 240 $(obj)/wrapper.a: $(obj-wlib) FORCE << 241 $(call if_changed,bootar) << 242 << 243 hostprogs := addnote hack-coff mktree << 244 << 245 targets += $(patsubst $(obj)/%,%,$(obj << 246 extra-y := $(obj)/wrapper.a $(obj-plat << 247 $(obj)/zImage.lds $(obj)/zI << 248 << 249 dtstree := $(src)/dts << 250 << 251 wrapper := $(src)/wrapper << 252 wrapperbits := $(extra-y) $(addprefix $(ob << 253 $(wrapper) FORCE << 254 << 255 ############# << 256 # Bits for building various flavours of zImage << 257 << 258 ifneq ($(CROSS32_COMPILE),) << 259 CROSSWRAP := -C "$(CROSS32_COMPILE)" << 260 else << 261 ifneq ($(CROSS_COMPILE),) << 262 CROSSWRAP := -C "$(CROSS_COMPILE)" << 263 endif << 264 endif << 265 67 266 compressor-$(CONFIG_KERNEL_GZIP) := gz !! 68 $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE 267 compressor-$(CONFIG_KERNEL_XZ) := xz !! 69 $(call if_changed,lzma) 268 compressor-$(CONFIG_KERNEL_LZMA) := lzma << 269 compressor-$(CONFIG_KERNEL_LZO) := lzo << 270 << 271 # args (to if_changed): 1 = (this rule), 2 = p << 272 quiet_cmd_wrap = WRAP $@ << 273 cmd_wrap =$(CONFIG_SHELL) $(wrapper) -Z << 274 $(CROSSWRAP) $(if $3, -s $3)$( << 275 vmlinux << 276 << 277 image-$(CONFIG_PPC_PSERIES) += zIm << 278 image-$(CONFIG_PPC_POWERNV) += zIm << 279 image-$(CONFIG_PPC_MAPLE) += zIm << 280 image-$(CONFIG_PPC_IBM_CELL_BLADE) += zIm << 281 image-$(CONFIG_PPC_PS3) += dtb << 282 image-$(CONFIG_PPC_CHRP) += zIm << 283 image-$(CONFIG_PPC_EFIKA) += zIm << 284 image-$(CONFIG_PPC_PMAC) += zIm << 285 image-$(CONFIG_PPC_HOLLY) += dtb << 286 image-$(CONFIG_DEFAULT_UIMAGE) += uIm << 287 image-$(CONFIG_EPAPR_BOOT) += zIm << 288 << 289 # << 290 # Targets which embed a device tree blob << 291 # << 292 # Theses are default targets to build images w << 293 # They are only required on boards which do no << 294 # Boards with newish u-boot firmware can use t << 295 # << 296 << 297 # Board ports in arch/powerpc/platform/44x/Kco << 298 image-$(CONFIG_EBONY) += tre << 299 image-$(CONFIG_BAMBOO) += tre << 300 image-$(CONFIG_SAM440EP) += cuI << 301 image-$(CONFIG_SEQUOIA) += cuI << 302 image-$(CONFIG_RAINIER) += cuI << 303 image-$(CONFIG_TAISHAN) += cuI << 304 image-$(CONFIG_KATMAI) += cuI << 305 image-$(CONFIG_WARP) += cuI << 306 image-$(CONFIG_YOSEMITE) += cuI << 307 image-$(CONFIG_ISS4xx) += tre << 308 tre << 309 image-$(CONFIG_CURRITUCK) << 310 image-$(CONFIG_AKEBONO) += tre << 311 << 312 # Board ports in arch/powerpc/platform/8xx/Kco << 313 image-$(CONFIG_MPC86XADS) += cuI << 314 image-$(CONFIG_MPC885ADS) += cuI << 315 image-$(CONFIG_PPC_EP88XC) += dtb << 316 image-$(CONFIG_PPC_ADDER875) += cuI << 317 dtb << 318 << 319 # Board ports in arch/powerpc/platform/52xx/Kc << 320 image-$(CONFIG_PPC_LITE5200) += cuI << 321 image-$(CONFIG_PPC_LITE5200) += cuI << 322 image-$(CONFIG_PPC_MEDIA5200) += cuI << 323 << 324 # Board ports in arch/powerpc/platform/82xx/Kc << 325 image-$(CONFIG_EP8248E) += dtb << 326 << 327 # Board ports in arch/powerpc/platform/83xx/Kc << 328 image-$(CONFIG_MPC832x_RDB) += cuI << 329 image-$(CONFIG_MPC834x_ITX) += cuI << 330 cuI << 331 image-$(CONFIG_ASP834x) += dtb << 332 << 333 # Board ports in arch/powerpc/platform/85xx/Kc << 334 image-$(CONFIG_MPC85xx_MDS) += cuI << 335 image-$(CONFIG_MPC85xx_DS) += cuI << 336 cuI << 337 image-$(CONFIG_TQM8540) += cuI << 338 image-$(CONFIG_TQM8541) += cuI << 339 image-$(CONFIG_TQM8548) += cuI << 340 image-$(CONFIG_TQM8555) += cuI << 341 image-$(CONFIG_TQM8560) += cuI << 342 image-$(CONFIG_KSI8560) += cuI << 343 << 344 # Board ports in arch/powerpc/platform/86xx/Kc << 345 image-$(CONFIG_MVME7100) += dtb << 346 << 347 # Board ports in arch/powerpc/platform/embedde << 348 image-$(CONFIG_STORCENTER) += cuI << 349 image-$(CONFIG_GAMECUBE) += dtb << 350 image-$(CONFIG_WII) += dtb << 351 image-$(CONFIG_MVME5100) += dtb << 352 << 353 # Board port in arch/powerpc/platform/amigaone << 354 image-$(CONFIG_AMIGAONE) += cuI << 355 << 356 image-$(CONFIG_PPC_MICROWATT) += dtb << 357 << 358 # For 32-bit powermacs, build the COFF and mib << 359 # as well as the ELF images. << 360 ifdef CONFIG_PPC32 << 361 image-$(CONFIG_PPC_PMAC) += zImage.coff << 362 endif << 363 70 364 # Allow extra targets to be added to the defco !! 71 $(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE 365 image-y += $(CONFIG_EXTRA_TARGETS) !! 72 $(call if_changed,lzo) 366 73 367 initrd- := $(patsubst zImage%, zImage.initrd% !! 74 # 368 initrd-y := $(patsubst zImage%, zImage.initrd% !! 75 # Compressed u-boot images 369 $(patsubst dtbImage%, dtbImage !! 76 # 370 $(patsubst simpleImage%, simpl << 371 $(patsubst treeImage%, treeIma << 372 initrd-y := $(filter-out $(image-y), $(initrd- << 373 targets += $(image-y) $(initrd-y) << 374 targets += $(foreach x, dtbImage uImage cuImag << 375 $(patsubst $(x).%, dts/%.dtb, << 376 targets += $(foreach x, dtbImage uImage cuImag << 377 $(patsubst $(x).%, dts/fsl/%.d << 378 << 379 $(addprefix $(obj)/, $(initrd-y)): $(obj)/ramd << 380 << 381 # Don't put the ramdisk on the pattern rule; w << 382 # the pattern rule with less dependencies that << 383 # hard dependency listed). << 384 $(obj)/zImage.initrd.%: vmlinux $(wrapperbits) << 385 $(call if_changed,wrap,$*,,,$(obj)/ram << 386 << 387 $(addprefix $(obj)/, $(sort $(filter zImage.%, << 388 $(call if_changed,wrap,$(subst $(obj)/ << 389 << 390 # dtbImage% - a dtbImage is a zImage with an e << 391 $(obj)/dtbImage.initrd.%: vmlinux $(wrapperbit << 392 $(call if_changed,wrap,$*,,$(obj)/dts/ << 393 << 394 $(obj)/dtbImage.%: vmlinux $(wrapperbits) $(ob << 395 $(call if_changed,wrap,$*,,$(obj)/dts/ << 396 << 397 # This cannot be in the root of $(src) as the << 398 # prefix << 399 $(obj)/vmlinux.strip: vmlinux << 400 $(STRIP) -s -R .comment $< -o $@ << 401 << 402 $(obj)/uImage: vmlinux $(wrapperbits) FORCE << 403 $(call if_changed,wrap,uboot) << 404 << 405 $(obj)/uImage.initrd.%: vmlinux $(obj)/dts/%.d << 406 $(call if_changed,wrap,uboot-$*,,$(obj << 407 << 408 $(obj)/uImage.%: vmlinux $(obj)/dts/%.dtb $(wr << 409 $(call if_changed,wrap,uboot-$*,,$(obj << 410 << 411 $(obj)/cuImage.initrd.%: vmlinux $(obj)/dts/%. << 412 $(call if_changed,wrap,cuboot-$*,,$(ob << 413 << 414 $(obj)/cuImage.%: vmlinux $(obj)/dts/%.dtb $(w << 415 $(call if_changed,wrap,cuboot-$*,,$(ob << 416 << 417 $(obj)/simpleImage.initrd.%: vmlinux $(obj)/dt << 418 $(call if_changed,wrap,simpleboot-$*,, << 419 << 420 $(obj)/simpleImage.%: vmlinux $(obj)/dts/%.dtb << 421 $(call if_changed,wrap,simpleboot-$*,, << 422 << 423 $(obj)/treeImage.initrd.%: vmlinux $(obj)/dts/ << 424 $(call if_changed,wrap,treeboot-$*,,$( << 425 << 426 $(obj)/treeImage.%: vmlinux $(obj)/dts/%.dtb $ << 427 $(call if_changed,wrap,treeboot-$*,,$( << 428 << 429 # Needed for the above targets to work with dt << 430 $(obj)/dts/%.dtb: $(obj)/dts/fsl/%.dtb << 431 @cp $< $@ << 432 << 433 # If there isn't a platform selected then just << 434 ifeq (,$(image-y)) << 435 image-y := vmlinux.strip << 436 endif << 437 77 438 $(obj)/zImage: $(addprefix $(obj)/, $ !! 78 targets += uImage 439 $(Q)rm -f $@; ln $< $@ !! 79 targets += uImage.bin 440 $(obj)/zImage.initrd: $(addprefix $(obj)/, $ !! 80 targets += uImage.bz2 441 $(Q)rm -f $@; ln $< $@ !! 81 targets += uImage.gz >> 82 targets += uImage.lzma >> 83 targets += uImage.lzo 442 84 443 # anything not in $(targets) !! 85 $(obj)/uImage.bin: $(obj)/vmlinux.bin FORCE 444 clean-files += $(image-) $(initrd-) cuImage.* !! 86 $(call if_changed,uimage,none) 445 zImage zImage.initrd zImage.chrp zImag << 446 zImage.miboot zImage.pmac zImage.pseri << 447 zImage.maple simpleImage.* otheros.bld << 448 87 449 # clean up files cached by wrapper !! 88 $(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2 FORCE 450 clean-kernel-base := vmlinux.strip vmlinux.bin !! 89 $(call if_changed,uimage,bzip2) 451 clean-kernel := $(addsuffix .gz,$(clean-kernel << 452 clean-kernel += $(addsuffix .xz,$(clean-kernel << 453 # clean-files are relative to $(obj). << 454 clean-files += $(addprefix ../../../, $(clean- << 455 90 456 WRAPPER_OBJDIR := /usr/lib/kernel-wrapper !! 91 $(obj)/uImage.gz: $(obj)/vmlinux.bin.gz FORCE 457 WRAPPER_DTSDIR := /usr/lib/kernel-wrapper/dts !! 92 $(call if_changed,uimage,gzip) 458 WRAPPER_BINDIR := /usr/sbin !! 93 459 INSTALL := install !! 94 $(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma FORCE >> 95 $(call if_changed,uimage,lzma) >> 96 >> 97 $(obj)/uImage.lzo: $(obj)/vmlinux.bin.lzo FORCE >> 98 $(call if_changed,uimage,lzo) >> 99 >> 100 $(obj)/uImage: $(obj)/uImage.$(suffix-y) >> 101 @ln -sf $(notdir $<) $@ >> 102 @echo ' Image $@ is ready' >> 103 >> 104 # >> 105 # Flattened Image Tree (.itb) images >> 106 # >> 107 >> 108 ifeq ($(ADDR_BITS),32) >> 109 itb_addr_cells = 1 >> 110 endif >> 111 ifeq ($(ADDR_BITS),64) >> 112 itb_addr_cells = 2 >> 113 endif 460 114 461 extra-installed := $(patsubst $(obj)/% !! 115 targets += vmlinux.its.S 462 hostprogs-installed := $(patsubst %, $(DES << 463 wrapper-installed := $(DESTDIR)$(WRAPPER << 464 dts-installed := $(patsubst $(dtstre << 465 116 466 all-installed := $(extra-installed) !! 117 quiet_cmd_its_cat = CAT $@ >> 118 cmd_its_cat = cat $(real-prereqs) >$@ 467 119 468 quiet_cmd_mkdir = MKDIR $(patsubst !! 120 $(obj)/vmlinux.its.S: $(addprefix $(srctree)/arch/mips/$(PLATFORM)/,$(ITS_INPUTS)) FORCE 469 cmd_mkdir = mkdir -p $@ !! 121 $(call if_changed,its_cat) 470 122 471 quiet_cmd_install = INSTALL $(patsubst !! 123 targets += vmlinux.its 472 cmd_install = $(INSTALL) -m0644 !! 124 targets += vmlinux.gz.its >> 125 targets += vmlinux.bz2.its >> 126 targets += vmlinux.lzma.its >> 127 targets += vmlinux.lzo.its 473 128 474 quiet_cmd_install_dts = INSTALL $(patsubst !! 129 quiet_cmd_cpp_its_S = ITS $@ 475 cmd_install_dts = $(INSTALL) -m0644 !! 130 cmd_cpp_its_S = $(CPP) -P -C -o $@ $< \ >> 131 -DKERNEL_NAME="\"Linux $(KERNELRELEASE)\"" \ >> 132 -DVMLINUX_BINARY="\"$(3)\"" \ >> 133 -DVMLINUX_COMPRESSION="\"$(2)\"" \ >> 134 -DVMLINUX_LOAD_ADDRESS=$(VMLINUX_LOAD_ADDRESS) \ >> 135 -DVMLINUX_ENTRY_ADDRESS=$(VMLINUX_ENTRY_ADDRESS) \ >> 136 -DADDR_BITS=$(ADDR_BITS) \ >> 137 -DADDR_CELLS=$(itb_addr_cells) 476 138 477 quiet_cmd_install_exe = INSTALL $(patsubst !! 139 $(obj)/vmlinux.its: $(obj)/vmlinux.its.S $(VMLINUX) FORCE 478 cmd_install_exe = $(INSTALL) -m0755 !! 140 $(call if_changed,cpp_its_S,none,vmlinux.bin) 479 141 480 quiet_cmd_install_wrapper = INSTALL $(patsubst !! 142 $(obj)/vmlinux.gz.its: $(obj)/vmlinux.its.S $(VMLINUX) FORCE 481 cmd_install_wrapper = $(INSTALL) -m0755 !! 143 $(call if_changed,cpp_its_S,gzip,vmlinux.bin.gz) 482 sed -i $@ -e ' << 483 -e ' << 484 144 >> 145 $(obj)/vmlinux.bz2.its: $(obj)/vmlinux.its.S $(VMLINUX) FORCE >> 146 $(call if_changed,cpp_its_S,bzip2,vmlinux.bin.bz2) 485 147 486 $(DESTDIR)$(WRAPPER_OBJDIR) $(DESTDIR)$(WRAPPE !! 148 $(obj)/vmlinux.lzma.its: $(obj)/vmlinux.its.S $(VMLINUX) FORCE 487 $(call cmd,mkdir) !! 149 $(call if_changed,cpp_its_S,lzma,vmlinux.bin.lzma) 488 150 489 $(extra-installed) : $(DESTDIR)$(WRAPPER_ !! 151 $(obj)/vmlinux.lzo.its: $(obj)/vmlinux.its.S $(VMLINUX) FORCE 490 $(call cmd,install) !! 152 $(call if_changed,cpp_its_S,lzo,vmlinux.bin.lzo) 491 153 492 $(hostprogs-installed) : $(DESTDIR)$(WRAPPER_ !! 154 targets += vmlinux.itb 493 $(call cmd,install_exe) !! 155 targets += vmlinux.gz.itb >> 156 targets += vmlinux.bz2.itb >> 157 targets += vmlinux.lzma.itb >> 158 targets += vmlinux.lzo.itb 494 159 495 $(dts-installed) : $(DESTDIR)$(WRAPPER_ !! 160 quiet_cmd_itb-image = ITB $@ 496 $(call cmd,install_dts) !! 161 cmd_itb-image = \ >> 162 env PATH="$(objtree)/scripts/dtc:$(PATH)" \ >> 163 $(BASH) $(MKIMAGE) \ >> 164 -D "-I dts -O dtb -p 500 \ >> 165 --include $(objtree)/arch/mips \ >> 166 --warning no-unit_address_vs_reg" \ >> 167 -f $(2) $@ 497 168 498 $(wrapper-installed): $(DESTDIR)$(WRAPPER_BIND !! 169 $(obj)/vmlinux.itb: $(obj)/vmlinux.its $(obj)/vmlinux.bin FORCE 499 $(call cmd,install_wrapper) !! 170 $(call if_changed,itb-image,$<) 500 171 501 $(obj)/bootwrapper_install: $(all-installed) !! 172 $(obj)/vmlinux.%.itb: $(obj)/vmlinux.%.its $(obj)/vmlinux.bin.% FORCE >> 173 $(call if_changed,itb-image,$<)
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.