Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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:=12
  10. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  11. PKG_LICENSE:=GPL-2.0
  12. PKG_BUILD_FLAGS:=lto
  13. include $(INCLUDE_DIR)/package.mk
  14. include $(INCLUDE_DIR)/kernel.mk
  15. define Package/swconfig
  16. SECTION:=base
  17. CATEGORY:=Base system
  18. DEPENDS:=+libuci +libnl-tiny
  19. TITLE:=Switch configuration utility
  20. endef
  21. TARGET_CPPFLAGS := \
  22. -D_GNU_SOURCE \
  23. -I$(STAGING_DIR)/usr/include/libnl-tiny \
  24. -I$(PKG_BUILD_DIR) \
  25. $(TARGET_CPPFLAGS) \
  26. -I$(LINUX_DIR)/user_headers/include
  27. define Build/Compile
  28. CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
  29. $(MAKE) -C $(PKG_BUILD_DIR) \
  30. $(TARGET_CONFIGURE_OPTS) \
  31. LIBS="$(TARGET_LDFLAGS) -lnl-tiny -lm -luci -lubox"
  32. endef
  33. define Build/InstallDev
  34. $(INSTALL_DIR) $(1)/usr/include
  35. $(CP) $(PKG_BUILD_DIR)/swlib.h $(1)/usr/include/
  36. $(INSTALL_DIR) $(1)/usr/lib
  37. $(CP) $(PKG_BUILD_DIR)/libsw.a $(1)/usr/lib/
  38. endef
  39. define Package/swconfig/install
  40. $(INSTALL_DIR) $(1)/sbin $(1)/lib/network
  41. $(INSTALL_BIN) $(PKG_BUILD_DIR)/swconfig $(1)/sbin/swconfig
  42. $(INSTALL_DATA) ./files/switch.sh $(1)/lib/network/
  43. endef
  44. $(eval $(call BuildPackage,swconfig))