- 1 #############################################################
- 2 #
- 3 # foo
- 4 #
- 5 #############################################################
- 6 FOO_VERSION:=1.0
- 7 FOO_SOURCE:=less-$(FOO_VERSION).tar.gz
- 8 FOO_SITE:=http://www.foosoftware.org/downloads
- 9 FOO_DIR:=$(BUILD_DIR)/less-$(FOO_VERSION)
- 10 FOO_BINARY:=foo
- 11 FOO_TARGET_BINARY:=usr/bin/foo
- 12
- 13 $(DL_DIR)/$(FOO_SOURCE):
- 14 $(WGET) -P $(DL_DIR) $(FOO_SITE)/$(FOO_SOURCE)
- 15
- 16 $(FOO_DIR)/.source: $(DL_DIR)/$(FOO_SOURCE)
- 17 zcat $(DL_DIR)/$(FOO_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- 18 touch $(FOO_DIR)/.source
- 19
- 20 $(FOO_DIR)/.configured: $(FOO_DIR)/.source
- 21 (cd $(FOO_DIR); \
- 22 $(TARGET_CONFIGURE_OPTS) \
- 23 CFLAGS="$(TARGET_CFLAGS)" \
- 24 ./configure \
- 25 --target=$(GNU_TARGET_NAME) \
- 26 --host=$(GNU_TARGET_NAME) \
- 27 --build=$(GNU_HOST_NAME) \
- 28 --prefix=/usr \
- 29 --sysconfdir=/etc \
- 30 );
- 31 touch $(FOO_DIR)/.configured;
- 32
- 33 $(FOO_DIR)/$(FOO_BINARY): $(FOO_DIR)/.configured
- 34 $(MAKE) CC=$(TARGET_CC) -C $(FOO_DIR)
- 35
- 36 $(TARGET_DIR)/$(FOO_TARGET_BINARY): $(FOO_DIR)/$(FOO_BINARY)
- 37 $(MAKE) prefix=$(TARGET_DIR)/usr -C $(FOO_DIR) install
- 38 rm -Rf $(TARGET_DIR)/usr/man
- 39
- 40 foo: uclibc ncurses $(TARGET_DIR)/$(FOO_TARGET_BINARY)
- 41
- 42 foo-source: $(DL_DIR)/$(FOO_SOURCE)
- 43
- 44 foo-clean:
- 45 $(MAKE) prefix=$(TARGET_DIR)/usr -C $(FOO_DIR) uninstall
- 46 -$(MAKE) -C $(FOO_DIR) clean
- 47
- 48 foo-dirclean:
- 49 rm -rf $(FOO_DIR)
- 50
+ 1 # $Id$
+ 2
+ 3 include $(TOPDIR)/rules.mk
+ 4
+ 5 PKG_NAME:=foo
+ 6 PKG_VERSION:=1.0
+ 7 PKG_RELEASE:=1
+ 8 PKG_MD5SUM:=4584f226523776a3cdd2fb6f8212ba8d
+ 9
+ 10 PKG_SOURCE_URL:=http://www.foosoftware.org/downloads
+ 11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+ 12 PKG_CAT:=zcat
+ 13
+ 14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+ 15 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+ 16
+ 17 include $(TOPDIR)/package/rules.mk
+ 18
+ 19 $(eval $(call PKG_template,FOO,foo,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+ 20
+ 21 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
+ 22 (cd $(PKG_BUILD_DIR); \
+ 23 $(TARGET_CONFIGURE_OPTS) \
+ 24 CFLAGS="$(TARGET_CFLAGS)" \
+ 25 ./configure \
+ 26 --target=$(GNU_TARGET_NAME) \
+ 27 --host=$(GNU_TARGET_NAME) \
+ 28 --build=$(GNU_HOST_NAME) \
+ 29 --prefix=/usr \
+ 30 --sysconfdir=/etc \
+ 31 --with-bar="$(STAGING_DIR)/usr" \
+ 32 );
+ 33 touch $@
+ 34
+ 35 $(PKG_BUILD_DIR)/.built:
+ 36 rm -rf $(PKG_INSTALL_DIR)
+ 37 mkdir -p $(PKG_INSTALL_DIR)
+ 38 $(MAKE) -C $(PKG_BUILD_DIR) \
+ 39 $(TARGET_CONFIGURE_OPTS) \
+ 40 install_prefix="$(PKG_INSTALL_DIR)" \
+ 41 all install
+ 42 touch $@
+ 43
+ 44 $(IPKG_FOO):
+ 46 install -d -m0755 $(IDIR_FOO)/usr/sbin
+ 47 cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/foo $(IDIR_FOO)/usr/sbin
+ 49 $(RSTRIP) $(IDIR_FOO)
+ 50 $(IPKG_BUILD) $(IDIR_FOO) $(PACKAGE_DIR)
+ 51
+ 52 mostlyclean:
+ 53 make -C $(PKG_BUILD_DIR) clean
+ 54 rm $(PKG_BUILD_DIR)/.built