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