developer | fd40db2 | 2021-04-29 10:08:25 +0800 | [diff] [blame] | 1 | # |
developer | 477578e | 2022-11-16 17:08:16 +0800 | [diff] [blame] | 2 | # SPDX-License-Identifier: GPL-2.0 |
developer | fd40db2 | 2021-04-29 10:08:25 +0800 | [diff] [blame] | 3 | # |
| 4 | |
| 5 | include $(TOPDIR)/rules.mk |
| 6 | |
| 7 | PKG_NAME:=switch |
| 8 | PKG_RELEASE:=1 |
| 9 | |
| 10 | PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) |
| 11 | include $(INCLUDE_DIR)/package.mk |
| 12 | include $(INCLUDE_DIR)/kernel.mk |
| 13 | |
| 14 | define Package/switch |
| 15 | SECTION:=MTK Properties |
| 16 | CATEGORY:=MTK Properties |
| 17 | DEPENDS:=+libnl-tiny |
| 18 | TITLE:=Command to config switch |
| 19 | SUBMENU:=Applications |
| 20 | endef |
| 21 | |
| 22 | define Package/switch/description |
| 23 | An program to config switch. |
| 24 | endef |
| 25 | |
| 26 | TARGET_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 | |
| 33 | define 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" |
| 38 | endef |
| 39 | |
| 40 | define 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 |
| 44 | endef |
| 45 | |
| 46 | $(eval $(call BuildPackage,switch)) |