uboot-fritz4040: Fix build with HOSTCFLAGS
[openwrt/staging/wigyori.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:=6946ebbaf7b12a4a092d763c8f0c87a25984f103
14 PKG_SOURCE_DATE:=2017-01-29
15 PKG_MIRROR_HASH:=5c2394f51a083dca2a2bf9cb36fa717f252112fc792c9eeae64f6383ad08987b
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:=ipq806x
24 UBOOT_IMAGE:=uboot-fritz4040.bin
25 endef
26
27 define U-Boot/fritz4040
28 NAME:=FritzBox 4040
29 endef
30
31 UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes
32 UBOOT_MAKE_FLAGS = USE_PRIVATE_LIBGCC=yes
33 export DTC
34
35 define Build/Configure
36 $(Build/Configure/U-Boot)
37 $(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/lzma2eva $(PKG_BUILD_DIR)/fritz/src/lzma2eva.c -lz
38 $(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/tichksum $(PKG_BUILD_DIR)/fritz/src/tichksum.c
39 ln -sf $(STAGING_DIR_HOST)/bin/lzma $(PKG_BUILD_DIR)/fritz
40 endef
41
42 define Build/Compile
43 $(Build/Compile/U-Boot)
44 (cd $(PKG_BUILD_DIR); ./fritz/fritzcreator.sh;)
45 endef
46
47 define Package/u-boot/install
48 $(Package/u-boot/install/default)
49 $(INSTALL_BIN) ./files/upload-to-f4040.sh $(1)/
50 endef
51
52 UBOOT_TARGETS := fritz4040
53
54 $(eval $(call BuildPackage/U-Boot))