# CONFIG_SITE

# Make any application-specific changes to the EPICS build
#   configuration variables in this file.
#
# Host/target specific settings can be specified in files named
#   CONFIG_SITE.$(EPICS_HOST_ARCH).Common
#   CONFIG_SITE.Common.$(T_A)
#   CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)

# CHECK_RELEASE controls the consistency checking of the support
#   applications pointed to by the RELEASE* files.
# Normally CHECK_RELEASE should be set to YES.
# Set CHECK_RELEASE to NO to disable checking completely.
# Set CHECK_RELEASE to WARN to perform consistency checking but
#   continue building anyway if conflicts are found.
CHECK_RELEASE = YES

# Set this when you only want to compile this application
#   for a subset of the cross-compiled target architectures
#   that Base is built for.
#CROSS_COMPILER_TARGET_ARCHS = linuxRT-x86_64 linuxRT-arm_zynq

# Set this when you only want to compile this application
# for a subset of the cross-compiled target architectures
# that Base is built for.

#ALL_CROSS_ARCHS:=$(filter linuxRT%,$(CROSS_COMPILER_TARGET_ARCHS))
ALL_CROSS_ARCHS:=$(filter linuxRT-x86_64,$(CROSS_COMPILER_TARGET_ARCHS))

# Build Bpm/fftw only for a subset (padBpmApp is also built for the PAD)
BPM_CROSS_ARCHS:=$(filter RTEMS-beatnik linux%, $(ALL_CROSS_ARCHS))

# CROSS_COMPILER TARGET_ARCHS is overridden in some subdirectories
# to BPM_CROSS_ARCHS. Thus, if you want to filter you
# should further filter ALL_CROSS_ARCHS/BPM_CROSS_ARCHS above.
CROSS_COMPILER_TARGET_ARCHS = $(ALL_CROSS_ARCHS)


# kill the bad RTEMS setting - Ernest should do that globally
ifneq ($(filter RTEMS-%,$(T_A))xx,xx)
        OP_SYS_LDLIBS=
#       OP_SYS_LDFLAGS=
endif


# To install files into a location other than $(TOP) define
#   INSTALL_LOCATION here.
#INSTALL_LOCATION=</path/name/to/install/top>

# Set this when your IOC and the host use different paths
#   to access the application. This will be needed to boot
#   from a Microsoft FTP server or with some NFS mounts.
# You must rebuild in the iocBoot directory for this to
#   take effect.
#IOCS_APPL_TOP = </IOC/path/to/application/top>
#
# =======================================================
# Let's install our IOC boot products:
# envPaths and st.cmd
# =======================================================
INSTALL_LOCATION_STARTUP += $(INSTALL_LOCATION)/startup
DIRECTORY_TARGETS += $(INSTALL_LOCATION_STARTUP)
# =======================================================

## =============================
## Build Application Statically
## =============================
SHARED_LIBRARIES=NO
STATIC_BUILD=YES

# Location of Linux Kernel Modules:
LINUX_KERNEL_MODULES=$(PACKAGE_SITE_TOP)/linuxKernel_Modules

LINUXRT_BUILDROOT_VERSION=buildroot-2019.08
LINUX_VERSION=rhel6


# ===============================================================================================
# Common Platform Software (CPSW)
# ===============================================================================================
HAVE_CPSW=YES

CPSW_FRAMEWORK_PACKAGE_NAME=cpsw/framework
CPSW_FRAMEWORK_VERSION=R4.4.1
CPSW_FRAMEWORK_TOP=$(PACKAGE_SITE_TOP)/$(CPSW_FRAMEWORK_PACKAGE_NAME)/$(CPSW_FRAMEWORK_VERSION)
CPSW_FRAMEWORK_LIB = $(CPSW_FRAMEWORK_TOP)/$(PKG_ARCH)/lib
CPSW_FRAMEWORK_INCLUDE = $(CPSW_FRAMEWORK_TOP)/$(PKG_ARCH)/include
# ===============================================================================================

