source: branches/backfire/package/uboot-lantiq/Makefile @ 20655

Last change on this file since 20655 was 20628, checked in by ralph, 6 years ago

[uboot-lantiq] cleanup configuration handling

File size: 2.3 KB
Line 
1#
2# Copyright (C) 2010 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9include $(INCLUDE_DIR)/kernel.mk
10
11PKG_NAME:=u-boot
12PKG_VERSION:=2009.11.1
13PKG_MD5SUM:=6086421c9e2f3a0d0dbc5f706b551dbc
14PKG_RELEASE:=1
15
16PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
17PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
18PKG_SOURCE_URL:=ftp://ftp.denx.de/pub/u-boot
19PKG_TARGETS:=bin
20
21include $(INCLUDE_DIR)/package.mk
22
23ifeq ($(DUMP),)
24  STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell grep '^CONFIG_UBOOT_' $(TOPDIR)/.config | md5s)
25endif
26
27define Package/uboot-lantiq
28  SECTION:=boot
29  CATEGORY:=Boot Loaders
30  DEPENDS:=@TARGET_ifxmips
31  TITLE:=U-Boot for Lantiq reference boards
32  URL:=http://www.denx.de/wiki/U-Boot
33endef
34
35define Build/Prepare
36        $(PKG_UNPACK)
37        cp -r $(CP_OPTS) $(FILES_DIR)/* $(PKG_BUILD_DIR)/
38        $(Build/Patch)
39        find $(PKG_BUILD_DIR) -name .svn | $(XARGS) rm -rf
40endef
41
42UBOOT_TARGET:=$(call qstrip,$(CONFIG_UBOOT_TARGET))
43UBOOT_RAMBOOT_DDR_CONFIG:=$(call qstrip,$(CONFIG_UBOOT_RAMBOOT_DDR_CONFIG))
44
45UBOOT_MAKE_OPTS:= \
46        CROSS_COMPILE=$(TARGET_CROSS) \
47        ENDIANNESS= \
48        V=1
49
50define Package/uboot-lantiq/config
51        source "$(SOURCE)/Config.in"
52endef
53
54define Build/Configure/Target
55        $(MAKE) -s -C $(PKG_BUILD_DIR) \
56                $(UBOOT_MAKE_OPTS) \
57                O=$(PKG_BUILD_DIR)/$(1) \
58                $(1)_config
59endef
60
61define Build/Configure
62        $(call Build/Configure/Target,$(UBOOT_TARGET))
63ifeq ($(CONFIG_UBOOT_RAMBOOT),y)
64        $(call Build/Configure/Target,$(UBOOT_TARGET)_ramboot)
65endif
66endef
67
68define Build/Compile/Target
69        $(MAKE) -s -C $(PKG_BUILD_DIR) \
70                $(UBOOT_MAKE_OPTS) \
71                O=$(PKG_BUILD_DIR)/$(1) \
72                all
73endef
74
75define Build/Compile
76        $(call Build/Compile/Target,$(UBOOT_TARGET))
77ifeq ($(CONFIG_UBOOT_RAMBOOT),y)
78        $(call Build/Compile/Target,$(UBOOT_TARGET)_ramboot)
79endif
80endef
81
82define Package/uboot-lantiq/install
83        mkdir -p $(1)/$(UBOOT_TARGET)
84        dd \
85                if=$(PKG_BUILD_DIR)/$(UBOOT_TARGET)/u-boot.bin \
86                of=$(1)/$(UBOOT_TARGET)/u-boot.bin \
87                bs=64k conv=sync
88ifeq ($(CONFIG_UBOOT_RAMBOOT),y)
89        if [ -e $(UBOOT_RAMBOOT_DDR_CONFIG) ]; then \
90                perl ./gct \
91                        $(UBOOT_RAMBOOT_DDR_CONFIG) \
92                        $(PKG_BUILD_DIR)/$(UBOOT_TARGET)_ramboot/u-boot.srec \
93                        $(1)/$(UBOOT_TARGET)/u-boot.asc; \
94        fi
95endif
96endef
97
98$(eval $(call BuildPackage,uboot-lantiq))
Note: See TracBrowser for help on using the repository browser.