ath79: remove unused copy-file build step
[openwrt/openwrt.git] / target / linux / ath79 / image / Makefile
1 include $(TOPDIR)/rules.mk
2 include $(INCLUDE_DIR)/image.mk
3
4 KERNEL_LOADADDR = 0x80060000
5
6 DEVICE_VARS += IMAGE_SIZE LOADER_FLASH_OFFS LOADER_TYPE ATH_SOC
7
8 define Build/loader-common
9 rm -rf $@.src
10 $(MAKE) -C lzma-loader \
11 PKG_BUILD_DIR="$@.src" \
12 TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \
13 LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
14 $(1) compile loader.$(LOADER_TYPE)
15 mv "$@.$(LOADER_TYPE)" "$@"
16 rm -rf $@.src
17 endef
18
19 define Build/loader-kernel
20 $(call Build/loader-common,LOADER_DATA="$@")
21 endef
22
23 define Build/loader-kernel-cmdline
24 $(call Build/loader-common,LOADER_DATA="$@")
25 endef
26
27
28 define Build/loader-okli-compile
29 $(call Build/loader-common,FLASH_OFFS=$(LOADER_FLASH_OFFS) FLASH_MAX=0)
30 endef
31
32 define Build/loader-okli
33 dd if=$(KDIR)/loader-$(1).gz bs=7680 conv=sync of="$@.new"
34 cat "$@" >> "$@.new"
35 mv "$@.new" "$@"
36 endef
37
38 define Build/relocate-kernel
39 rm -rf $@.relocate
40 $(CP) ../../generic/image/relocate $@.relocate
41 $(MAKE) -j1 -C $@.relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
42 ( \
43 dd if=$@.relocate/loader.bin bs=32 conv=sync && \
44 perl -e '@s = stat("$@"); print pack("N", @s[7])' && \
45 cat "$@" \
46 ) > "$@.new"
47 mv "$@.new" "$@"
48 rm -rf $@.relocate
49 endef
50
51
52 define Device/Default
53 ATH_SOC :=
54 DEVICE_DTS_DIR := ../dts
55 DEVICE_DTS = $$(ATH_SOC)_$(1)
56 PROFILES = Default
57 MTDPARTS :=
58 BLOCKSIZE := 64k
59 KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
60 KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
61 COMPILE :=
62 SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
63 IMAGES := sysupgrade.bin
64 IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | \
65 append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
66 endef
67
68 ifeq ($(SUBTARGET),generic)
69 include ./generic.mk
70 include ./generic-tp-link.mk
71 include ./generic-ubnt.mk
72 endif
73 $(eval $(call BuildImage))