kernel: bump 4.14 to 4.14.145
[oweals/openwrt.git] / target / linux / ar71xx / image / Makefile
1 #
2 # Copyright (C) 2008-2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/image.mk
10
11 KERNEL_LOADADDR = 0x80060000
12
13 DEVICE_VARS += BOARDNAME CMDLINE CONSOLE IMAGE_SIZE LOADER_TYPE
14
15 ifeq ($(SUBTARGET),generic)
16 include ./generic.mk
17 include ./generic-legacy-devices.mk
18 include ./generic-tp-link.mk
19 include ./generic-ubnt.mk
20 endif
21 ifeq ($(SUBTARGET),tiny)
22 include ./tiny.mk
23 include ./tiny-tp-link.mk
24 include ./tiny-legacy-devices.mk
25 include ./tiny-senao.mk
26 endif
27 ifeq ($(SUBTARGET),nand)
28 include ./nand.mk
29 endif
30 ifeq ($(SUBTARGET),mikrotik)
31 include ./mikrotik.mk
32 endif
33 include ./legacy.mk
34
35 define Build/loader-common
36         rm -rf $@.src
37         $(MAKE) -C lzma-loader \
38                 PKG_BUILD_DIR="$@.src" \
39                 TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \
40                 BOARD="$(BOARDNAME)" \
41                 LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
42                 $(1) compile loader.$(LOADER_TYPE)
43         mv "$@.$(LOADER_TYPE)" "$@"
44         rm -rf $@.src
45 endef
46
47 define Build/loader-kernel
48         $(call Build/loader-common,LOADER_DATA="$@")
49 endef
50
51 define Build/loader-kernel-cmdline
52         $(call Build/loader-common,LOADER_DATA="$@" KERNEL_CMDLINE="$(CMDLINE)")
53 endef
54
55 define Device/Default
56   BOARDNAME :=
57   DEVICE_PROFILE = $$(BOARDNAME)
58   PROFILES = Default Minimal $$(DEVICE_PROFILE)
59   MTDPARTS :=
60   BLOCKSIZE := 64k
61   CONSOLE := ttyS0,115200
62   CMDLINE = $$(if $$(BOARDNAME),board=$$(BOARDNAME)) $$(if $$(MTDPARTS),mtdparts=$$(MTDPARTS)) $$(if $$(CONSOLE),console=$$(CONSOLE))
63   KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma
64   COMPILE :=
65   IMAGES := sysupgrade.bin
66   IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
67 endef
68
69 $(eval $(call BuildImage))