kumquat-buildroot/package/am335x-pru-package/am335x-pru-package.mk
Thomas Petazzoni 665e13c85e Rename BR2_PREFER_STATIC_LIB to BR2_STATIC_LIBS
Since a while, the semantic of BR2_PREFER_STATIC_LIB has been changed
from "prefer static libraries when possible" to "use only static
libraries". The former semantic didn't make much sense, since the user
had absolutely no control/idea of which package would use static
libraries, and which packages would not. Therefore, for quite some
time, we have been starting to enforce that BR2_PREFER_STATIC_LIB
should really build everything with static libraries.

As a consequence, this patch renames BR2_PREFER_STATIC_LIB to
BR2_STATIC_LIBS, and adjust the Config.in option accordingly.

This also helps preparing the addition of other options to select
shared, shared+static or just static.

Note that we have verified that this commit can be reproduced by
simply doing a global rename of BR2_PREFER_STATIC_LIB to
BR2_STATIC_LIBS plus adding BR2_PREFER_STATIC_LIB to Config.in.legacy.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2014-12-11 22:48:13 +01:00

75 lines
2.6 KiB
Makefile

################################################################################
#
# am335x-pru-package
#
################################################################################
AM335X_PRU_PACKAGE_VERSION = 506e074859891a2b350eb4f5fcb451c4961410ea
AM335X_PRU_PACKAGE_SITE = $(call github,beagleboard,am335x_pru_package,$(AM335X_PRU_PACKAGE_VERSION))
AM335X_PRU_PACKAGE_LICENSE = BSD-3c
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)
AM335X_MAKE_TARGET = debug $(if $(BR2_STATIC_LIBS),,sodebug)
else
AM335X_MAKE_TARGET = release $(if $(BR2_STATIC_LIBS),,sorelease)
endif
define AM335X_PRU_PACKAGE_BUILD_CMDS
$(MAKE) CROSS_COMPILE="$(TARGET_CROSS)" \
-C $(@D)/pru_sw/app_loader/interface $(AM335X_MAKE_TARGET)
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
$(MAKE1) DESTDIR="$(STAGING_DIR)" PREFIX="/usr" \
-C $(@D)/pru_sw/app_loader/interface install
endef
define AM335X_PRU_PACKAGE_INSTALL_TARGET_CMDS
$(MAKE1) DESTDIR="$(TARGET_DIR)" PREFIX="/usr" \
-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
ifeq ($(BR2_STATIC_LIBS),)
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
$(INSTALL) -m 0755 -D $(@D)/pru_sw/utils/pasm $(HOST_DIR)/usr/bin/pasm
endef
$(eval $(generic-package))
$(eval $(host-generic-package))