From 40d4f72784b2037a0fcfb1c79190c87e017fc38c Mon Sep 17 00:00:00 2001 From: Anjan Chanda Date: Sat, 23 Jan 2021 22:10:33 +0100 Subject: [PATCH] easy-soc-libs: refactor package Makefiles --- easy-soc-libs/Config.in | 28 -------- easy-soc-libs/Makefile | 145 +++++++------------------------------- easy-soc-libs/dsl.mk | 47 ++++++++++++ easy-soc-libs/easy.mk | 24 +++++++ easy-soc-libs/ethernet.mk | 27 +++++++ easy-soc-libs/qos.mk | 27 +++++++ easy-soc-libs/wifi.mk | 29 ++++++++ 7 files changed, 181 insertions(+), 146 deletions(-) delete mode 100644 easy-soc-libs/Config.in create mode 100644 easy-soc-libs/dsl.mk create mode 100644 easy-soc-libs/easy.mk create mode 100644 easy-soc-libs/ethernet.mk create mode 100644 easy-soc-libs/qos.mk create mode 100644 easy-soc-libs/wifi.mk diff --git a/easy-soc-libs/Config.in b/easy-soc-libs/Config.in deleted file mode 100644 index 0ecb67fe6..000000000 --- a/easy-soc-libs/Config.in +++ /dev/null @@ -1,28 +0,0 @@ -if (PACKAGE_libwifi || PACKAGE_libdsl || PACKAGE_libethernet || PACKAGE_libqos) -menu "configurations" - -config IOP_LLA_LIBS_DEBUG - bool "Enable debugging support" - default n - -config LIBWIFI_DEBUG - depends on PACKAGE_libwifi - bool "Enable wifi debugging" - default n - -config LIBQOS_DEBUG - depends on PACKAGE_libqos - bool "Enable qos debugging" - default n - -config LIBDSL_DEBUG - depends on PACKAGE_libdsl - bool "Enable xdsl debugging" - default n - -config LIBDSL_TEST - depends on PACKAGE_libdsl - bool "Libdsl test program" - default n -endmenu -endif diff --git a/easy-soc-libs/Makefile b/easy-soc-libs/Makefile index 36ab0b3b9..42a0ae32d 100644 --- a/easy-soc-libs/Makefile +++ b/easy-soc-libs/Makefile @@ -29,40 +29,12 @@ include $(INCLUDE_DIR)/package.mk define Package/easy-soc-libs SECTION:=libs CATEGORY:=Libraries - TITLE:=IOPSYS easy SoC libraries - SUBMENU:=IOPSYS easy SoC libraries + TITLE:=IOPSYS Easy SoC libraries + SUBMENU:=IOPSYS Easy SoC libraries DEPENDS:=+libopenssl MENU:=1 endef -define Package/libwifi/config - source "$(SOURCE)/Config.in" -endef - -define Package/libeasy - $(call Package/easy-soc-libs) - TITLE:= Common helper functions library (libeasy) - DEPENDS+=+libnl +libnl-route -endef - -define Package/libwifi - $(call Package/easy-soc-libs) - TITLE:= WiFi library (libwifi) - DEPENDS+=+libnl +libnl-route +libeasy -endef - -define Package/libethernet - $(call Package/easy-soc-libs) - TITLE:= Ethernet library (libethernet) - DEPENDS+=+libnl +libnl-route +libeasy +TARGET_iopsys_ramips:swconfig -endef - -define Package/libqos - $(call Package/easy-soc-libs) - TITLE:= QoS library (libqos) - DEPENDS+=+libnl +libnl-route +libeasy -endef - ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y) TARGET_PLATFORM=BROADCOM CHIP_ID=$(patsubst "%",%,$(CONFIG_BCM_CHIP_ID)) @@ -89,23 +61,20 @@ endif export TARGET_PLATFORM -ifdef CONFIG_IOP_LLA_LIBS_DEBUG - TARGET_CFLAGS += -DIOP_LLA_LIBS_DEBUG -endif - -define Package/libdsl - $(call Package/easy-soc-libs) - TITLE:= XDSL library (libdsl) - DEPENDS+=+TARGET_intel_mips:dsl-cpe-api-vrx +TARGET_intel_mips:dsl-cpe-fapi +TARGET_intel_mips:kmod-ppa-drv -endef - subdirs := \ $(if $(CONFIG_PACKAGE_libeasy),libeasy) \ $(if $(CONFIG_PACKAGE_libwifi),libwifi) \ $(if $(CONFIG_PACKAGE_libdsl),libdsl) \ - $(if $(CONFIG_PACKAGE_libethernet),libethernet) + $(if $(CONFIG_PACKAGE_libethernet),libethernet) \ + $(if $(CONFIG_PACKAGE_libqos),libqos) + +EASY_SOC_LIBS := \ + libeasy \ + libwifi \ + libdsl \ + libethernet \ + libqos -subdirs := $(subdirs) libqos TARGET_CFLAGS += \ -I$(STAGING_DIR)/usr/include \ @@ -125,94 +94,34 @@ define Build/Prepare endef endif -define Build/InstallDev/libeasy - $(INSTALL_DIR) $(1)/usr/include/easy - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_BUILD_DIR)/libeasy/easy.h $(1)/usr/include/easy/ - $(CP) $(PKG_BUILD_DIR)/libeasy/event.h $(1)/usr/include/easy/ - $(CP) $(PKG_BUILD_DIR)/libeasy/utils.h $(1)/usr/include/easy/ - $(CP) $(PKG_BUILD_DIR)/libeasy/if_utils.h $(1)/usr/include/easy/ - $(CP) $(PKG_BUILD_DIR)/libeasy/debug.h $(1)/usr/include/easy/ - $(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/ -endef +include easy.mk +include wifi.mk +include dsl.mk +include ethernet.mk +include qos.mk -define Build/InstallDev/libwifi - $(INSTALL_DIR) $(1)/usr/include - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_BUILD_DIR)/libwifi/wifi.h $(1)/usr/include/ - $(CP) $(PKG_BUILD_DIR)/libwifi/libwifi*.so* $(1)/usr/lib/ -endef - -define Build/InstallDev/libdsl - $(INSTALL_DIR) $(1)/usr/include/xdsl - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_BUILD_DIR)/libdsl/xdsl.h $(1)/usr/include/xdsl - $(CP) $(PKG_BUILD_DIR)/libdsl/xtm.h $(1)/usr/include/xdsl - $(CP) $(PKG_BUILD_DIR)/libdsl/common.h $(1)/usr/include/xdsl - $(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/ -endef - -define Build/InstallDev/libethernet - $(INSTALL_DIR) $(1)/usr/include - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_BUILD_DIR)/libethernet/ethernet.h $(1)/usr/include/ - $(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so $(1)/usr/lib/ -endef - -define Build/InstallDev/libqos - $(INSTALL_DIR) $(1)/usr/include - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_BUILD_DIR)/libeasy/easy.h $(1)/usr/include/easy/ - $(CP) $(PKG_BUILD_DIR)/libqos/qos.h $(1)/usr/include/ - $(CP) $(PKG_BUILD_DIR)/libqos/libqos.so $(1)/usr/lib/ +ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),\ + $(PKG_BUILD_DIR)/.config_$(patsubst "%",%,$(CONFIG_TARGET_PROFILE))) +define Build/Compile/rebuild + $(FIND) $(PKG_BUILD_DIR) -name \*.o -or -name \*.so\* | $(XARGS) rm -f; + $(if $(wildcard $(PKG_BUILD_DIR)/config_*), \ + rm -f $(PKG_BUILD_DIR)/.config_*) endef +endif define Build/Compile + $(Build/Compile/rebuild) + touch $(PKG_BUILD_DIR)/.config_$(CONFIG_TARGET_PROFILE) $(call Build/Compile/Default) -ifeq ($(CONFIG_LIBDSL_TEST),y) - $(MAKE) -C "$(PKG_BUILD_DIR)/libdsl/test" $(MAKE_FLAGS) -endif + $(foreach dir,$(subdirs),$(call Build/Compile/$(dir))) endef define Build/InstallDev $(foreach dir,$(subdirs),$(call Build/InstallDev/$(dir),$(1),$(2));) endef -define Package/libeasy/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/ -endef - -define Package/libwifi/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_BUILD_DIR)/libwifi/libwifi*.so* $(1)/usr/lib/ -endef - -define Package/libethernet/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so* $(1)/usr/lib/ -endef - -define Package/libqos/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_BUILD_DIR)/libqos/libqos*.so* $(1)/usr/lib/ -endef - -define Package/libdsl/install - $(INSTALL_DIR) $(1)/usr/lib - $(INSTALL_DIR) $(1)/usr/bin - $(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/ -ifeq ($(CONFIG_LIBDSL_TEST),y) - $(CP) $(PKG_BUILD_DIR)/libdsl/test/libdsl_test $(1)/usr/bin/ -endif -endef - define Package/easy-soc-libs/install : endef -$(eval $(call BuildPackage,libeasy)) -$(eval $(call BuildPackage,libwifi)) -$(eval $(call BuildPackage,libdsl)) -$(eval $(call BuildPackage,libethernet)) -$(eval $(call BuildPackage,libqos)) +$(eval $(foreach e,$(EASY_SOC_LIBS),$(call BuildPackage,$(e)))) diff --git a/easy-soc-libs/dsl.mk b/easy-soc-libs/dsl.mk new file mode 100644 index 000000000..f25527cd1 --- /dev/null +++ b/easy-soc-libs/dsl.mk @@ -0,0 +1,47 @@ + +define Package/libdsl + $(call Package/easy-soc-libs) + TITLE:= XDSL library (libdsl) + DEPENDS+=+TARGET_intel_mips:dsl-cpe-api-vrx \ + +TARGET_intel_mips:dsl-cpe-fapi \ + +TARGET_intel_mips:kmod-ppa-drv +endef + +define Package/libdsl/config + if PACKAGE_libdsl + config LIBDSL_DEBUG + depends on PACKAGE_libdsl + bool "Enable dsl debugging" + default n + + config LIBDSL_TEST + depends on PACKAGE_libdsl + bool "Enable dsl test program" + default n + + endif +endef + +define Build/InstallDev/libdsl + $(INSTALL_DIR) $(1)/usr/include/xdsl + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libdsl/xdsl.h $(1)/usr/include/xdsl + $(CP) $(PKG_BUILD_DIR)/libdsl/xtm.h $(1)/usr/include/xdsl + $(CP) $(PKG_BUILD_DIR)/libdsl/common.h $(1)/usr/include/xdsl + $(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/ +endef + +ifeq ($(CONFIG_LIBDSL_TEST),y) +define Build/Compile/libdsl + $(MAKE) -C "$(PKG_BUILD_DIR)/libdsl/test" $(MAKE_FLAGS) +endef +endif + +define Package/libdsl/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/ +ifeq ($(CONFIG_LIBDSL_TEST),y) + $(CP) $(PKG_BUILD_DIR)/libdsl/test/libdsl_test $(1)/usr/bin/ +endif +endef diff --git a/easy-soc-libs/easy.mk b/easy-soc-libs/easy.mk new file mode 100644 index 000000000..d31ca31ae --- /dev/null +++ b/easy-soc-libs/easy.mk @@ -0,0 +1,24 @@ + + +define Package/libeasy + $(call Package/easy-soc-libs) + TITLE:= Common helper functions library (libeasy) + DEPENDS+=+libnl +libnl-route +endef + +define Build/InstallDev/libeasy + $(INSTALL_DIR) $(1)/usr/include/easy + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libeasy/easy.h $(1)/usr/include/easy/ + $(CP) $(PKG_BUILD_DIR)/libeasy/event.h $(1)/usr/include/easy/ + $(CP) $(PKG_BUILD_DIR)/libeasy/utils.h $(1)/usr/include/easy/ + $(CP) $(PKG_BUILD_DIR)/libeasy/if_utils.h $(1)/usr/include/easy/ + $(CP) $(PKG_BUILD_DIR)/libeasy/debug.h $(1)/usr/include/easy/ + $(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/ +endef + +define Package/libeasy/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/ +endef + diff --git a/easy-soc-libs/ethernet.mk b/easy-soc-libs/ethernet.mk new file mode 100644 index 000000000..c8c0bc8da --- /dev/null +++ b/easy-soc-libs/ethernet.mk @@ -0,0 +1,27 @@ + +define Package/libethernet + $(call Package/easy-soc-libs) + TITLE:= Ethernet library (libethernet) + DEPENDS+=+libnl +libnl-route +libeasy +TARGET_iopsys_ramips:swconfig +endef + +define Package/libethernet/config + config LIBETHERNET_DEBUG + depends on PACKAGE_libethernet + bool "Enable ethernet debugging" + default n + +endef + +define Build/InstallDev/libethernet + $(INSTALL_DIR) $(1)/usr/include + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libethernet/ethernet.h $(1)/usr/include/ + $(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so $(1)/usr/lib/ +endef + +define Package/libethernet/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so* $(1)/usr/lib/ +endef + diff --git a/easy-soc-libs/qos.mk b/easy-soc-libs/qos.mk new file mode 100644 index 000000000..7ccba4384 --- /dev/null +++ b/easy-soc-libs/qos.mk @@ -0,0 +1,27 @@ + +define Package/libqos + $(call Package/easy-soc-libs) + TITLE:= QoS library (libqos) + DEPENDS+=+libnl +libnl-route +libeasy +endef + +define Package/libqos/config + config LIBQOS_DEBUG + depends on PACKAGE_libqos + bool "Enable qos debugging" + default n + +endef + +define Build/InstallDev/libqos + $(INSTALL_DIR) $(1)/usr/include + $(INSTALL_DIR) $(1)/usr/lib + #$(CP) $(PKG_BUILD_DIR)/libqos/qos.h $(1)/usr/include/ + $(CP) $(PKG_BUILD_DIR)/libqos/libqos.so $(1)/usr/lib/ +endef + +define Package/libqos/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libqos/libqos*.so* $(1)/usr/lib/ +endef + diff --git a/easy-soc-libs/wifi.mk b/easy-soc-libs/wifi.mk new file mode 100644 index 000000000..59d1f328a --- /dev/null +++ b/easy-soc-libs/wifi.mk @@ -0,0 +1,29 @@ + +define Package/libwifi + $(call Package/easy-soc-libs) + TITLE:= WiFi library (libwifi) + DEPENDS+=+libnl +libnl-route +libeasy +endef + +define Package/libwifi/config + if PACKAGE_libdsl + config LIBWIFI_DEBUG + depends on PACKAGE_libwifi + bool "Enable wifi debugging" + default n + + endif +endef + +define Build/InstallDev/libwifi + $(INSTALL_DIR) $(1)/usr/include + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libwifi/wifi.h $(1)/usr/include/ + $(CP) $(PKG_BUILD_DIR)/libwifi/libwifi*.so* $(1)/usr/lib/ +endef + +define Package/libwifi/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libwifi/libwifi*.so* $(1)/usr/lib/ +endef +