summaryrefslogtreecommitdiff
path: root/package/ramips/applications/hwnat/Makefile
blob: 77a2eadef3f3febc39b3c596694c6b87fcd5c166 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#
# hua.shao@mediatek.com
#
# MTK Property Software.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=hwnat
PKG_RELEASE:=4200

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_KCONFIG:=RALINK_MT7620 RALINK_MT7621 RALINK_MT7628 RALINK_MT7623 HNAT_V2
PKG_CONFIG_DEPENDS:=$(foreach c, $(PKG_KCONFIG),$(if $(CONFIG_$c),CONFIG_$(c)))


include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk

define Package/hwnat
  SECTION:=MTK Properties
  CATEGORY:=MTK Properties
  TITLE:=Hardware NAT command
  DEPENDS:=@PACKAGE_kmod-hw_nat
  SUBMENU:=Applications
endef

define Package/hwnat/description
  An program to query info from hwnat driver
endef

define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	$(CP) ./src/* $(PKG_BUILD_DIR)/
endef

TARGET_CFLAGS += \
	-I$(LINUX_DIR)/include \
	-I$(LINUX_DIR)/arch/mips/include \
	-I$(LINUX_DIR)/net/nat/hw_nat/ \
        $(foreach c, $(PKG_KCONFIG),$(if $(CONFIG_$c),-DCONFIG_$(c)=$(CONFIG_$c)))

MAKE_FLAGS += \
	CFLAGS="$(TARGET_CFLAGS)"


define Build/Configure
endef

define Package/hwnat/install
	$(INSTALL_DIR) $(1)/bin
	$(INSTALL_DIR) $(1)/etc/init.d/
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/ac $(1)/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/acl $(1)/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/hwnat $(1)/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/mtr $(1)/bin
	$(INSTALL_BIN) ./files/* $(1)/etc/init.d
endef


$(eval $(call BuildPackage,hwnat))