36ee0be0afc4df01bd97602f470588a49f33bcd8
[openwrt/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:=d306cce36f98a0a67becc42f20df4b22f1d1465f
14 PKG_SOURCE_DATE:=2019-02-08
15 PKG_MIRROR_HASH:=715380605dd0cd6ffd65a18b34127bd57dfe9fb0a0164bf8aca703ee018d8070
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/fritz4040
29 NAME:=FritzBox 4040
30 BUILD_DEVICES:=avm_fritzbox-4040
31 endef
32
33 UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes
34 UBOOT_MAKE_FLAGS = USE_PRIVATE_LIBGCC=yes
35 export DTC
36
37 define Build/Configure
38 $(Build/Configure/U-Boot)
39 $(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/lzma2eva $(PKG_BUILD_DIR)/fritz/src/lzma2eva.c
40 $(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/tichksum $(PKG_BUILD_DIR)/fritz/src/tichksum.c
41 ln -sf $(STAGING_DIR_HOST)/bin/lzma $(PKG_BUILD_DIR)/fritz
42 endef
43
44 define Build/Compile
45 $(Build/Compile/U-Boot)
46 (cd $(PKG_BUILD_DIR); ./fritz/fritzcreator.sh $(UBOOT_BOARD);)
47 endef
48
49 define Build/InstallDev
50 $(INSTALL_DIR) $(STAGING_DIR_IMAGE)
51 $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(UBOOT_IMAGE)
52 endef
53
54 define Package/u-boot/install
55 $(Package/u-boot/install/default)
56 $(INSTALL_BIN) $(PKG_BUILD_DIR)/upload-to-f4040.sh $(1)/
57 endef
58
59 UBOOT_TARGETS := fritz4040
60
61 $(eval $(call BuildPackage/U-Boot))