tools: libelf: install pkg-config file
[oweals/openwrt.git] / tools / libelf / Makefile
1 #
2 # Copyright (C) 2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=libelf
11 PKG_VERSION:=0.8.13
12 PKG_HASH:=591a9b4ec81c1f2042a97aa60564e0cb79d041c52faa7416acb38bc95bd2c76d
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:= \
17         http://distfiles.gentoo.org/distfiles/ \
18         http://distcache.freebsd.org/ports-distfiles/
19 HOST_BUILD_PARALLEL:=1
20
21 include $(INCLUDE_DIR)/host-build.mk
22
23 HOST_CONFIGURE_ARGS += \
24         --disable-shared \
25         --enable-elf64
26
27 define Host/Configure
28         (cd $(HOST_BUILD_DIR)/$(3); \
29                 $(HOST_CONFIGURE_CMD) \
30                 $(HOST_CONFIGURE_ARGS); \
31         )
32 endef
33
34
35 define Host/Compile
36         +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/lib/ libelf.a
37 endef
38
39 define Host/Install
40         $(INSTALL_DIR) $(STAGING_DIR_HOST)/{lib/pkgconfig,include/libelf}
41         $(CP) $(HOST_BUILD_DIR)/lib/{elf_repl.h,gelf.h,libelf.h,nlist.h,sys_elf.h} \
42                                                 $(STAGING_DIR_HOST)/include/libelf/
43         $(CP) $(HOST_BUILD_DIR)/lib/libelf.a $(STAGING_DIR_HOST)/lib/
44         $(CP) $(HOST_BUILD_DIR)/libelf.pc $(STAGING_DIR_HOST)/lib/pkgconfig/
45 endef
46
47 define Host/Clean
48         rm -rf $(STAGING_DIR_HOST)/include/libelf
49         rm -f $(STAGING_DIR_HOST)/lib/libelf.a
50         rm -f $(STAGING_DIR_HOST)/lib/pkgconfig/libelf.pc
51         $(call Host/Clean/Default)
52 endef
53
54 $(eval $(call HostBuild))