add oleg's gcc 3.4 patch (ld.script)
[openwrt.git] / package / libelf / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=libelf
6 PKG_VERSION:=0.8.5
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=c1daf069367871350ece779b7de20047
9
10 PKG_SOURCE_URL:=\
11 http://www.mr511.de/software/ \
12 http://nthill.free.fr/openwrt/sources/$(PKG_NAME)/
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_CAT:=zcat
15
16 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
17
18 IPKG_LIBELF:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
19 IDIR_LIBELF:=$(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)
20 INFO_LIBELF:=$(IPKG_STATE_DIR)/info/$(PKG_NAME).list
21
22 .NOTPARALLEL:
23
24 $(DL_DIR)/$(PKG_SOURCE):
25 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
26
27 $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
28 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
29 touch $(PKG_BUILD_DIR)/.prepared
30
31 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
32 (cd $(PKG_BUILD_DIR); rm -rf config.cache config.status; \
33 $(TARGET_CONFIGURE_OPTS) \
34 CFLAGS="$(TARGET_CFLAGS)" \
35 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
36 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
37 mr_cv_target_elf=yes \
38 ./configure \
39 --target=$(GNU_TARGET_NAME) \
40 --host=$(GNU_TARGET_NAME) \
41 --build=$(GNU_HOST_NAME) \
42 --program-prefix="" \
43 --program-suffix="" \
44 --prefix=/usr \
45 --exec-prefix=/usr \
46 --bindir=/usr/bin \
47 --datadir=/usr/share \
48 --includedir=/usr/include \
49 --infodir=/usr/share/info \
50 --libdir=/usr/lib \
51 --libexecdir=/usr/lib \
52 --localstatedir=/var \
53 --mandir=/usr/share/man \
54 --sbindir=/usr/sbin \
55 --sysconfdir=/etc \
56 $(DISABLE_NLS) \
57 $(DISABLE_LARGEFILE) \
58 --enable-shared \
59 --enable-static \
60 );
61 touch $(PKG_BUILD_DIR)/.configured
62
63 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
64 $(MAKE) -C $(PKG_BUILD_DIR) -j1 \
65 CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld ARCH=$(ARCH) \
66
67 touch $(PKG_BUILD_DIR)/.built
68
69 $(STAGING_DIR)/usr/lib/libelf.so: $(PKG_BUILD_DIR)/.built
70 $(MAKE) -C $(PKG_BUILD_DIR) -j1 \
71 instroot="$(STAGING_DIR)" \
72 install
73
74 $(IPKG_LIBELF): $(STAGING_DIR)/usr/lib/libelf.so
75 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_LIBELF) ./ipkg/$(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
76 mkdir -p $(IDIR_LIBELF)/usr/lib
77 cp -fpR $(PKG_BUILD_DIR)/lib/libelf.so.* $(IDIR_LIBELF)/usr/lib/
78 $(STRIP) $(IDIR_LIBELF)/usr/lib/lib*.so*
79 mkdir -p $(PACKAGE_DIR)
80 $(IPKG_BUILD) $(IDIR_LIBELF) $(PACKAGE_DIR)
81
82 $(INFO_LIBELF): $(IPKG_LIBELF)
83 $(IPKG) install $(IPKG_LIBELF)
84
85 source: $(DL_DIR)/$(PKG_SOURCE)
86 prepare: $(PKG_BUILD_DIR)/.prepared
87 compile: $(IPKG_LIBELF)
88 install: $(INFO_LIBELF)
89
90 clean:
91 -$(MAKE) -C $(PKG_BUILD_DIR) -j1 \
92 instroot="$(STAGING_DIR)" \
93 uninstall
94 rm -rf $(PKG_BUILD_DIR) $(IPKG_LIBELF)
This page took 0.039576 seconds and 5 git commands to generate.