ff403c62b57cd71e75a483cc7f01a303a64bbf3d
[packages.git] / libs / argtable / Makefile
1 #
2 # Copyright (C) 2007 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:=argtable
11 PKG_VERSION:=2.7
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)2-7.tar.gz
15 PKG_SOURCE_URL:=@SF/argtable
16 PKG_MD5SUM:=a84130293aab3bc09631cbee717ede93
17
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)2-7
19 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/argtable
24   SECTION:=libs
25   CATEGORY:=Libraries
26   TITLE:=A library for parsing GNU style command line options
27   URL:=http://argtable.sourceforge.net/
28 endef
29
30 define Package/argtable/description
31         Argtable is an ANSI C library for parsing GNU style command line options with a minimum of fuss. 
32         It enables a program's command line syntax to be defined in the source code as an array of argtable 
33         structs. The command line is then parsed according to that specification and the resulting values 
34         are returned in those same structs where they are accessible to the main program. Both tagged 
35         (-v, --verbose, --foo=bar) and untagged arguments are supported, as are multiple instances of 
36         each argument.
37 endef
38
39 CONFIGURE_ARGS += \
40         --enable-shared \
41         --enable-static \
42
43 MAKE_FLAGS += \
44         -C $(PKG_BUILD_DIR)/src \
45         DESTDIR="$(PKG_INSTALL_DIR)" \
46         all install \
47
48 define Build/InstallDev
49         mkdir -p $(1)/usr/include
50         $(CP) $(PKG_INSTALL_DIR)/usr/include/argtable2.h $(1)/usr/include/
51         mkdir -p $(1)/usr/lib
52         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libargtable2.{a,so*} $(1)/usr/lib/
53 endef
54
55 define Build/UninstallDev
56         rm -rf \
57         $(STAGING_DIR)/usr/include/argtable2.h \
58         $(STAGING_DIR)/usr/lib/libargtable2.{a,so*}
59 endef           
60
61 define Package/argtable/install
62         $(INSTALL_DIR) $(1)/usr/lib
63         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libargtable2.so.* $(1)/usr/lib/
64 endef
65
66 $(eval $(call BuildPackage,argtable))