| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 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 |
|
| 35 | ifdef CONFIG_PPC64_BOOT_WRAPPER
|
| 36 | BOOTTARGETFLAGS += -m64
|
| 37 | BOOTTARGETFLAGS += -mabi=elfv2
|
| 38 | ifdef CONFIG_PPC64_ELF_ABI_V2
|
| 39 | BOOTTARGETFLAGS += $(call cc-option,-mabi=elfv2)
|
| 40 | endif
|
| 41 | else
|
| 42 | BOOTTARGETFLAGS := -m32
|
| 43 | endif
|
| 44 |
|
| 45 | ifdef CONFIG_TARGET_CPU_BOOL
|
| 46 | BOOTTARGETFLAGS += -mcpu=$(CONFIG_TARGET_CPU)
|
| 47 | else ifdef CONFIG_PPC64_BOOT_WRAPPER
|
| 48 | ifdef CONFIG_CPU_LITTLE_ENDIAN
|
| 49 | BOOTTARGETFLAGS += -mcpu=powerpc64le
|
| 50 | else
|
| 51 | BOOTTARGETFLAGS += -mcpu=powerpc64
|
| 52 | endif
|
| 53 | endif
|
| 54 |
|
| 55 | $(obj)/4xx.o: BOOTTARGETFLAGS += -mcpu=405
|
| 56 | $(obj)/ebony.o: BOOTTARGETFLAGS += -mcpu=440
|
| 57 | $(obj)/cuboot-taishan.o: BOOTTARGETFLAGS += -mcpu=440
|
| 58 | $(obj)/cuboot-katmai.o: BOOTTARGETFLAGS += -mcpu=440
|
| 59 | $(obj)/treeboot-iss4xx.o: BOOTTARGETFLAGS += -mcpu=405
|
| 60 | $(obj)/treeboot-currituck.o: BOOTTARGETFLAGS += -mcpu=405
|
| 61 | $(obj)/treeboot-akebono.o: BOOTTARGETFLAGS += -mcpu=405
|
| 62 |
|
| 63 | ifdef CONFIG_CPU_BIG_ENDIAN
|
| 64 | BOOTTARGETFLAGS += -mbig-endian
|
| 65 | else
|
| 66 | BOOTTARGETFLAGS += -mlittle-endian
|
| 67 | endif
|
| 68 |
|
| 69 | BOOTCPPFLAGS := -nostdinc $(LINUXINCLUDE)
|
| 70 | BOOTCPPFLAGS += -isystem $(shell $(BOOTCC) -print-file-name=include)
|
| 71 |
|
| 72 | BOOTCFLAGS := $(BOOTTARGETFLAGS) \
|
| 73 | $(CC_FLAGS_DIALECT) \
|
| 74 | -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
|
| 75 | -fno-strict-aliasing -O2 \
|
| 76 | -msoft-float -mno-altivec -mno-vsx \
|
| 77 | $(call cc-option,-mno-prefixed) \
|
| 78 | $(call cc-option,-mno-pcrel) \
|
| 79 | $(call cc-option,-mno-mma) \
|
| 80 | $(call cc-option,-mno-spe) $(call cc-option,-mspe=no) \
|
| 81 | -fomit-frame-pointer -fno-builtin -fPIC
|
| 82 |
|
| 83 | BOOTAFLAGS := $(BOOTTARGETFLAGS) -D__ASSEMBLY__
|
| 84 |
|
| 85 | BOOTARFLAGS := -crD
|
| 86 |
|
| 87 | ifdef CONFIG_CC_IS_CLANG
|
| 88 | BOOTCFLAGS += $(CLANG_FLAGS)
|
| 89 | BOOTAFLAGS += $(CLANG_FLAGS)
|
| 90 | endif
|
| 91 |
|
| 92 | ifdef CONFIG_DEBUG_INFO
|
| 93 | BOOTCFLAGS += -g
|
| 94 | endif
|
| 95 |
|
| 96 | ifeq ($(call cc-option-yn, -fstack-protector),y)
|
| 97 | BOOTCFLAGS += -fno-stack-protector
|
| 98 | endif
|
| 99 |
|
| 100 | BOOTCFLAGS += -include $(srctree)/include/linux/compiler_attributes.h
|
| 101 | BOOTCFLAGS += -I$(objtree)/$(obj) -I$(srctree)/$(obj)
|
| 102 |
|
| 103 | DTC_FLAGS ?= -p 1024
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 | zlib-decomp-$(CONFIG_KERNEL_GZIP) := decompress_inflate.c
|
| 114 | zlib-$(CONFIG_KERNEL_GZIP) := inffast.c inflate.c inftrees.c
|
| 115 | zlibheader-$(CONFIG_KERNEL_GZIP) := inffast.h inffixed.h inflate.h inftrees.h infutil.h
|
| 116 | zliblinuxheader-$(CONFIG_KERNEL_GZIP) := zlib.h zconf.h zutil.h
|
| 117 |
|
| 118 | $(addprefix $(obj)/, decompress.o): \
|
| 119 | $(addprefix $(obj)/,$(zlib-decomp-y))
|
| 120 |
|
| 121 | $(addprefix $(obj)/, $(zlib-decomp-y)): \
|
| 122 | $(addprefix $(obj)/,$(zliblinuxheader-y)) \
|
| 123 | $(addprefix $(obj)/,$(zlibheader-y)) \
|
| 124 | $(addprefix $(obj)/,$(zlib-y))
|
| 125 |
|
| 126 | $(addprefix $(obj)/,$(zlib-y)): \
|
| 127 | $(addprefix $(obj)/,$(zliblinuxheader-y)) \
|
| 128 | $(addprefix $(obj)/,$(zlibheader-y))
|
| 129 |
|
| 130 | libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
|
| 131 | libfdtheader := fdt.h libfdt.h libfdt_internal.h
|
| 132 |
|
| 133 | $(addprefix $(obj)/,$(libfdt) libfdt-wrapper.o simpleboot.o epapr.o opal.o \
|
| 134 | treeboot-akebono.o treeboot-currituck.o treeboot-iss4xx.o): \
|
| 135 | $(addprefix $(obj)/,$(libfdtheader))
|
| 136 |
|
| 137 | src-wlib-y := string.S crt0.S stdio.c decompress.c main.c \
|
| 138 | $(libfdt) libfdt-wrapper.c \
|
| 139 | ns16550.c serial.c simple_alloc.c div64.S util.S \
|
| 140 | elf_util.c $(zlib-y) devtree.c stdlib.c \
|
| 141 | oflib.c ofconsole.c cuboot.c
|
| 142 |
|
| 143 | src-wlib-$(CONFIG_PPC_MPC52xx) += mpc52xx-psc.c
|
| 144 | src-wlib-$(CONFIG_PPC_POWERNV) += opal-calls.S opal.c
|
| 145 | ifndef CONFIG_PPC64_BOOT_WRAPPER
|
| 146 | src-wlib-y += crtsavres.S
|
| 147 | endif
|
| 148 | src-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo.c
|
| 149 | src-wlib-$(CONFIG_PPC_8xx) += mpc8xx.c planetcore.c fsl-soc.c
|
| 150 | src-wlib-$(CONFIG_PPC_82xx) += pq2.c fsl-soc.c planetcore.c
|
| 151 | src-wlib-$(CONFIG_EMBEDDED6xx) += ugecon.c fsl-soc.c
|
| 152 | src-wlib-$(CONFIG_CPM) += cpm-serial.c
|
| 153 |
|
| 154 | src-plat-y := of.c epapr.c
|
| 155 | src-plat-$(CONFIG_44x) += treeboot-ebony.c cuboot-ebony.c treeboot-bamboo.c \
|
| 156 | cuboot-bamboo.c cuboot-sam440ep.c \
|
| 157 | cuboot-sequoia.c cuboot-rainier.c \
|
| 158 | cuboot-taishan.c cuboot-katmai.c \
|
| 159 | cuboot-warp.c cuboot-yosemite.c \
|
| 160 | treeboot-iss4xx.c treeboot-currituck.c \
|
| 161 | treeboot-akebono.c \
|
| 162 | simpleboot.c fixed-head.S
|
| 163 | src-plat-$(CONFIG_PPC_8xx) += cuboot-8xx.c fixed-head.S ep88xc.c redboot-8xx.c
|
| 164 | src-plat-$(CONFIG_PPC_MPC52xx) += cuboot-52xx.c
|
| 165 | src-plat-$(CONFIG_PPC_82xx) += cuboot-pq2.c fixed-head.S ep8248e.c cuboot-824x.c
|
| 166 | src-plat-$(CONFIG_PPC_83xx) += cuboot-83xx.c fixed-head.S redboot-83xx.c
|
| 167 | src-plat-$(CONFIG_FSL_SOC_BOOKE) += cuboot-85xx.c cuboot-85xx-cpm2.c
|
| 168 | src-plat-$(CONFIG_EMBEDDED6xx) += cuboot-pq2.c \
|
| 169 | gamecube-head.S gamecube.c \
|
| 170 | wii-head.S wii.c holly.c \
|
| 171 | fixed-head.S mvme5100.c
|
| 172 | src-plat-$(CONFIG_AMIGAONE) += cuboot-amigaone.c
|
| 173 | src-plat-$(CONFIG_PPC_PS3) += ps3-head.S ps3-hvcall.S ps3.c
|
| 174 | src-plat-$(CONFIG_EPAPR_BOOT) += epapr.c epapr-wrapper.c
|
| 175 | src-plat-$(CONFIG_PPC_PSERIES) += pseries-head.S
|
| 176 | src-plat-$(CONFIG_PPC_POWERNV) += pseries-head.S
|
| 177 | src-plat-$(CONFIG_MVME7100) += motload-head.S mvme7100.c
|
| 178 |
|
| 179 | src-plat-$(CONFIG_PPC_MICROWATT) += fixed-head.S microwatt.c
|
| 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-boot)))
|
| 187 | obj-wlib := $(addsuffix .o, $(basename $(addprefix $(obj)/, $(src-wlib))))
|
| 188 | obj-plat := $(addsuffix .o, $(basename $(addprefix $(obj)/, $(src-plat))))
|
| 189 | obj-plat: $(libfdt)
|
| 190 |
|
| 191 | quiet_cmd_copy_kern_src = COPY $@
|
| 192 | cmd_copy_kern_src = sed -f $(srctree)/arch/powerpc/boot/fixup-headers.sed $< > $@
|
| 193 |
|
| 194 | $(addprefix $(obj)/,$(zlib-y)): $(obj)/%: $(srctree)/lib/zlib_inflate/%
|
| 195 | $(call cmd,copy_kern_src)
|
| 196 |
|
| 197 | $(addprefix $(obj)/,$(zlibheader-y)): $(obj)/%: $(srctree)/lib/zlib_inflate/%
|
| 198 | $(call cmd,copy_kern_src)
|
| 199 |
|
| 200 | $(addprefix $(obj)/,$(zliblinuxheader-y)): $(obj)/%: $(srctree)/include/linux/%
|
| 201 | $(call cmd,copy_kern_src)
|
| 202 |
|
| 203 | $(addprefix $(obj)/,$(zlib-decomp-y)): $(obj)/%: $(srctree)/lib/%
|
| 204 | $(call cmd,copy_kern_src)
|
| 205 |
|
| 206 | quiet_cmd_copy_libfdt = COPY $@
|
| 207 | cmd_copy_libfdt = cp $< $@
|
| 208 |
|
| 209 | $(addprefix $(obj)/,$(libfdt) $(libfdtheader)): $(obj)/%: $(srctree)/scripts/dtc/libfdt/%
|
| 210 | $(call cmd,copy_libfdt)
|
| 211 |
|
| 212 | $(obj)/empty.c:
|
| 213 | $(Q)touch $@
|
| 214 |
|
| 215 | $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : $(obj)/%: $(src)/%.S
|
| 216 | $(Q)cp $< $@
|
| 217 |
|
| 218 | clean-files := $(zlib-) $(zlibheader-) $(zliblinuxheader-) \
|
| 219 | $(zlib-decomp-) $(libfdt) $(libfdtheader) \
|
| 220 | empty.c zImage.coff.lds zImage.ps3.lds zImage.lds
|
| 221 |
|
| 222 | quiet_cmd_bootcc = BOOTCC $@
|
| 223 | cmd_bootcc = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTCPPFLAGS) $(BOOTCFLAGS) -c -o $@ $<
|
| 224 |
|
| 225 | quiet_cmd_bootas = BOOTAS $@
|
| 226 | cmd_bootas = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTCPPFLAGS) $(BOOTAFLAGS) -c -o $@ $<
|
| 227 |
|
| 228 | quiet_cmd_bootar = BOOTAR $@
|
| 229 | cmd_bootar = $(BOOTAR) $(BOOTARFLAGS) $@.$$$$ $(real-prereqs); mv $@.$$$$ $@
|
| 230 |
|
| 231 | $(obj-libfdt): $(obj)/%.o: $(srctree)/scripts/dtc/libfdt/%.c FORCE
|
| 232 | $(call if_changed_dep,bootcc)
|
| 233 | $(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c FORCE
|
| 234 | $(Q)mkdir -p $(dir $@)
|
| 235 | $(call if_changed_dep,bootcc)
|
| 236 | $(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S FORCE
|
| 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-boot) wrapper.a) zImage.lds
|
| 246 | always-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
|
| 247 | $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds
|
| 248 |
|
| 249 | dtstree := $(src)/dts
|
| 250 |
|
| 251 | wrapper := $(src)/wrapper
|
| 252 | wrapperbits := $(always-y) $(addprefix $(obj)/,addnote hack-coff mktree) \
|
| 253 | $(wrapper) FORCE
|
| 254 |
|
| 255 |
|
| 256 |
|
| 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 |
|
| 266 | compressor-$(CONFIG_KERNEL_GZIP) := gz
|
| 267 | compressor-$(CONFIG_KERNEL_XZ) := xz
|
| 268 | compressor-$(CONFIG_KERNEL_LZMA) := lzma
|
| 269 | compressor-$(CONFIG_KERNEL_LZO) := lzo
|
| 270 |
|
| 271 |
|
| 272 | quiet_cmd_wrap = WRAP $@
|
| 273 | cmd_wrap =$(CONFIG_SHELL) $(wrapper) -Z $(compressor-y) -c -o $@ -p $2 \
|
| 274 | $(CROSSWRAP) $(if $3, -s $3)$(if $4, -d $4)$(if $5, -i $5) \
|
| 275 | vmlinux
|
| 276 |
|
| 277 | image-$(CONFIG_PPC_PSERIES) += zImage.pseries
|
| 278 | image-$(CONFIG_PPC_POWERNV) += zImage.pseries
|
| 279 | image-$(CONFIG_PPC_PS3) += dtbImage.ps3
|
| 280 | image-$(CONFIG_PPC_CHRP) += zImage.chrp
|
| 281 | image-$(CONFIG_PPC_EFIKA) += zImage.chrp
|
| 282 | image-$(CONFIG_PPC_PMAC) += zImage.pmac
|
| 283 | image-$(CONFIG_PPC_HOLLY) += dtbImage.holly
|
| 284 | image-$(CONFIG_DEFAULT_UIMAGE) += uImage
|
| 285 | image-$(CONFIG_EPAPR_BOOT) += zImage.epapr
|
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
|
| 296 | image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony
|
| 297 | image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo
|
| 298 | image-$(CONFIG_SAM440EP) += cuImage.sam440ep
|
| 299 | image-$(CONFIG_SEQUOIA) += cuImage.sequoia
|
| 300 | image-$(CONFIG_RAINIER) += cuImage.rainier
|
| 301 | image-$(CONFIG_TAISHAN) += cuImage.taishan
|
| 302 | image-$(CONFIG_KATMAI) += cuImage.katmai
|
| 303 | image-$(CONFIG_WARP) += cuImage.warp
|
| 304 | image-$(CONFIG_YOSEMITE) += cuImage.yosemite
|
| 305 | image-$(CONFIG_ISS4xx) += treeImage.iss4xx \
|
| 306 | treeImage.iss4xx-mpic
|
| 307 | image-$(CONFIG_CURRITUCK) += treeImage.currituck
|
| 308 | image-$(CONFIG_AKEBONO) += treeImage.akebono
|
| 309 |
|
| 310 |
|
| 311 | image-$(CONFIG_MPC86XADS) += cuImage.mpc866ads
|
| 312 | image-$(CONFIG_MPC885ADS) += cuImage.mpc885ads
|
| 313 | image-$(CONFIG_PPC_EP88XC) += dtbImage.ep88xc
|
| 314 | image-$(CONFIG_PPC_ADDER875) += cuImage.adder875-uboot \
|
| 315 | dtbImage.adder875-redboot
|
| 316 |
|
| 317 |
|
| 318 | image-$(CONFIG_PPC_LITE5200) += cuImage.lite5200
|
| 319 | image-$(CONFIG_PPC_LITE5200) += cuImage.lite5200b
|
| 320 | image-$(CONFIG_PPC_MEDIA5200) += cuImage.media5200
|
| 321 |
|
| 322 |
|
| 323 | image-$(CONFIG_EP8248E) += dtbImage.ep8248e
|
| 324 |
|
| 325 |
|
| 326 | image-$(CONFIG_MPC832x_RDB) += cuImage.mpc832x_rdb
|
| 327 | image-$(CONFIG_MPC834x_ITX) += cuImage.mpc8349emitx \
|
| 328 | cuImage.mpc8349emitxgp
|
| 329 | image-$(CONFIG_ASP834x) += dtbImage.asp834x-redboot
|
| 330 |
|
| 331 |
|
| 332 | image-$(CONFIG_MPC85xx_MDS) += cuImage.mpc8568mds
|
| 333 | image-$(CONFIG_MPC85xx_DS) += cuImage.mpc8544ds \
|
| 334 | cuImage.mpc8572ds
|
| 335 | image-$(CONFIG_TQM8540) += cuImage.tqm8540
|
| 336 | image-$(CONFIG_TQM8541) += cuImage.tqm8541
|
| 337 | image-$(CONFIG_TQM8548) += cuImage.tqm8548
|
| 338 | image-$(CONFIG_TQM8555) += cuImage.tqm8555
|
| 339 | image-$(CONFIG_TQM8560) += cuImage.tqm8560
|
| 340 | image-$(CONFIG_KSI8560) += cuImage.ksi8560
|
| 341 |
|
| 342 |
|
| 343 | image-$(CONFIG_MVME7100) += dtbImage.mvme7100
|
| 344 |
|
| 345 |
|
| 346 | image-$(CONFIG_STORCENTER) += cuImage.storcenter
|
| 347 | image-$(CONFIG_GAMECUBE) += dtbImage.gamecube
|
| 348 | image-$(CONFIG_WII) += dtbImage.wii
|
| 349 | image-$(CONFIG_MVME5100) += dtbImage.mvme5100
|
| 350 |
|
| 351 |
|
| 352 | image-$(CONFIG_AMIGAONE) += cuImage.amigaone
|
| 353 |
|
| 354 | image-$(CONFIG_PPC_MICROWATT) += dtbImage.microwatt
|
| 355 |
|
| 356 |
|
| 357 |
|
| 358 | ifdef CONFIG_PPC32
|
| 359 | image-$(CONFIG_PPC_PMAC) += zImage.coff zImage.miboot
|
| 360 | endif
|
| 361 |
|
| 362 |
|
| 363 | image-y += $(CONFIG_EXTRA_TARGETS)
|
| 364 |
|
| 365 | initrd- := $(patsubst zImage%, zImage.initrd%, $(image-))
|
| 366 | initrd-y := $(patsubst zImage%, zImage.initrd%, \
|
| 367 | $(patsubst dtbImage%, dtbImage.initrd%, \
|
| 368 | $(patsubst simpleImage%, simpleImage.initrd%, \
|
| 369 | $(patsubst treeImage%, treeImage.initrd%, $(image-y)))))
|
| 370 | initrd-y := $(filter-out $(image-y), $(initrd-y))
|
| 371 | targets += $(image-y) $(initrd-y)
|
| 372 | targets += $(foreach x, dtbImage uImage cuImage simpleImage treeImage, \
|
| 373 | $(patsubst $(x).%, dts/%.dtb, $(filter $(x).%, $(image-y))))
|
| 374 | targets += $(foreach x, dtbImage uImage cuImage simpleImage treeImage, \
|
| 375 | $(patsubst $(x).%, dts/fsl/%.dtb, $(filter $(x).%, $(image-y))))
|
| 376 |
|
| 377 | $(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz
|
| 378 |
|
| 379 |
|
| 380 |
|
| 381 |
|
| 382 | $(obj)/zImage.initrd.%: vmlinux $(wrapperbits) FORCE
|
| 383 | $(call if_changed,wrap,$*,,,$(obj)/ramdisk.image.gz)
|
| 384 |
|
| 385 | $(addprefix $(obj)/, $(sort $(filter zImage.%, $(image-y)))): vmlinux $(wrapperbits) FORCE
|
| 386 | $(call if_changed,wrap,$(subst $(obj)/zImage.,,$@))
|
| 387 |
|
| 388 |
|
| 389 | $(obj)/dtbImage.initrd.%: vmlinux $(wrapperbits) $(obj)/dts/%.dtb FORCE
|
| 390 | $(call if_changed,wrap,$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
|
| 391 |
|
| 392 | $(obj)/dtbImage.%: vmlinux $(wrapperbits) $(obj)/dts/%.dtb FORCE
|
| 393 | $(call if_changed,wrap,$*,,$(obj)/dts/$*.dtb)
|
| 394 |
|
| 395 |
|
| 396 |
|
| 397 | $(obj)/vmlinux.strip: vmlinux
|
| 398 | $(STRIP) -s -R .comment $< -o $@
|
| 399 |
|
| 400 | $(obj)/uImage: vmlinux $(wrapperbits) FORCE
|
| 401 | $(call if_changed,wrap,uboot)
|
| 402 |
|
| 403 | $(obj)/uImage.initrd.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
|
| 404 | $(call if_changed,wrap,uboot-$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
|
| 405 |
|
| 406 | $(obj)/uImage.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
|
| 407 | $(call if_changed,wrap,uboot-$*,,$(obj)/dts/$*.dtb)
|
| 408 |
|
| 409 | $(obj)/cuImage.initrd.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
|
| 410 | $(call if_changed,wrap,cuboot-$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
|
| 411 |
|
| 412 | $(obj)/cuImage.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
|
| 413 | $(call if_changed,wrap,cuboot-$*,,$(obj)/dts/$*.dtb)
|
| 414 |
|
| 415 | $(obj)/simpleImage.initrd.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
|
| 416 | $(call if_changed,wrap,simpleboot-$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
|
| 417 |
|
| 418 | $(obj)/simpleImage.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
|
| 419 | $(call if_changed,wrap,simpleboot-$*,,$(obj)/dts/$*.dtb)
|
| 420 |
|
| 421 | $(obj)/treeImage.initrd.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
|
| 422 | $(call if_changed,wrap,treeboot-$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
|
| 423 |
|
| 424 | $(obj)/treeImage.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
|
| 425 | $(call if_changed,wrap,treeboot-$*,,$(obj)/dts/$*.dtb)
|
| 426 |
|
| 427 |
|
| 428 | $(obj)/dts/%.dtb: $(obj)/dts/fsl/%.dtb
|
| 429 | @cp $< $@
|
| 430 |
|
| 431 |
|
| 432 | ifeq (,$(image-y))
|
| 433 | image-y := vmlinux.strip
|
| 434 | endif
|
| 435 |
|
| 436 | $(obj)/zImage: $(addprefix $(obj)/, $(image-y))
|
| 437 | $(Q)rm -f $@; ln $< $@
|
| 438 | $(obj)/zImage.initrd: $(addprefix $(obj)/, $(initrd-y))
|
| 439 | $(Q)rm -f $@; ln $< $@
|
| 440 |
|
| 441 |
|
| 442 | clean-files += $(image-) $(initrd-) cuImage.* dtbImage.* treeImage.* \
|
| 443 | zImage zImage.initrd zImage.chrp zImage.coff zImage.holly \
|
| 444 | zImage.miboot zImage.pmac zImage.pseries \
|
| 445 | simpleImage.* otheros.bld
|
| 446 |
|
| 447 |
|
| 448 | clean-kernel-base := vmlinux.strip vmlinux.bin
|
| 449 | clean-kernel := $(addsuffix .gz,$(clean-kernel-base))
|
| 450 | clean-kernel += $(addsuffix .xz,$(clean-kernel-base))
|
| 451 |
|
| 452 | clean-files += $(addprefix ../../../, $(clean-kernel))
|
| 453 |
|
| 454 | WRAPPER_OBJDIR := /usr/lib/kernel-wrapper
|
| 455 | WRAPPER_DTSDIR := /usr/lib/kernel-wrapper/dts
|
| 456 | WRAPPER_BINDIR := /usr/sbin
|
| 457 | INSTALL := install
|
| 458 |
|
| 459 | extra-installed := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(always-y))
|
| 460 | hostprogs-installed := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs))
|
| 461 | wrapper-installed := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper
|
| 462 | dts-installed := $(patsubst $(dtstree)/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(dtstree)/*.dts))
|
| 463 |
|
| 464 | all-installed := $(extra-installed) $(hostprogs-installed) $(wrapper-installed) $(dts-installed)
|
| 465 |
|
| 466 | quiet_cmd_mkdir = MKDIR $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
|
| 467 | cmd_mkdir = mkdir -p $@
|
| 468 |
|
| 469 | quiet_cmd_install = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,%,$@)
|
| 470 | cmd_install = $(INSTALL) -m0644 $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,$(obj)/%,$@) $@
|
| 471 |
|
| 472 | quiet_cmd_install_dts = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,dts/%,$@)
|
| 473 | cmd_install_dts = $(INSTALL) -m0644 $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,$(srctree)/$(obj)/dts/%,$@) $@
|
| 474 |
|
| 475 | quiet_cmd_install_exe = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@)
|
| 476 | cmd_install_exe = $(INSTALL) -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(obj)/%,$@) $@
|
| 477 |
|
| 478 | quiet_cmd_install_wrapper = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@)
|
| 479 | cmd_install_wrapper = $(INSTALL) -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(srctree)/$(obj)/%,$@) $@ ;\
|
| 480 | sed -i $@ -e 's%^object=.*%object=$(WRAPPER_OBJDIR)%' \
|
| 481 | -e 's%^objbin=.*%objbin=$(WRAPPER_BINDIR)%' \
|
| 482 |
|
| 483 |
|
| 484 | $(DESTDIR)$(WRAPPER_OBJDIR) $(DESTDIR)$(WRAPPER_DTSDIR) $(DESTDIR)$(WRAPPER_BINDIR):
|
| 485 | $(call cmd,mkdir)
|
| 486 |
|
| 487 | $(extra-installed) : $(DESTDIR)$(WRAPPER_OBJDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_OBJDIR)
|
| 488 | $(call cmd,install)
|
| 489 |
|
| 490 | $(hostprogs-installed) : $(DESTDIR)$(WRAPPER_BINDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_BINDIR)
|
| 491 | $(call cmd,install_exe)
|
| 492 |
|
| 493 | $(dts-installed) : $(DESTDIR)$(WRAPPER_DTSDIR)/% : $(srctree)/$(obj)/dts/% | $(DESTDIR)$(WRAPPER_DTSDIR)
|
| 494 | $(call cmd,install_dts)
|
| 495 |
|
| 496 | $(wrapper-installed): $(DESTDIR)$(WRAPPER_BINDIR) $(srctree)/$(obj)/wrapper | $(DESTDIR)$(WRAPPER_BINDIR)
|
| 497 | $(call cmd,install_wrapper)
|
| 498 |
|
| 499 | $(obj)/bootwrapper_install: $(all-installed)
|