iopsys-feed/libethernet/Makefile
Markus Gothe 9298fbeb33 libqos/libethernet: Use DEPENDS instead of PKG_BUILD_DEPENDS.
Due to syntax differences the latter doesn't really solve the
dependency when we use our build-script.

Instead use the same approach as the libwifi package.

Change-Id: If37b70141b541cca03474251904863a17e07ff45
2023-04-27 08:14:07 +00:00

108 lines
2.8 KiB
Makefile

#
# Copyright (C) 2020-2023 Iopsys
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libethernet
PKG_VERSION:=7.2.102
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=30df74671870acef99036217e002d1f4418c8d4f
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libethernet.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=LGPL-2.1-only
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
ifeq ($(CONFIG_TARGET_brcmbca),y)
TARGET_PLATFORM=BROADCOM
CHIP_ID=$(patsubst "%",%,$(CONFIG_BCM_CHIP_ID))
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_BCM9$(CHIP_ID) \
-I$(STAGING_DIR)/usr/include/bcm963xx/shared/opensource/include/bcm963xx \
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
else ifeq ($(CONFIG_TARGET_x86),y)
TARGET_PLATFORM=TEST
TARGET_CFLAGS +=-DIOPSYS_TEST
else ifeq ($(CONFIG_TARGET_armvirt),y)
TARGET_PLATFORM=TEST
TARGET_CFLAGS +=-DIOPSYS_TEST
else ifeq ($(CONFIG_TARGET_airoha),y)
TARGET_PLATFORM=ECONET
TARGET_CFLAGS +=-DIOPSYS_ECONET
else ifeq ($(CONFIG_TARGET_ipq95xx),y)
TARGET_PLATFORM=IPQ95XX
TARGET_CFLAGS +=-DIPQ95XX
else ifeq ($(CONFIG_TARGET_mediatek),y)
TARGET_PLATFORM=LINUX
TARGET_CFLAGS +=-DIOPSYS_LINUX
else
$(info Unexpected CONFIG_TARGET, use default LINUX)
TARGET_PLATFORM=LINUX
TARGET_CFLAGS +=-DIOPSYS_LINUX
endif
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/openssl \
-I$(STAGING_DIR)/usr/include/libnl3
MAKE_FLAGS += \
CFLAGS="$(TARGET_CFLAGS) -Wall -I./" \
LDFLAGS="$(TARGET_LDFLAGS)" \
FPIC="$(FPIC)" \
PLATFORM="$(TARGET_PLATFORM)" \
subdirs="$(subdirs)"
define Package/libethernet
SECTION:=libs
CATEGORY:=Libraries
SUBMENU:=IOPSYS HAL libs
MENU:=1
TITLE:= Ethernet library (libethernet)
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_airoha:ecnt_api +TARGET_brcmbca:bcmkernel
endef
define Package/libethernet/description
Library provides ethernet HAL APIs
endef
define Package/libethernet/config
config LIBETHERNET_DEBUG
depends on PACKAGE_libethernet
bool "Enable ethernet debugging"
default n
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ./libethernet/* $(PKG_BUILD_DIR)/
endef
endif
define Build/InstallDev/libethernet
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/ethernet.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libethernet.so $(1)/usr/lib/
endef
define Build/InstallDev
$(call Build/InstallDev/libethernet,$(1),$(2))
endef
define Package/libethernet/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libethernet.so* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libethernet))