Makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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:=11
  10. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  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/Compile
  27. CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
  28. $(MAKE) -C $(PKG_BUILD_DIR) \
  29. $(TARGET_CONFIGURE_OPTS) \
  30. LIBS="$(TARGET_LDFLAGS) -lnl-tiny -lm -luci -lubox"
  31. endef
  32. define Build/InstallDev
  33. $(INSTALL_DIR) $(1)/usr/include
  34. $(CP) $(PKG_BUILD_DIR)/swlib.h $(1)/usr/include/
  35. $(INSTALL_DIR) $(1)/usr/lib
  36. $(CP) $(PKG_BUILD_DIR)/libsw.a $(1)/usr/lib/
  37. endef
  38. define Package/swconfig/install
  39. $(INSTALL_DIR) $(1)/sbin $(1)/lib/network
  40. $(INSTALL_BIN) $(PKG_BUILD_DIR)/swconfig $(1)/sbin/swconfig
  41. $(INSTALL_DATA) ./files/switch.sh $(1)/lib/network/
  42. endef
  43. $(eval $(call BuildPackage,swconfig))