[package] Add cwiid package
[openwrt/svn-archive/archive.git] / utils / cwiid / 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:=cwiid
11 PKG_VERSION:=0.6.00
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
15 PKG_SOURCE_URL:=http://abstrakraft.org/cwiid/downloads/
16 PKG_SOURCE_VERSION:=2100f14c612471084434b364501e3818c7f4144e
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/libcwiid
21 SECTION:=libs
22 CATEGORY:=Libraries
23 DEPENDS:=+bluez-libs
24 TITLE:=Linux Nintendo Wiimote interface
25 URL:=http://abstrakraft.org/cwiid/
26 endef
27
28 define Package/wminput
29 SECTION:=utils
30 CATEGORY:=Utilities
31 DEPENDS:=+libcwiid
32 TITLE:=Linux Nintendo Wiimote interface
33 URL:=http://abstrakraft.org/cwiid/
34 endef
35
36 CONFIGURE_ARGS += \
37 --without-python \
38 --disable-ldconfig \
39 --enable-shared \
40
41 TARGET_CFLAGS += $(FPIC)
42
43 define Build/Prepare
44 $(call Build/Prepare/Default)
45 ( cd $(PKG_BUILD_DIR) ; \
46 autoconf ; \
47 )
48 endef
49
50 define Build/Compile
51 $(MAKE) -C "$(PKG_BUILD_DIR)" \
52 CC="$(TARGET_CC)" \
53 OFLAGS="$(TARGET_CFLAGS)" \
54 CPPFLAGS="$(TARGET_CPPFLAGS)" \
55 LDFLAGS="$(TARGET_LDFLAGS) -L../libcwiid/" \
56 all
57 endef
58
59 define Build/InstallDev
60 mkdir -p $(1)/usr/include/
61 $(CP) $(PKG_BUILD_DIR)/libcwiid/*.h $(1)/usr/include/
62 mkdir -p $(1)/usr/lib/
63 $(CP) $(PKG_BUILD_DIR)/libcwiid/*.so $(1)/usr/lib/
64 endef
65
66 define Package/libcwiid/install
67 $(INSTALL_DIR) $(1)/usr/lib
68 $(CP) $(PKG_BUILD_DIR)/libcwiid/libcwiid.so.1.0 $(1)/usr/lib/
69 endef
70
71 define Package/wminput/install
72 $(INSTALL_DIR) $(1)/usr/bin
73 $(CP) $(PKG_BUILD_DIR)/wminput/wminput $(1)/usr/bin/
74 $(CP) $(PKG_BUILD_DIR)/lswm/lswm $(1)/usr/bin/
75 endef
76
77 $(eval $(call BuildPackage,libcwiid))
78 $(eval $(call BuildPackage,wminput))