ipq40xx: add support for AVM FRITZ!Repeater 3000
[openwrt/.git] / package / boot / uboot-fritz4040 / Makefile
1 #
2 # Copyright (C) 2013-2014 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)/kernel.mk
10
11 PKG_SOURCE_URL:=https://github.com/chunkeey/FritzBox-4040-UBOOT
12 PKG_SOURCE_PROTO:=git
13 PKG_SOURCE_VERSION:=5f383305f4f0be631b51f89e3dc717318057bde9
14 PKG_SOURCE_DATE:=2019-03-03
15 PKG_MIRROR_HASH:=cb9153480648776cce21f038de8153a0f033066e3d44476ed4c802b48f500fae
16
17 PKG_RELEASE:=1
18
19 include $(INCLUDE_DIR)/u-boot.mk
20 include $(INCLUDE_DIR)/package.mk
21
22 define U-Boot/Default
23   BUILD_TARGET:=ipq40xx
24   UBOOT_BOARD:=$(1)
25   UBOOT_IMAGE:=uboot-$(1).bin
26 endef
27
28 define U-Boot/fritz3000
29   NAME:=FritzRepeater 3000
30   BUILD_DEVICES:=avm_fritzrepeater-3000
31 endef
32
33 define U-Boot/fritz4040
34   NAME:=FritzBox 4040
35   BUILD_DEVICES:=avm_fritzbox-4040
36 endef
37
38 define U-Boot/fritz7530
39   NAME:=FritzBox 7530
40   BUILD_DEVICES:=avm_fritzbox-7530
41 endef
42
43 UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes
44 UBOOT_MAKE_FLAGS = USE_PRIVATE_LIBGCC=yes
45 export DTC
46
47 define Build/Configure
48         $(Build/Configure/U-Boot)
49         $(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/lzma2eva $(PKG_BUILD_DIR)/fritz/src/lzma2eva.c
50         $(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/tichksum $(PKG_BUILD_DIR)/fritz/src/tichksum.c
51         ln -sf $(STAGING_DIR_HOST)/bin/lzma $(PKG_BUILD_DIR)/fritz
52 endef
53
54 define Build/Compile
55         $(Build/Compile/U-Boot)
56         (cd $(PKG_BUILD_DIR); ./fritz/fritzcreator.sh $(UBOOT_BOARD);)
57 endef
58
59 define Build/InstallDev
60         $(INSTALL_DIR) $(STAGING_DIR_IMAGE)
61         $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(UBOOT_IMAGE)
62 endef
63
64 define Package/u-boot/install
65         $(Package/u-boot/install/default)
66         $(INSTALL_BIN) $(PKG_BUILD_DIR)/upload-to-f4040.sh $(1)/
67 endef
68
69 UBOOT_TARGETS := fritz3000 fritz4040 fritz7530
70
71 $(eval $(call BuildPackage/U-Boot))