# ===============================================================================================
# Firmware Description via YAML library
# ===============================================================================================
YAML_PACKAGE_NAME=yaml-cpp
YAML_VERSION=yaml-cpp-0.5.3_boost-1.64.0
YAML_TOP=$(PACKAGE_SITE_TOP)/$(YAML_PACKAGE_NAME)/$(YAML_VERSION)
YAML_LIB= $(YAML_TOP)/$(PKG_ARCH)/lib
YAML_INCLUDE=$(YAML_TOP)/$(PKG_ARCH)/include
# ===============================================================================================

# ===============================================================================================
# Boost
# ===============================================================================================
BOOST_PACKAGE_NAME=boost
BOOST_VERSION=1.64.0
BOOST_TOP=$(PACKAGE_SITE_TOP)/$(BOOST_PACKAGE_NAME)/$(BOOST_VERSION)
BOOST_LIB = $(BOOST_TOP)/$(PKG_ARCH)/lib
BOOST_INCLUDE = $(BOOST_TOP)/$(PKG_ARCH)/include
# ===============================================================================================

# =============================================================================================
# YamlReader, required by YamlDownloader
# =============================================================================================
YAMLREADER_PACKAGE_NAME = cpsw/yamlReader
YAMLREADER_VERSION      = R1.2.0
YAMLREADER_TOP          = $(PACKAGE_SITE_TOP)/$(YAMLREADER_PACKAGE_NAME)/$(YAMLREADER_VERSION)
YAMLREADER_LIB          = $(YAMLREADER_TOP)/$(PKG_ARCH)/lib
YAMLREADER_INCLUDE      = $(YAMLREADER_TOP)/$(PKG_ARCH)/include
# =============================================================================================

# =============================================================================================
# CPSW Device Library, required by YamlDownloader
# =============================================================================================
DEVICELIB_PACKAGE_NAME     = cpsw/deviceLibrary
DEVICELIB_VERSION          = R1.2.0
DEVICELIB_TOP              = $(PACKAGE_SITE_TOP)/$(DEVICELIB_PACKAGE_NAME)/$(DEVICELIB_VERSION)
DEVICELIB_LIB              = $(DEVICELIB_TOP)/$(PKG_ARCH)/lib
DEVICELIB_INCLUDE          = $(DEVICELIB_TOP)/$(PKG_ARCH)/include
# =============================================================================================

# ==============================================================================================
# HPS Common Platform: Timing Pattern Receiver (TPR) API
# ==============================================================================================
HPSTPR_PACKAGE_NAME=timing/hpsTpr
HPSTPR_VERSION=R1.1.0
HPSTPR_TOP=$(PACKAGE_SITE_TOP)/$(HPSTPR_PACKAGE_NAME)/$(HPSTPR_VERSION)

HPSTPR_LIB     = $(HPSTPR_TOP)/$(PKG_ARCH)/lib
HPSTPR_INCLUDE = $(HPSTPR_TOP)/$(PKG_ARCH)/include
# =============================================================================================

# =============================================================================================
# BSA API for LCLS II
# =============================================================================================
BSA_PACKAGE_NAME=timing/bsa
BSA_VERSION=R1.2.0
BSA_ARCH=$(LINUXRT_BUILDROOT_VERSION)-x86_64
BSA_TOP=$(PACKAGE_SITE_TOP)/$(BSA_PACKAGE_NAME)/$(BSA_VERSION)
BSA_LIB     = $(BSA_TOP)/$(PKG_ARCH)/lib
BSA_INCLUDE = $(BSA_TOP)/$(PKG_ARCH)/include
# =============================================================================================

# =============================================================================================
# MPS API for LCLS II
# =============================================================================================
L2MPS_PACKAGE_NAME=l2Mps
L2MPS_VERSION=R2.4.0
L2MPS_TOP=$(PACKAGE_SITE_TOP)/$(L2MPS_PACKAGE_NAME)/$(L2MPS_VERSION)
L2MPS_LIB=$(L2MPS_TOP)/$(PKG_ARCH)/lib
L2MPS_INCLUDE=$(L2MPS_TOP)/$(PKG_ARCH)/include
# =============================================================================================

-include $(TOP)/CONFIG_SITE.override
