source: packages/libs/zaptel-1.4.x/Makefile @ 26236

Last change on this file since 26236 was 26236, checked in by cshore, 5 years ago

[libs] zaptel-1.4.x: Build more of the utils for testing and configureing Zaptel cards.

File size: 4.7 KB
Line 
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
8include $(TOPDIR)/rules.mk
9include $(INCLUDE_DIR)/kernel.mk
10
11PKG_NAME:=zaptel
12PKG_VERSION:=1.4.12.1
13PKG_RELEASE:=4
14
15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/zaptel/releases/ \
17        http://ftp.digium.com/pub/zaptel/releases/
18PKG_MD5SUM:=71e83a020b020fa60905edecf70e95a3
19
20include $(INCLUDE_DIR)/package.mk
21
22define Package/zaptel14/Default
23  TITLE:=Zaptel
24  URL:=http://ftp.digium.com/pub/zaptel/releases
25endef
26
27define KernelPackage/zaptel14/Default
28  TITLE:=Zaptel (kernel module)
29  SUBMENU:=Other modules
30endef
31
32define KernelPackage/zaptel14
33  $(call KernelPackage/zaptel14/Default)
34  TITLE:=Zaptel (kernel module)
35  FILES:=$(PKG_BUILD_DIR)/kernel/zaptel.$(LINUX_KMOD_SUFFIX)
36  AUTOLOAD:=$(call AutoLoad,70,zaptel)
37endef
38
39define KernelPackage/zaptel14/description
40 This package contains the Zaptel core module.  No longer includes ztdummy
41 because it is not needed in all cases (and is in fact broken on x86).
42endef
43
44
45define KernelPackage/zaptel14-dummy
46  $(call KernelPackage/zaptel14/Default)
47  TITLE:=Zaptel Dummy (timer; kernel module)
48  DEPENDS += +kmod-zaptel14 @TARGET_x86:@BROKEN
49  FILES:=$(PKG_BUILD_DIR)/kernel/ztdummy.$(LINUX_KMOD_SUFFIX)
50  AUTOLOAD:=$(call AutoLoad,71,ztdummy)
51endef
52
53define KernelPackage/zaptel14/description
54 This package contains the Zaptel ztdummy driver.  Broken on x86 due to lack
55 of RTC on some hardware.
56endef
57
58define KernelPackage/zaptel14-wcusb
59  $(call KernelPackage/zaptel14/Default)
60  DEPENDS += +kmod-zaptel14
61  FILES:=$(PKG_BUILD_DIR)/kernel/wcusb.$(LINUX_KMOD_SUFFIX)
62  AUTOLOAD:=$(call AutoLoad,72,wcusb)
63endef
64
65define KernelPackage/zaptel14-wcusb/description
66 This package contains the Zaptel S100U usb driver.
67endef
68
69define KernelPackage/zaptel14-wctdm
70  $(call KernelPackage/zaptel14/Default)
71  DEPENDS += +kmod-zaptel14
72  FILES:=$(PKG_BUILD_DIR)/kernel/wctdm.$(LINUX_KMOD_SUFFIX)
73  AUTOLOAD:=$(call AutoLoad,72,wctdm)
74endef
75
76define KernelPackage/zaptel14-wctdm/description
77 This package contains the Zaptel wctdm driver.
78endef
79
80define Package/zaptel14-util
81  $(call Package/zaptel14/Default)
82  SECTION:=utils
83  CATEGORY:=Utilities
84  TITLE+= utils
85  DEPENDS += +kmod-zaptel14 +zaptel14-libtonezone +libnewt
86endef
87
88define Package/zaptel14-util/description
89 This package contains the zaptel utils.
90endef
91
92define Package/zaptel14-libtonezone
93  $(call Package/zaptel14/Default)
94  SECTION:=libs
95  CATEGORY:=Libraries
96  TITLE+= libtonezone (library)
97  DEPENDS += +kmod-zaptel14
98endef
99
100define Package/zaptel14-libtonezone/description
101 This package contains the libraries for accessing zaptel/dummy drivers.
102endef
103
104CONFIGURE_VARS += \
105        LDFLAGS="$$$$LDFLAGS -Wl,-rpath-link $(STAGING_DIR)/usr/lib"
106
107CONFIGURE_ARGS += \
108        --with-newt="$(STAGING_DIR)/usr" \
109        --without-curses \
110        --without-ncurses
111
112MAKE_FLAGS:= \
113        ARCH="$(LINUX_KARCH)" \
114        CC="$(TARGET_CC) $(TARGET_CFLAGS)" \
115        LD="$(TARGET_CROSS)ld" \
116        CROSS_COMPILE="$(TARGET_CROSS)" \
117        KVERS="$(LINUX_VERSION)" \
118        KSRC="$(LINUX_DIR)" \
119        TOPDIR_MODULES="zaptel ztdummy wcusb wctdm" \
120        SUBDIR_MODULES=""
121
122define Build/Compile/kmod
123        $(MAKE) -C $(PKG_BUILD_DIR) \
124                $(MAKE_FLAGS) \
125                modules
126endef
127
128define Build/Compile/user
129        $(MAKE) -C $(PKG_BUILD_DIR) \
130                ARCH="$(LINUX_KARCH)" \
131                DESTDIR="$(PKG_INSTALL_DIR)" \
132                install-libs install-include zttest ztcfg zttool ztdiag fxotune ztmonitor ztscan ztspeed fxstest
133endef
134
135define Build/Compile
136        $(call Build/Compile/kmod)
137        $(call Build/Compile/user)
138endef
139
140define Build/InstallDev
141        $(INSTALL_DIR)  $(STAGING_DIR)/usr/include
142        $(CP) $(PKG_INSTALL_DIR)/usr/include/zaptel $(STAGING_DIR)/usr/include/
143        $(INSTALL_DIR)  $(STAGING_DIR)/usr/lib
144        $(CP)  $(PKG_INSTALL_DIR)/usr/lib/libtonezone.* $(STAGING_DIR)/usr/lib/
145endef
146
147define Package/zaptel14-util/install
148        $(INSTALL_DIR) $(1)/usr/bin
149        $(INSTALL_BIN) $(PKG_BUILD_DIR)/zttest $(1)/usr/bin/
150        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ztcfg $(1)/usr/bin/
151        $(INSTALL_BIN) $(PKG_BUILD_DIR)/zttool $(1)/usr/bin/
152        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ztdiag $(1)/usr/bin/
153        $(INSTALL_BIN) $(PKG_BUILD_DIR)/fxotune $(1)/usr/bin/
154        $(INSTALL_BIN) $(PKG_BUILD_DIR)/fxstest $(1)/usr/bin/
155        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ztmonitor $(1)/usr/bin/
156        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ztscan $(1)/usr/bin/
157        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ztspeed $(1)/usr/bin/
158endef
159
160define Package/zaptel14-libtonezone/install
161        $(INSTALL_DIR) $(1)/usr/lib
162        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtonezone.so.* $(1)/usr/lib/
163endef
164
165$(eval $(call KernelPackage,zaptel14))
166$(eval $(call KernelPackage,zaptel14-dummy))
167$(eval $(call KernelPackage,zaptel14-wcusb))
168$(eval $(call KernelPackage,zaptel14-wctdm))
169$(eval $(call BuildPackage,zaptel14-util))
170$(eval $(call BuildPackage,zaptel14-libtonezone))
Note: See TracBrowser for help on using the repository browser.