ixp4xx: make apex optional, clean up the makefile - fixes spurious recompilation...
[openwrt/svn-archive/archive.git] / package / apex / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=apex
12 PKG_VERSION:=1.5.14
13 PKG_RELEASE:=3
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=ftp://ftp.buici.com/pub/apex/ \
18 ftp://metalab.unc.edu/pub/Linux/system/boot/apex/
19 PKG_MD5SUM:=22fb46e76c8221c7bcc9734602367460
20 PKG_TARGETS:=bin
21
22 include $(INCLUDE_DIR)/package.mk
23
24 export GCC_HONOUR_COPTS=s
25
26 define Package/apex
27 SECTION:=boot
28 CATEGORY:=Boot Loaders
29 DEPENDS:=@TARGET_ixp4xx
30 DEFAULT:=y
31 TITLE:=Boot loader for NSLU2, FSG3, NAS100D and others
32 URL:=http://wiki.buici.com/wiki/Apex_Bootloader
33 endef
34
35 define build_apex
36 $(MAKE) -C $(PKG_BUILD_DIR) \
37 ARCH=arm \
38 $(1)_config
39 $(SED) 's,.*CONFIG_AEABI.*,$(if $(CONFIG_EABI_SUPPORT),CONFIG_AEABI=y,# CONFIG_AEABI is not set),' $(PKG_BUILD_DIR)/.config
40 $(MAKE) -C $(PKG_BUILD_DIR) \
41 $(TARGET_CONFIGURE_OPTS) \
42 KBUILD_HAVE_NLS=no \
43 ARCH=arm \
44 clean all
45 $(INSTALL_BIN) $(PKG_BUILD_DIR)/apex.bin $(PKG_BUILD_DIR)/out/apex-$(2).bin
46 endef
47
48 define Build/Compile
49 $(INSTALL_DIR) $(PKG_BUILD_DIR)/out
50 $(call build_apex,slugos-nslu2-armeb,nslu2-armeb)
51 $(call build_apex,slugos-nslu2-16mb-armeb,nslu2-16mb-armeb)
52 $(call build_apex,slugos-fsg3-armeb,fsg3-armeb)
53 $(call build_apex,slugos-nas100d-armeb,nas100d-armeb)
54 endef
55
56 define Package/apex/install
57 $(INSTALL_DIR) $(STAGING_DIR)/apex
58 $(CP) $(PKG_BUILD_DIR)/out/*.bin $(1)/
59 endef
60
61 $(eval $(call BuildPackage,apex))