add downloading script (with md5sum checking and sourceforge downloading support)
[openwrt.git] / package / libelf / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME := libelf
4 PKG_VERSION := 0.8.5
5 PKG_RELEASE := 1
6
7 PKG_SOURCE_SITE := http://www.mr511.de/software/
8 PKG_SOURCE_FILE := $(PKG_NAME)-$(PKG_VERSION).tar.gz
9 PKG_SOURCE_CAT := zcat
10 PKG_SOURCE_DIR := $(PKG_NAME)-$(PKG_VERSION)
11 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_SOURCE_DIR)
12 PKG_IPK := $(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
13 PKG_IPK_DIR :=$(PKG_BUILD_DIR)/ipkg/
14
15
16 $(DL_DIR)/$(PKG_SOURCE_FILE):
17 mkdir -p $(DL_DIR)
18 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) x $(PKG_SOURCE_SITE)
19
20 $(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE_FILE)
21 mkdir -p $(TOOL_BUILD_DIR)
22 $(PKG_SOURCE_CAT) $(DL_DIR)/$(PKG_SOURCE_FILE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
23 touch $(PKG_BUILD_DIR)/.unpacked
24
25 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.unpacked
26 (cd $(PKG_BUILD_DIR); \
27 echo "mr_cv_target_elf=$${mr_cv_target_elf=yes}" > config.cache; \
28 $(TARGET_CONFIGURE_OPTS) \
29 ./configure \
30 --target=$(GNU_TARGET_NAME) \
31 --host=$(GNU_TARGET_NAME) \
32 --build=$(GNU_HOST_NAME) \
33 --prefix=/ \
34 --sysconfdir=/etc \
35 );
36 touch $(PKG_BUILD_DIR)/.configured
37
38 $(PKG_BUILD_DIR)/lib/libelf.so.$(LIBELF_VER): $(PKG_BUILD_DIR)/.configured
39 $(MAKE) CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld ARCH=$(ARCH) \
40 -C $(PKG_BUILD_DIR)
41
42 $(STAGING_DIR)/lib/libelf.so: $(PKG_BUILD_DIR)/lib/libelf.so.$(LIBELF_VER)
43 $(MAKE) CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld ARCH=$(ARCH) \
44 -C $(PKG_BUILD_DIR)/lib instroot="$(STAGING_DIR)" install
45
46
47 $(PKG_IPK): $(PKG_BUILD_DIR)/lib/libelf.so.$(LIBELF_VER)
48 $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
49 mkdir -p $(PKG_IPK_DIR)/usr/lib
50 cp -a $(PKG_BUILD_DIR)/lib/libelf.so* $(PKG_IPK_DIR)/usr/lib/
51 $(STRIP) $(PKG_IPK_DIR)/usr/lib/*
52 mkdir -p $(PACKAGE_DIR)
53 $(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR)
54
55 $(IPKG_STATE_DIR)/info/$(PKG_NAME).list: $(PKG_IPK)
56 $(IPKG) install $(PKG_IPK)
57
58 source: $(DL_DIR)/$(PKG_SOURCE_FILE)
59 prepare: $(PKG_BUILD_DIR)/.unpacked
60 compile: $(STAGING_DIR)/lib/libelf.so $(PKG_IPK)
61 install: $(PKG_ZLIB) $(IPKG_STATE_DIR)/info/$(PKG_NAME).list
62
63 clean:
64 rm -rf $(PKG_BUILD_DIR)
65 rm -f $(STAGING_DIR)/lib/$(PKG_NAME)*
66 rm -f $(PACKAGE_DIR)/$(PKG_NAME)\*.ipk
67
This page took 0.040521 seconds and 5 git commands to generate.