replace lots of manual install commands with INSTALL_* variables
[packages.git] / libs / libelf / Makefile
1
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=libelf
12 PKG_VERSION:=0.8.8
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.mr511.de/software/
17 PKG_MD5SUM:=be84e553686dd50c8b6d520f86f46521
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libelf
26   SECTION:=libs
27   CATEGORY:=Libraries
28   TITLE:=ELF object file access library
29   URL:=http://www.stud.uni-hannover.de/~michael/software/
30 endef
31
32 define Build/Configure
33         $(call Build/Configure/Default, \
34                 --enable-shared \
35                 --enable-static \
36                 --enable-elf64=yes \
37                 , \
38                 mr_cv_target_elf=yes \
39                 libelf_64bit=yes \
40                 libelf_cv_struct_elf64_ehdr=yes \
41                 libelf_cv_type_elf64_addr=no \
42                 libelf_cv_struct_elf64_rel=yes \
43         )
44 endef
45
46 define Build/Compile
47         $(MAKE) -C $(PKG_BUILD_DIR) \
48                 instroot="$(PKG_INSTALL_DIR)" \
49                 all install
50 endef
51
52 define Build/InstallDev
53         mkdir -p $(STAGING_DIR)/usr/include
54         $(CP) $(PKG_INSTALL_DIR)/usr/include/libelf* $(STAGING_DIR)/usr/include/
55         mkdir -p $(STAGING_DIR)/usr/lib
56         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf.{a,so*} $(STAGING_DIR)/usr/lib/
57 endef
58
59 define Build/UninstallDev
60         rm -rf \
61                 $(STAGING_DIR)/usr/include/libelf* \
62                 $(STAGING_DIR)/usr/lib/libelf.{a,so*}
63 endef
64
65 define Package/libelf/install
66         $(INSTALL_DIR) $(1)/usr/lib
67         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf.so.* $(1)/usr/lib/
68 endef
69
70 $(eval $(call BuildPackage,libelf))