17bc11f63ebeb532fe55f410abb5aa1b858472a1
[packages.git] / utils / firmwarehotplug / Makefile
1 #
2 # Copyright (C) 2006-2009 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:=firmwarehotplug
11 PKG_VERSION:=0.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/linux-hotplug
16 PKG_MD5SUM:=e5cf352b172f498e27b160167b981f24
17
18 PKG_INSTALL:=1
19 PKG_BUILD_PARALLEL:=1
20
21 include $(INCLUDE_DIR)/package.mk
22
23 # workaround for fedora sdcc naming changes
24 ifneq ($(wildcard /usr/libexec/sdcc),)
25   export PATH:=$(PATH):/usr/libexec
26 endif
27
28 define Package/firmwarehotplug
29   SECTION:=utils
30   CATEGORY:=Utilities
31   DEPENDS:=@USB_SUPPORT +fxload
32   TITLE:=Hotplug firmware for EZ-USB microcontrollers
33   URL:=http://linux-hotplug.sourceforge.net/
34 endef
35
36 MAKE_PATH:=ezusb/midi/original
37
38 MAKE_FLAGS+=\
39         OPT="$(TARGET_CFLAGS)"
40
41 define Package/firmwarehotplug/install
42         $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
43         install -m755 $(PKG_BUILD_DIR)/ezusb/midi/original/Hotplug/ezusbmidi $(1)/etc/hotplug.d/usb
44         install -m644 $(PKG_BUILD_DIR)/ezusb/midi/original/Hotplug/ezusbmidi.usermap $(1)/etc/hotplug.d
45         $(INSTALL_DIR) $(1)/usr/share/usb/ezusbmidi
46         install -m644 $(PKG_BUILD_DIR)/ezusb/midi/original/ezusbmidi1x1.ihx $(1)/usr/share/usb/ezusbmidi
47         install -m644 $(PKG_BUILD_DIR)/ezusb/midi/original/ezusbmidi2x2.ihx $(1)/usr/share/usb/ezusbmidi
48 endef
49
50 define Require/working-sdcc
51         sdcc -v 2>&1 | awk '($$$$1 == "SDCC") && ($$$$3 == "mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08") { print "ok" }' | grep ok > /dev/null
52 endef
53
54 $(eval $(call RequireCommand,sdcc, \
55         $(PKG_NAME) requires the SDCC Cross Compiler (sdcc). \
56 ))
57
58 $(eval $(call Require,working-sdcc, \
59         $(PKG_NAME) requires a SDCC Cross Compiler (sdcc) that supports the following targets : \
60         mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08. You might consider \
61         installing the non-free version. \
62 ))
63
64 $(eval $(call BuildPackage,firmwarehotplug))
65