blob: b66218693aa88167edc3912515112b0fc3f18bf4 [file] [log] [blame]
developerfd40db22021-04-29 10:08:25 +08001#
developer477578e2022-11-16 17:08:16 +08002# SPDX-License-Identifier: GPL-2.0
developerfd40db22021-04-29 10:08:25 +08003#
4
5include $(TOPDIR)/rules.mk
6
7PKG_NAME:=switch
8PKG_RELEASE:=1
9
10PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
11include $(INCLUDE_DIR)/package.mk
12include $(INCLUDE_DIR)/kernel.mk
13
14define Package/switch
15 SECTION:=MTK Properties
16 CATEGORY:=MTK Properties
17 DEPENDS:=+libnl-tiny
18 TITLE:=Command to config switch
19 SUBMENU:=Applications
20endef
21
22define Package/switch/description
23 An program to config switch.
24endef
25
26TARGET_CPPFLAGS := \
27 -D_GNU_SOURCE \
28 -I$(LINUX_DIR)/user_headers/include \
29 -I$(STAGING_DIR)/usr/include/libnl-tiny \
30 -I$(PKG_BUILD_DIR) \
31 $(TARGET_CPPFLAGS) \
32
33define Build/Compile
34 CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
35 $(MAKE) -C $(PKG_BUILD_DIR) \
36 $(TARGET_CONFIGURE_OPTS) \
37 LIBS="$(TARGET_LDFLAGS) -lnl-tiny -lm"
38endef
39
40define Package/switch/install
41 $(INSTALL_DIR) $(1)/usr/sbin
42 $(INSTALL_DIR) $(1)/lib/network
43 $(INSTALL_BIN) $(PKG_BUILD_DIR)/switch $(1)/usr/sbin
44endef
45
46$(eval $(call BuildPackage,switch))