- 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 include $(TOPDIR)/rules.mk
+ 3 PKG_NAME:=foo
+ 4 PKG_VERSION:=1.0
+ 5 PKG_RELEASE:=1
+ 6 PKG_MD5SUM:=4584f226523776a3cdd2fb6f8212ba8d
+ 7
+ 8 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+ 9 PKG_SOURCE_URL:=http://www.foosoftware.org/downloads
+ 10 PKG_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+ 11 PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
+ 12 PKG_IPK_DIR:=$(PKG_DIR)/ipkg
+ 13
+ 14 $(DL_DIR)/$(PKG_SOURCE):
+ 15 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
+ 16
+ 17 $(PKG_DIR)/.source: $(DL_DIR)/$(PKG_SOURCE)
+ 18 zcat $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
+ 19 touch $(PKG_DIR)/.source
+ 20
+ 21 $(PKG_DIR)/.configured: $(PKG_DIR)/.source
+ 22 (cd $(PKG_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 );
+ 32 touch $(PKG_DIR)/.configured;
+ 33
+ 34 $(PKG_DIR)/$(PKG_NAME): $(PKG_DIR)/.configured
+ 35 $(MAKE) CC=$(TARGET_CC) -C $(PKG_DIR)
+ 36
+ 37 $(PKG_IPK): $(PKG_DIR)/$(PKG_NAME)
+ 38 $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
+ 39 $(MAKE) prefix=$(PKG_IPK_DIR)/usr -C $(PKG_DIR) install
+ 40 rm -Rf $(PKG_IPK_DIR)/usr/man
+ 41 $(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR)
+ 42
+ 43 $(IPKG_STATE_DIR)/info/$(PKG_NAME).list: $(PKG_IPK)
+ 44 $(IPKG) install $(PKG_IPK)
+ 45
+ 46 prepare: $(PKG_DIR)/.source
+ 47 compile: $(PKG_IPK)
+ 48 install: $(IPKG_STATE_DIR)/info/$(PKG_NAME).list
+ 49 clean:
+ 50 rm -rf $(PKG_DIR)
+ 51 rm -f $(PKG_IPK)