2014-10-12 15:38:58 +02:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# am335x-pru-package
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2016-06-05 23:26:01 +02:00
|
|
|
AM335X_PRU_PACKAGE_VERSION = 5f374ad57cc195f28bf5e585c3d446aba6ee7096
|
2014-10-12 15:38:58 +02:00
|
|
|
AM335X_PRU_PACKAGE_SITE = $(call github,beagleboard,am335x_pru_package,$(AM335X_PRU_PACKAGE_VERSION))
|
2017-03-30 15:43:38 +02:00
|
|
|
AM335X_PRU_PACKAGE_LICENSE = BSD-3-Clause
|
2014-10-12 15:38:58 +02:00
|
|
|
AM335X_PRU_PACKAGE_LICENSE_FILES = pru_sw/utils/LICENCE.txt
|
|
|
|
AM335X_PRU_PACKAGE_DEPENDENCIES = host-am335x-pru-package
|
|
|
|
AM335X_PRU_PACKAGE_INSTALL_STAGING = YES
|
|
|
|
|
|
|
|
# The default 'all' rule builds everything, when we just need the library
|
|
|
|
ifeq ($(BR2_ENABLE_DEBUG),y)
|
2017-11-30 00:08:40 +01:00
|
|
|
AM335X_PRU_PACKAGE_MAKE_TARGET = debug $(if $(BR2_STATIC_LIBS),,sodebug)
|
2014-10-12 15:38:58 +02:00
|
|
|
else
|
2017-11-30 00:08:40 +01:00
|
|
|
AM335X_PRU_PACKAGE_MAKE_TARGET = release $(if $(BR2_STATIC_LIBS),,sorelease)
|
2014-10-12 15:38:58 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
define AM335X_PRU_PACKAGE_BUILD_CMDS
|
2016-10-17 18:06:14 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) CROSS_COMPILE="$(TARGET_CROSS)" \
|
2017-11-30 00:08:40 +01:00
|
|
|
-C $(@D)/pru_sw/app_loader/interface $(AM335X_PRU_PACKAGE_MAKE_TARGET)
|
2014-10-12 15:38:58 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
# 'install' installs whatever was built, and our patch removes the dependency
|
|
|
|
# on the release build, so we can use it to install whatever we built above.
|
|
|
|
define AM335X_PRU_PACKAGE_INSTALL_STAGING_CMDS
|
2016-10-17 18:06:14 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE1) DESTDIR="$(STAGING_DIR)" PREFIX="/usr" \
|
2014-10-12 15:38:58 +02:00
|
|
|
-C $(@D)/pru_sw/app_loader/interface install
|
|
|
|
endef
|
|
|
|
|
|
|
|
define AM335X_PRU_PACKAGE_INSTALL_TARGET_CMDS
|
2016-10-17 18:06:14 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE1) DESTDIR="$(TARGET_DIR)" PREFIX="/usr" \
|
2014-10-12 15:38:58 +02:00
|
|
|
-C $(@D)/pru_sw/app_loader/interface install
|
|
|
|
endef
|
|
|
|
|
|
|
|
# The debug libraries are named differently than the release ones,
|
|
|
|
# so we must provide a symlink to still be able to link with them.
|
|
|
|
ifeq ($(BR2_ENABLE_DEBUG),y)
|
|
|
|
|
|
|
|
define AM335X_PRU_PACKAGE_LN_DEBUG_STAGING_STATIC
|
|
|
|
ln -sf libprussdrvd.a $(STAGING_DIR)/usr/lib/libprussdrv.a
|
|
|
|
endef
|
|
|
|
AM335X_PRU_PACKAGE_POST_INSTALL_STAGING_HOOKS += AM335X_PRU_PACKAGE_LN_DEBUG_STAGING_STATIC
|
|
|
|
|
2014-12-03 22:41:29 +01:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),)
|
2014-10-12 15:38:58 +02:00
|
|
|
|
|
|
|
define AM335X_PRU_PACKAGE_LN_DEBUG_STAGING_SHARED
|
|
|
|
ln -sf libprussdrvd.so $(STAGING_DIR)/usr/lib/libprussdrv.so
|
|
|
|
endef
|
|
|
|
AM335X_PRU_PACKAGE_POST_INSTALL_STAGING_HOOKS += AM335X_PRU_PACKAGE_LN_DEBUG_STAGING_SHARED
|
|
|
|
|
|
|
|
define AM335X_PRU_PACKAGE_LN_DEBUG_TARGET
|
|
|
|
ln -sf libprussdrvd.so $(TARGET_DIR)/usr/lib/libprussdrv.so
|
|
|
|
endef
|
|
|
|
AM335X_PRU_PACKAGE_POST_INSTALL_TARGET_HOOKS += AM335X_PRU_PACKAGE_LN_DEBUG_TARGET
|
|
|
|
|
|
|
|
endif # !STATIC
|
|
|
|
|
|
|
|
endif # DEBUG
|
|
|
|
|
|
|
|
define HOST_AM335X_PRU_PACKAGE_BUILD_CMDS
|
|
|
|
cd $(@D)/pru_sw/utils/pasm_source; \
|
|
|
|
$(HOSTCC) -Wall -D_UNIX_ pasm.c pasmpp.c pasmexp.c pasmop.c \
|
|
|
|
pasmdot.c pasmstruct.c pasmmacro.c path_utils.c -o ../pasm
|
|
|
|
endef
|
|
|
|
|
|
|
|
define HOST_AM335X_PRU_PACKAGE_INSTALL_CMDS
|
2017-07-05 13:14:19 +02:00
|
|
|
$(INSTALL) -m 0755 -D $(@D)/pru_sw/utils/pasm $(HOST_DIR)/bin/pasm
|
2014-10-12 15:38:58 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(generic-package))
|
|
|
|
$(eval $(host-generic-package))
|