developer | fd40db2 | 2021-04-29 10:08:25 +0800 | [diff] [blame] | 1 | # |
| 2 | # hua.shao@mediatek.com |
| 3 | # |
| 4 | # MTK Property Software. |
| 5 | # |
| 6 | |
| 7 | include $(TOPDIR)/rules.mk |
| 8 | |
| 9 | PKG_NAME:=switch |
| 10 | PKG_RELEASE:=1 |
| 11 | |
| 12 | PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) |
| 13 | include $(INCLUDE_DIR)/package.mk |
| 14 | include $(INCLUDE_DIR)/kernel.mk |
| 15 | |
| 16 | define Package/switch |
| 17 | SECTION:=MTK Properties |
| 18 | CATEGORY:=MTK Properties |
| 19 | DEPENDS:=+libnl-tiny |
| 20 | TITLE:=Command to config switch |
| 21 | SUBMENU:=Applications |
| 22 | endef |
| 23 | |
| 24 | define Package/switch/description |
| 25 | An program to config switch. |
| 26 | endef |
| 27 | |
| 28 | TARGET_CPPFLAGS := \ |
| 29 | -D_GNU_SOURCE \ |
| 30 | -I$(LINUX_DIR)/user_headers/include \ |
| 31 | -I$(STAGING_DIR)/usr/include/libnl-tiny \ |
| 32 | -I$(PKG_BUILD_DIR) \ |
| 33 | $(TARGET_CPPFLAGS) \ |
| 34 | |
| 35 | define Build/Compile |
| 36 | CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \ |
| 37 | $(MAKE) -C $(PKG_BUILD_DIR) \ |
| 38 | $(TARGET_CONFIGURE_OPTS) \ |
| 39 | LIBS="$(TARGET_LDFLAGS) -lnl-tiny -lm" |
| 40 | endef |
| 41 | |
| 42 | define Package/switch/install |
| 43 | $(INSTALL_DIR) $(1)/usr/sbin |
| 44 | $(INSTALL_DIR) $(1)/lib/network |
| 45 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/switch $(1)/usr/sbin |
| 46 | endef |
| 47 | |
| 48 | $(eval $(call BuildPackage,switch)) |