Merge pull request #199 from micmac1/master
[feed/telephony.git] / net / asterisk-chan-lantiq / Makefile
1 #
2 # Copyright (C) 2017 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:=chan-lantiq
11 PKG_VERSION:=20170304
12 PKG_RELEASE:=1
13
14 PKG_LICENSE:=GPL-2.0
15 PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
16
17 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/$(PKG_NAME)/Default
22 SUBMENU:=Telephony
23 SECTION:=net
24 CATEGORY:=Network
25 TITLE:=Lantiq channel driver
26 URL:=https://github.com/kochstefan/asterisk_channel_lantiq
27 DEPENDS:=+kmod-ltq-vmmc
28 endef
29
30 define Package/asterisk13-$(PKG_NAME)
31 $(call Package/$(PKG_NAME)/Default)
32 DEPENDS+=asterisk13
33 VARIANT:=asterisk13
34 endef
35
36 define Package/description/Default
37 An implementation of a Lantiq TAPI channel driver for Asterisk.
38 endef
39
40 Package/asterisk13-$(PKG_NAME)/description = $(Package/description/Default)
41
42 define Package/conffiles/Default
43 /etc/asterisk/lantiq.conf
44 endef
45
46 Package/asterisk13-$(PKG_NAME)/conffiles = $(Package/conffiles/Default)
47
48 define Package/Install/Default
49 $(INSTALL_DIR) $(1)/etc/asterisk
50 $(INSTALL_CONF) ./files/lantiq-$(BUILD_VARIANT).conf.sample \
51 $(1)/etc/asterisk/lantiq.conf
52 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
53 $(INSTALL_BIN) $(PKG_BUILD_DIR)/chan_lantiq.so \
54 $(1)/usr/lib/asterisk/modules
55 endef
56
57 Package/asterisk13-$(PKG_NAME)/install = $(Package/Install/Default)
58
59 ifeq ($(BUILD_VARIANT),asterisk13)
60 CHAN_LANTIQ_AST_INCLUDES:=-I$(STAGING_DIR)/usr/include/asterisk-13/include
61 endif
62
63 define Build/Prepare
64 $(CP) ./files/chan_lantiq-$(BUILD_VARIANT).c $(PKG_BUILD_DIR)/chan_lantiq.c
65 $(CP) ./files/default.exports $(PKG_BUILD_DIR)/chan_lantiq.exports
66 endef
67
68 define Build/Configure
69 endef
70
71 define Build/Compile
72 cd $(PKG_BUILD_DIR) && \
73 $(TARGET_CC) -o chan_lantiq.o -c chan_lantiq.c -MD -MT chan_lantiq.o \
74 -MF .chan_lantiq.o.d -MP -pthread \
75 $(TARGET_CFLAGS) \
76 $(CHAN_LANTIQ_AST_INCLUDES) \
77 $(TARGET_CPPFLAGS) \
78 -Wall -Wstrict-prototypes -Wmissing-prototypes \
79 -Wmissing-declarations $(FPIC) -DAST_MODULE=\"chan_lantiq\" && \
80 $(TARGET_CC) -o chan_lantiq.so -pthread $(TARGET_LDFLAGS) -shared \
81 -Wl,--version-script,chan_lantiq.exports,--warn-common \
82 chan_lantiq.o
83 endef
84
85 $(eval $(call BuildPackage,asterisk13-$(PKG_NAME)))