3a99bfa4cea2423f9b083bbc59c5716da5b80a32
[openwrt/svn-archive/archive.git] / libs / zaptel-1.4.x / Makefile
1 #
2 # Copyright (C) 2006 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: Makefile 5624 2006-11-23 00:29:07Z nbd $
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=zaptel
13 PKG_VERSION:=1.4.9.2
14 PKG_RELEASE:=1
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=http://ftp.digium.com/pub/zaptel/releases/
18 PKG_MD5SUM:=f6af404cc0244b93a2fc88b237f374bd
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/zaptel14/Default
23 TITLE:=Zaptel
24 URL:=http://ftp.digium.com/pub/zaptel/releases
25 endef
26
27 define KernelPackage/zaptel14
28 SUBMENU:=Other modules
29 $(call Package/zaptel14/Default)
30 TITLE+= (kernel module)
31 VERSION:=$(LINUX_VERSION)-$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE)
32 FILES:=$(PKG_BUILD_DIR)/kernel/zaptel.$(LINUX_KMOD_SUFFIX) \
33 $(PKG_BUILD_DIR)/kernel/ztdummy.$(LINUX_KMOD_SUFFIX)
34 AUTOLOAD:=$(call AutoLoad,70,zaptel ztdummy)
35 endef
36
37 define KernelPackage/zaptel14/description
38 This package contains the Zaptel core module and ztdummy driver.
39 endef
40
41 define Package/zaptel14-util
42 $(call Package/zaptel14/Default)
43 SECTION:=utils
44 CATEGORY:=Utilities
45 TITLE+= utils
46 DEPENDS := +kmod-zaptel14
47 endef
48
49 define Package/zaptel14-util/description
50 This package contains the zttest program
51 endef
52
53 define Package/zaptel14-libtonezone
54 $(call Package/zaptel14/Default)
55 SECTION:=libs
56 CATEGORY:=Libraries
57 TITLE+= libtonezone (library)
58 DEPENDS := +kmod-zaptel14
59 endef
60
61 define Package/zaptel14-libtonezone/description
62 This package contains the libraries for accessing zaptel/dummy drivers.
63 endef
64
65 define Build/Compile/zaptel14-template
66 $(MAKE) -C $(PKG_BUILD_DIR) \
67 DESTDIR="$(PKG_INSTALL_DIR)" \
68 ARCH="$(LINUX_KARCH)" \
69 LD="$(TARGET_CROSS)ld" \
70 AR="$(TARGET_CROSS)ar" \
71 HOSTCC="$(HOSTCC)" \
72 DEB_HOST_GNU_TYPE="$(ARCH)" \
73 KVERS="$(LINUX_VERSION)" \
74 KSRC="$(LINUX_DIR)" \
75 $(1)
76 endef
77
78 define Build/Compile/zaptel14
79 $(call Build/Compile/zaptel14-template, \
80 CC="$(KERNEL_CC)" \
81 KFLAGS_PPC="-G 0 -mno-abicalls -fno-pic -pipe -finline-limit=100000 -mabi=32 $(TARGET_CFLAGS) -mlong-calls -fno-common -nostdinc -iwithprefix include" \
82 TOPDIR_MODULES="zaptel ztdummy" \
83 SUBDIR_MODULES="" \
84 modules zttest \
85 )
86 endef
87
88 define Build/Compile/zaptel14-libtonezone
89 $(call Build/Compile/zaptel14-template, \
90 CC="$(TARGET_CC)" \
91 install-libs install-include \
92 )
93 endef
94
95 define Build/Compile
96 $(call Build/Compile/zaptel14)
97 $(call Build/Compile/zaptel14-libtonezone)
98 endef
99
100 define Build/InstallDev
101 $(INSTALL_DIR) $(STAGING_DIR)/usr/include/zaptel/
102 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/zaptel/zaptel.h $(STAGING_DIR)/usr/include/zaptel/
103 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/zaptel/tonezone.h $(STAGING_DIR)/usr/include/zaptel/
104 $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/
105 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libtonezone* $(STAGING_DIR)/usr/lib/
106 endef
107
108 define Package/zaptel14-util/install
109 $(INSTALL_DIR) $(1)/usr/bin
110 $(INSTALL_BIN) $(PKG_BUILD_DIR)/zttest $(1)/usr/bin/
111 endef
112
113 define Package/zaptel14-libtonezone/install
114 $(INSTALL_DIR) $(1)/usr/lib
115 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libtonezone.so.* $(1)/usr/lib/
116 endef
117
118 $(eval $(call KernelPackage,zaptel14))
119 $(eval $(call BuildPackage,zaptel14-util))
120 $(eval $(call BuildPackage,zaptel14-libtonezone))