31e2eaf0a8254ff13535f667780a921a3bca2bf2
[openwrt/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,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 endef
45
46 define Host/Clean
47 rm -rf $(STAGING_DIR_HOST)/include/libelf
48 rm -f $(STAGING_DIR_HOST)/lib/libelf.a
49 $(call Host/Clean/Default)
50 endef
51
52 $(eval $(call HostBuild))