this patch fixes libupnp parallel build and cleans the Makefile a
[openwrt/svn-archive/archive.git] / libs / libupnp / Makefile
1 #
2 # Copyright (C) 2006-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:=libupnp
11 PKG_VERSION:=1.6.6
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@SF/pupnp
16 PKG_MD5SUM:=8918dcf7428cd119d0c8275765ff2833
17
18 PKG_FIXUP:=libtool
19 PKG_INSTALL:=1
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/libupnp/Default
24 SECTION:=libs
25 CATEGORY:=Libraries
26 URL:=http://pupnp.sourceforge.net/
27 endef
28
29 define Package/libupnp
30 $(call Package/libupnp/Default)
31 DEPENDS:=+libpthread
32 TITLE:=UPnP SDK library
33 MENU:=1
34 endef
35
36 define Package/libupnp/description
37 The portable SDK for UPnP Devices (libupnp) provides developers with an API and
38 open source code for building control points, devices, and bridges that are
39 compliant with Version 1.0 of the Universal Plug and Play Device Architecture
40 Specification.
41 endef
42
43 define Package/libupnp-sample
44 $(call Package/libupnp/Default)
45 DEPENDS:=libupnp
46 TITLE:=UPnP sample applications
47 endef
48
49 define Package/libupnp-sample/description
50 TVcontrolpoint & tvdevice sample applications run inside /etc/upnp-tvdevice/
51 endef
52
53 define Build/Configure
54 $(call Build/Configure/Default, \
55 --enable-shared \
56 --enable-static \
57 );
58 endef
59
60 TARGET_CFLAGS += $(FPIC)
61
62 define Build/Compile/libupnp-sample
63 $(MAKE) -C $(PKG_BUILD_DIR) \
64 DESTDIR="$(PKG_INSTALL_DIR)" \
65 check
66 $(MAKE) -C $(PKG_BUILD_DIR)/upnp/sample \
67 DESTDIR="$(PKG_INSTALL_DIR)" \
68 upnp_tv_device upnp_tv_ctrlpt
69 endef
70
71 define Build/InstallDev
72 $(INSTALL_DIR) $(1)/usr/include
73 $(CP) $(PKG_INSTALL_DIR)/usr/include/upnp $(1)/usr/include/
74 $(INSTALL_DIR) $(1)/usr/lib
75 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ixml,threadutil,upnp}.{a,so*,la} $(1)/usr/lib/
76 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
77 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libupnp.pc $(1)/usr/lib/pkgconfig/
78 endef
79
80 define Package/libupnp/install
81 $(INSTALL_DIR) $(1)/usr/lib
82 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ixml,threadutil,upnp}.so.* $(1)/usr/lib/
83 endef
84
85 define Package/libupnp-sample/install
86 $(INSTALL_DIR) $(1)/usr/bin
87 $(INSTALL_BIN) $(PKG_BUILD_DIR)/upnp/sample/upnp_tv_device $(1)/usr/bin
88 $(INSTALL_BIN) $(PKG_BUILD_DIR)/upnp/sample/upnp_tv_ctrlpt $(1)/usr/bin
89 $(INSTALL_DIR) $(1)/etc/upnp-tvdevice/web
90 $(CP) $(PKG_BUILD_DIR)/upnp/sample/web/* $(1)/etc/upnp-tvdevice
91 endef
92
93 $(eval $(call BuildPackage,libupnp))
94 $(eval $(call BuildPackage,libupnp-sample))