[packages] utils/gadgetfs-test: fix PKG_BUILD_DIR
[openwrt/svn-archive/archive.git] / utils / gadgetfs-test / 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 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=gadgetfs-test
12 PKG_VERSION:=2007-11-29
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME).tar.bz2
16 PKG_SOURCE_URL:=http://avr32linux.org/twiki/pub/Main/GadgetFsTest
17 PKG_MD5SUM:=49476a74c29f1281c8a4c035aa57a5bd
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
20 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/gadgetfs-test
25 SECTION:=utils
26 CATEGORY:=Utilities
27 TITLE:=Test program for gadgetfs
28 DEPENDS:=@DEVEL +libpthread
29 URL:=http://linux-usb.org/gadget
30 endef
31
32 define Package/gadgetfs-test/description
33 Test program for gadgetfs from linux-usb.org.
34 endef
35
36 define Package/gadgetfs-test-bulk
37 $(call Package/gadgetfs-test)
38 TITLE+= (BULK transfer)
39 endef
40
41 define Package/gadgetfs-test-bulk/description
42 $(call Package/gadgetfs-test/description)
43 This package is built with BULK transfer support.
44 endef
45
46 define Package/gadgetfs-test-isoc
47 $(call Package/gadgetfs-test)
48 DEPENDS+= +libaio
49 TITLE+= (ISOCHRONOUS transfer)
50 endef
51
52 define Package/gadgetfs-test-isoc/description
53 $(call Package/gadgetfs-test/description)
54 This package is built with ISOCHRONOUS transfer support using libaio.
55 endef
56
57
58 GADGETFS_CFLAGS:=$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)
59 GADGETFS_LDFLAGS:=$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)
60 GADGETFS_LIBS:=-lpthread
61
62 define Build/Template
63
64 $(STAMP_BUILT)-$(1): $(STAMP_PREPARED)
65 -$(MAKE) -C $(PKG_BUILD_DIR) clean
66 $(MAKE_VARS) \
67 $(MAKE) -C $(PKG_BUILD_DIR) \
68 $(TARGET_CONFIGURE_OPTS) \
69 CC="$(TARGET_CC)" \
70 LDFLAGS="$(GADGETFS_LDFLAGS)" \
71 $(2) \
72 all
73 mv -f $(PKG_BUILD_DIR)/gadgetfs-test $(PKG_BUILD_DIR)/gadgetfs-test-$(1)
74 touch $$@
75
76 $(STAMP_BUILT): $(STAMP_BUILT)-$(1)
77
78 define Package/gadgetfs-test-$(1)/install
79 $(INSTALL_DIR) $$(1)/usr/sbin
80 $(INSTALL_BIN) $$(PKG_BUILD_DIR)/gadgetfs-test-$(1) $$(1)/usr/sbin/
81 endef
82
83 endef
84
85 define Build/Configure
86 endef
87
88 define Build/Compile
89 endef
90
91 ifneq ($(SDK)$(CONFIG_PACKAGE_gadgetfs-test-bulk),)
92 define Build/bulk
93 $(call Build/Template,bulk, \
94 CFLAGS="$(GADGETFS_CFLAGS)" \
95 LIBS="$(GADGETFS_LIBS)" \
96 )
97 endef
98 endif
99 $(eval $(Build/bulk))
100
101 ifneq ($(SDK)$(CONFIG_PACKAGE_gadgetfs-test-isoc),)
102 define Build/isoc
103 $(call Build/Template,isoc, \
104 CFLAGS="$(GADGETFS_CFLAGS) -DAIO" \
105 LIBS="$(GADGETFS_LIBS) -laio" \
106 )
107 endef
108 endif
109 $(eval $(Build/isoc))
110
111 $(eval $(call BuildPackage,gadgetfs-test-bulk))
112 $(eval $(call BuildPackage,gadgetfs-test-isoc))
113