Ticket #8936: Makefile

File Makefile, 2.3 KB (added by anonymous, 7 years ago)
Line 
1#
2# Copyright (C) 2011 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
9
10PKG_NAME:=asterisk16-chan-datacard
11PKG_REV:=286
12PKG_VERSION:=1.0.r$(PKG_REV)
13PKG_RELEASE:=170
14
15#PKG_SOURCE_URL:=http://datacard.googlecode.com/svn/trunk/
16#PKG_SOURCE_VERSION:=$(PKG_RELEASE)
17#PKG_SOURCE_PROTO:=svn
18# or
19PKG_SOURCE:=chan_datacard-$(PKG_VERSION).tgz
20PKG_SOURCE_URL=http://datacard.googlecode.com/files/
21PKG_MD5SUM:=6697fece15734f061834cd84182b46d1
22
23PKG_SOURCE_SUBDIR:=chan_datacard-$(PKG_VERSION)
24PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
25
26WITH_ASTERISK=asterisk-1.6.2.14
27
28include $(INCLUDE_DIR)/package.mk
29
30define Package/asterisk16-chan-datacard
31        SUBMENU:=asterisk16 (Complete Open Source PBX), v1.6.x
32        SECTION:=net
33        CATEGORY:=Network
34        URL:=http://www.asterisk.org/
35        MAINTAINER:=Hans Zandbelt <hans.zandbelt@gmail.com>
36        DEPENDS:= +asterisk16 +libiconv
37        TITLE:=Huawei UMTS 3G datacards support
38endef
39
40define Package/asterisk16-chan-datacard/description
41        Asterisk channel driver for Huawei UMTS 3G datacards
42endef
43
44MAKE_ARGS:= \
45        CC="$(TARGET_CC)" \
46        LD="$(TARGET_CC)" \
47        CFLAGS="$(TARGET_CFLAGS) -DLOW_MEMORY -D_GNU_SOURCE $(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/lib/libiconv/include -I$(BUILD_DIR)/$(WITH_ASTERISK)/include -DHAVE_CONFIG_H -I." \
48        LDFLAGS="$(TARGET_LDFLAGS)" \
49        DESTDIR="$(PKG_INSTALL_DIR)/usr/lib/asterisk/modules"
50
51# for svn
52#        (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
53#                        autoconf \
54#                                );
55#        $(call Build/Configure/Default)
56
57define Build/Configure
58        $(call Build/Configure/Default, \
59            --with-asterisk=$(BUILD_DIR)/$(WITH_ASTERISK)/include \
60            $(MAKE_ARGS) \
61        )
62endef
63
64define Build/Compile
65        mkdir -p $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules
66        $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_ARGS) all install
67endef
68
69define Package/asterisk16-chan-datacard/conffiles
70/etc/asterisk/datacard.conf
71endef
72
73define Package/asterisk16-chan-datacard/install
74        $(INSTALL_DIR) $(1)/etc/asterisk
75        $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/datacard.conf $(1)/etc/asterisk/
76        $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
77        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_datacard.so $(1)/usr/lib/asterisk/modules/
78endef
79
80$(eval $(call BuildPackage,asterisk16-chan-datacard))