2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
10 PKG_NAME:=firmwarehotplug
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/linux-hotplug
16 PKG_MD5SUM:=e5cf352b172f498e27b160167b981f24
18 include $(INCLUDE_DIR)/package.mk
20 # workaround for fedora sdcc naming changes
21 ifneq ($(wildcard /usr/libexec/sdcc),)
22 export PATH:=$(PATH):/usr/libexec
25 define Package/firmwarehotplug
28 DEPENDS:=@USB_SUPPORT +fxload
29 TITLE:=Hotplug firmware for EZ-USB microcontrollers
30 URL:=http://linux-hotplug.sourceforge.net/
34 $(call Build/Compile/Default, \
35 OPT="$(TARGET_CFLAGS)" \
36 -C $(PKG_BUILD_DIR)/ezusb/midi/original \
37 DESTDIR="$(PKG_INSTALL_DIR)" \
42 define Package/firmwarehotplug/install
43 $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
44 install -m755 $(PKG_BUILD_DIR)/ezusb/midi/original/Hotplug/ezusbmidi $(1)/etc/hotplug.d/usb
45 install -m644 $(PKG_BUILD_DIR)/ezusb/midi/original/Hotplug/ezusbmidi.usermap $(1)/etc/hotplug.d
46 $(INSTALL_DIR) $(1)/usr/share/usb/ezusbmidi
47 install -m644 $(PKG_BUILD_DIR)/ezusb/midi/original/ezusbmidi1x1.ihx $(1)/usr/share/usb/ezusbmidi
48 install -m644 $(PKG_BUILD_DIR)/ezusb/midi/original/ezusbmidi2x2.ihx $(1)/usr/share/usb/ezusbmidi
51 $(eval $(call BuildPackage,firmwarehotplug))
53 define Require/working-sdcc
54 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
57 $(eval $(call RequireCommand,sdcc, \
58 $(PKG_NAME) requires the SDCC Cross Compiler (sdcc). \
61 $(eval $(call Require,working-sdcc, \
62 $(PKG_NAME) requires a SDCC Cross Compiler (sdcc) that supports the following targets : \
63 mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08. You might consider \
64 installing the non-free version. \