Makefile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #
  2. # Copyright (C) 2008-2010 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=swconfig
  9. PKG_RELEASE:=10
  10. PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
  11. PKG_LICENSE:=GPL-2.0
  12. include $(INCLUDE_DIR)/package.mk
  13. include $(INCLUDE_DIR)/kernel.mk
  14. define Package/swconfig
  15. SECTION:=base
  16. CATEGORY:=Base system
  17. DEPENDS:=+libuci +libnl-tiny
  18. TITLE:=Switch configuration utility
  19. endef
  20. TARGET_CPPFLAGS := \
  21. -D_GNU_SOURCE \
  22. -I$(STAGING_DIR)/usr/include/libnl-tiny \
  23. -I$(PKG_BUILD_DIR) \
  24. $(TARGET_CPPFLAGS) \
  25. -I$(LINUX_DIR)/user_headers/include
  26. define Build/Prepare
  27. mkdir -p $(PKG_BUILD_DIR)
  28. $(CP) ./src/* $(PKG_BUILD_DIR)/
  29. endef
  30. define Build/Compile
  31. CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
  32. $(MAKE) -C $(PKG_BUILD_DIR) \
  33. $(TARGET_CONFIGURE_OPTS) \
  34. LIBS="$(TARGET_LDFLAGS) -lnl-tiny -lm -luci"
  35. endef
  36. define Package/swconfig/install
  37. $(INSTALL_DIR) $(1)/sbin $(1)/lib/network
  38. $(INSTALL_BIN) $(PKG_BUILD_DIR)/swconfig $(1)/sbin/swconfig
  39. $(INSTALL_DATA) ./files/switch.sh $(1)/lib/network/
  40. endef
  41. $(eval $(call BuildPackage,swconfig))