asuswrt-merlin.ng/release/src-rt-5.02axhnd/make.common
2023-02-24 23:18:22 -05:00

3646 lines
105 KiB
Text

#***********************************************************************
#
# Copyright (c) 2006 Broadcom Corporation
# All Rights Reserved
#
#***********************************************************************/
#
# This makefile is included by most of the lower level makefiles
# to suck in the common defines.
#
#
# version.make has the 4.0.0 version number,
# each directory must set depth appropriately
#
default_auto_fail:
@echo ""
@echo "Error - $@ target invoked. This is likely because make.common" >&2
@echo " was included before the default target in a parent Makefile." >&2
@echo ""
exit 1
ifeq ($(BUILD_DIR),)
BUILD_DIR = $(HND_SRC)
endif
include $(BUILD_DIR)/version.make
# GNUMAKEFLAGS := --output-sync=recurse
ifeq ($(strip $(BRCM_RELEASETAG)),)
BRCM_RELEASETAG=$(BRCM_VERSION).$(BRCM_RELEASE)L.$(BRCM_EXTRAVERSION)
endif
###########################################
# Define build environment (profile and
# toolchain)
#
###########################################
TARGETS_DIR := $(BUILD_DIR)/targets
INC_KERNEL_BASE := $(BUILD_DIR)/kernel
#
# If we don't define a PROFILE, try to figure out what the last profile
# was and use that.
#
ifneq ($(MAKECMDGOALS), menuconfig)
ifneq ($(MAKECMDGOALS), distclean)
ifneq ($(MAKECMDGOALS), cleanall)
ifneq ($(MAKECMDGOALS), binaryonly_dist_clean)
HOST_PERLARCH_COOKIE := $(BUILD_DIR)/.host_perlarch
HOST_PERLARCH := $(strip $(shell cat $(HOST_PERLARCH_COOKIE) 2>/dev/null))
LAST_PROFILE_COOKIE := $(BUILD_DIR)/.last_profile
LAST_PROFILE := $(strip $(shell cat $(LAST_PROFILE_COOKIE) 2>/dev/null))
ifeq ($(strip $(PROFILE)),)
PROFILE=$(LAST_PROFILE)
export PROFILE
endif #PROFILE
endif #binaryonly_dist_clean
endif #cleanall
endif #distclean
ifneq ($(strip $(PROFILE)),)
PROFILE_DIR := $(TARGETS_DIR)/$(PROFILE)
PROFILE_FILE := $(PROFILE_DIR)/$(PROFILE).$(BUILD_NAME)
PROFILE_FILE_PUB := $(PROFILE_DIR)/$(PROFILE)
include $(PROFILE_FILE)
# When building multi-architecture, CURRENT_ARCH will override PROFILE_ARCH
ifneq ($(strip $(CURRENT_ARCH)),)
ORIG_PROFILE_ARCH := $(PROFILE_ARCH)
PROFILE_ARCH := $(CURRENT_ARCH)
TOOLCHAIN_PREFIX :=
ifneq ($(strip $(CURRENT_ARCH)),$(strip $(ORIG_PROFILE_ARCH)))
BCM_INSTALL_SUFFIX := $(CURRENT_ARCH)
BCM_INSTALL_SUFFIX_DIR := /$(BCM_INSTALL_SUFFIX)
TOOLCHAIN_TOP :=
else
BCM_INSTALL_SUFFIX :=
BCM_INSTALL_SUFFIX_DIR :=
TOOLCHAIN_TOP :=
endif
endif
ifndef TOOLCHAIN_BASE
TOOLCHAIN_BASE := /opt/toolchains/
endif
#
# Get Kernel and Toolchain versions based
# on profile
#
# --- KERNEL VERSION SPECIFIC INFORMATION:
# for MIPS, big endian, Linux 4.1
DEFAULT_TOOLCHAIN_LINUX_4_1_0_MIPS := $(TOOLCHAIN_BASE)/crosstools-mips-gcc-5.3-linux-4.1-uclibc-1.0.12-binutils-2.25-NPTL
DEFAULT_TOOLCHAIN_VER_LINUX_4_1_0_MIPS := 5.3.0
TOOLCHAIN_PREFIX_LINUX_4_1_0_MIPS := mips-buildroot-linux-uclibc
TOOLCHAIN_LIBDIR_LINUX_4_1_0_MIPS := usr/$(TOOLCHAIN_PREFIX_LINUX_4_1_0_MIPS)/sysroot/lib
TOOLCHAIN_INCDIR_LINUX_4_1_0_MIPS := usr/$(TOOLCHAIN_PREFIX_LINUX_4_1_0_MIPS)/sysroot/usr/include
# for MIPS, little endian, Linux 4.1
DEFAULT_TOOLCHAIN_LINUX_4_1_0_MIPSEL := $(TOOLCHAIN_BASE)/crosstools-mipsel-gcc-5.3-linux-4.1-uclibc-1.0.12-binutils-2.25-NPTL
DEFAULT_TOOLCHAIN_VER_LINUX_4_1_0_MIPSEL := 5.3.0
TOOLCHAIN_PREFIX_LINUX_4_1_0_MIPSEL := mipsel-buildroot-linux-uclibc
TOOLCHAIN_LIBDIR_LINUX_4_1_0_MIPSEL := usr/$(TOOLCHAIN_PREFIX_LINUX_4_1_0_MIPSEL)/sysroot/lib
TOOLCHAIN_INCDIR_LINUX_4_1_0_MIPSEL := usr/$(TOOLCHAIN_PREFIX_LINUX_4_1_0_MIPSEL)/sysroot/usr/include
# for ARM, Linux 4.1
ifeq ($(strip $(BRCM_UCLIBC)),y)
DEFAULT_TOOLCHAIN_LINUX_4_1_0_ARM := $(TOOLCHAIN_BASE)/crosstools-arm-gcc-5.3-linux-4.1-uclibc-1.0.12-binutils-2.25-NPTL
TOOLCHAIN_PREFIX_LINUX_4_1_0_ARM := arm-buildroot-linux-uclibcgnueabi
else
DEFAULT_TOOLCHAIN_LINUX_4_1_0_ARM := $(TOOLCHAIN_BASE)/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1
TOOLCHAIN_PREFIX_LINUX_4_1_0_ARM := arm-buildroot-linux-gnueabi
endif
DEFAULT_TOOLCHAIN_VER_LINUX_4_1_0_ARM := 5.3.0
TOOLCHAIN_LIBDIR_LINUX_4_1_0_ARM := usr/$(TOOLCHAIN_PREFIX_LINUX_4_1_0_ARM)/sysroot/lib
TOOLCHAIN_INCDIR_LINUX_4_1_0_ARM := usr/$(TOOLCHAIN_PREFIX_LINUX_4_1_0_ARM)/sysroot/usr/include
# for AARCH64, Linux 4.1
DEFAULT_TOOLCHAIN_LINUX_4_1_0_AARCH64 := $(TOOLCHAIN_BASE)/crosstools-aarch64-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1
TOOLCHAIN_PREFIX_LINUX_4_1_0_AARCH64 := aarch64-buildroot-linux-gnu
DEFAULT_TOOLCHAIN_VER_LINUX_4_1_0_AARCH64 := 5.3.0
TOOLCHAIN_LIBDIR_LINUX_4_1_0_AARCH64 := usr/$(TOOLCHAIN_PREFIX_LINUX_4_1_0_AARCH64)/sysroot/lib
TOOLCHAIN_INCDIR_LINUX_4_1_0_AARCH64 := usr/$(TOOLCHAIN_PREFIX_LINUX_4_1_0_AARCH64)/sysroot/usr/include
LINUX_ZIP_FILE_LINUX_4_1_0 := src-linux-4.1.tar.bz2
LINUX_SUB_DIR_LINUX_4_1_0 := linux-4.1
LINUX_VER_STR_LINUX_4_1_0 := 4.1.51
ifeq ($(strip $(PROFILE_ARCH)),mips)
ARCHCAP := MIPS
ARCH := mips
ARCH_ENDIAN := big
export BRCM_ENDIAN_FLAGS := -b
else
ARCH_ENDIAN := little
export BRCM_ENDIAN_FLAGS := -l
ifeq ($(strip $(PROFILE_ARCH)),arm)
ARCHCAP := ARM
ARCH := arm
endif
ifeq ($(strip $(PROFILE_ARCH)),mipsel)
ARCHCAP := MIPSEL
ARCH := mips
endif
ifeq ($(strip $(PROFILE_ARCH)),aarch64)
ARCHCAP := AARCH64
ARCH := arm64
endif
ifeq ($(strip $(PROFILE_ARCH)),i386)
ARCHCAP := I386
ARCH := i386
endif
ifeq ($(strip $(DESKTOP_LINUX)),y)
ifeq ($(shell uname -m),x86_64)
ARCHCAP := X86_64
# uncomment the next line to have 64-bit compiling environment if the build machine is a 64-bit system
# ARCH := x86_64
endif
ifeq ($(shell uname -m),i686)
ARCHCAP := I686
ARCH := i686
endif
endif
endif
# set up kernel build tool arch, if KERNEL_ARCH not specified, kernel use the same as user profile arch
ifeq ($(strip $(KERNEL_ARCH)),)
KERNEL_ARCH := $(PROFILE_ARCH)
endif
ifeq ($(strip $(KERNEL_ARCH)),mips)
KARCHCAP := MIPS
KARCH := mips
else
ifeq ($(strip $(KERNEL_ARCH)),arm)
KARCHCAP := ARM
KARCH := arm
endif
ifeq ($(strip $(KERNEL_ARCH)),mipsel)
KARCHCAP := MIPSEL
KARCH := mips
endif
ifeq ($(strip $(KERNEL_ARCH)),aarch64)
KARCHCAP := AARCH64
KARCH := arm64
endif
ifeq ($(strip $(KERNEL_ARCH)),i386)
KARCHCAP := I386
KARCH := i386
endif
ifeq ($(strip $(DESKTOP_LINUX)),y)
ifeq ($(shell uname -m),x86_64)
KARCHCAP := X86_64
KARCH := x86_64
endif
ifeq ($(shell uname -m),i686)
KARCHCAP := I686
KARCH := i686
endif
endif
endif
# ---
ifeq ($(PROFILE_KERNEL_VER),)
$(error KERNEL VERSION not specified in profile $(PROFILE_FILE))
endif
ifndef TOOLCHAIN_TOP
TOOLCHAIN_TOP := ${DEFAULT_TOOLCHAIN_${PROFILE_KERNEL_VER}_${ARCHCAP}}
endif
ifndef KTOOLCHAIN_TOP
KTOOLCHAIN_TOP := ${DEFAULT_TOOLCHAIN_${PROFILE_KERNEL_VER}_${KARCHCAP}}
endif
TOOLCHAIN_VER := ${DEFAULT_TOOLCHAIN_VER_${PROFILE_KERNEL_VER}_${ARCHCAP}}
TOOLCHAIN_LIBDIR := ${TOOLCHAIN_LIBDIR_${PROFILE_KERNEL_VER}_${ARCHCAP}}
ifeq ($(TOOLCHAIN_PREFIX),)
TOOLCHAIN_PREFIX := ${TOOLCHAIN_PREFIX_${PROFILE_KERNEL_VER}_${ARCHCAP}}
endif
export TOOLCHAIN_PREFIX
TOOLCHAIN_INCLUDE_DIR := $(TOOLCHAIN_TOP)/${TOOLCHAIN_INCDIR_${PROFILE_KERNEL_VER}_${ARCHCAP}}
LINUX_VER_STR := ${LINUX_VER_STR_${PROFILE_KERNEL_VER}}
KTOOLCHAIN_VER := ${DEFAULT_TOOLCHAIN_VER_${PROFILE_KERNEL_VER}_${KARCHCAP}}
KTOOLCHAIN_LIBDIR := ${TOOLCHAIN_LIBDIR_${PROFILE_KERNEL_VER}_${KARCHCAP}}
KTOOLCHAIN_PREFIX := ${TOOLCHAIN_PREFIX_${PROFILE_KERNEL_VER}_${KARCHCAP}}
KTOOLCHAIN_INCLUDE_DIR := $(KTOOLCHAIN_TOP)/${TOOLCHAIN_INCDIR_${PROFILE_KERNEL_VER}_${KARCHCAP}}
CONFIG_BCM_KERNEL_CUSTOM:=y
BCM_KF:=y
LINUX_ZIP_FILE := ${LINUX_ZIP_FILE_${PROFILE_KERNEL_VER}}
LINUX_SUB_DIR := ${LINUX_SUB_DIR_${PROFILE_KERNEL_VER}}
INC_DIR:=include/uapi
KERNEL_DIR := $(BUILD_DIR)/kernel/$(LINUX_SUB_DIR)
KERNEL_LINKS_DIR := $(INC_KERNEL_BASE)
KERNEL_INCLUDE_LINK_NAME := bcm_local_kernel_include
KERNEL_MIPS_INCLUDE_LINK_NAME := bcm_local_kernel_mips_include
KERNEL_ARM_INCLUDE_LINK_NAME := bcm_local_kernel_arm_include
#KERNEL_GEN_INCLUDE_LINK_NAME := bcm_local_kernel_gen_include
KERNEL_INCLUDE_LINK := $(KERNEL_LINKS_DIR)/$(KERNEL_INCLUDE_LINK_NAME)
KERNEL_MIPS_INCLUDE_LINK := $(KERNEL_LINKS_DIR)/$(KERNEL_MIPS_INCLUDE_LINK_NAME)
KERNEL_ARM_INCLUDE_LINK := $(KERNEL_LINKS_DIR)/$(KERNEL_ARM_INCLUDE_LINK_NAME)
#KERNEL_GEN_INCLUDE_LINK_NAME := bcm_local_kernel_gen_include
DTS_DIR := $(BUILD_DIR)/kernel
export DTS_DIR
export BRCM_CHIP
export BRCM_FLASHPSI_SIZE
export BRCM_DRIVER_WIRELESS_PCMCIA_DATASWAP BRCM_DRIVER_WIRELESS_EBI_DMA
export BRCM_DRIVER_USB BRCM_DRIVER_ETHERNET_CONFIG BRCM_DRIVER_GPON BRCM_DRIVER_XTM
export BRCM_DRIVER_LOG BRCM_GPON_FPGA BRCM_DRIVER_I2C
export BRCM_DRIVER_PKTFLOW_DEBUG BRCM_DRIVER_PKTFLOW_IPV6 BRCM_DRIVER_PKTFLOW_MCAST
export BRCM_DRIVER_MoCA_CTP_CANDIDATE BUILD_6802_MOCA MOCA_LAN_DISCONN MOCA_WAN_DISCONN BRCM_MOCA_AVS
export BRCM_DRIVER_ISDN
export BRCM_DRIVER_EMMC
export BRCM_DEFAULTCFG
export BRCM_CERT_FILE
export BRCM_KERNEL_NF_FIREWALL BRCM_KERNEL_NF_MANGLE BRCM_KERNEL_NF_NAT
export BRCM_KERNEL_NF_NAT_ALG_FTP BRCM_KERNEL_NF_NAT_ALG_SIP BRCM_KERNEL_NF_NAT_ALG_TFTP BRCM_KERNEL_NF_NAT_ALG_H323 BRCM_KERNEL_NF_NAT_ALG_H323_SIGNAL_PROXY
export BRCM_KERNEL_NF_NAT_ALG_IRC BRCM_KERNEL_NF_NAT_ALG_WM BRCM_KERNEL_NF_NAT_ALG_PT BRCM_KERNEL_NF_NAT_ALG_PPTP BRCM_KERNEL_NF_NAT_ALG_IPSEC
export BRCM_KERNEL_NF_NAT_ALG_RTSP BRCM_KERNEL_NF_NAT_ALG_SNMP BRCM_KERNEL_NF_NAT_ALG_TALK
export BRCM_KERNEL_NF_LAYER7_FILTER
export BRCM_EXT_SWITCH_TYPE
export BCM_PHY_54616
export BRCM_BOARD_ID BRCM_NUM_MAC_ADDRESSES BRCM_BASE_MAC_ADDRESS BRCM_PSI_SIZE
export BUILD_SECURE_BOOT SECURE_BOOT_NUM_BTLDR_IMAGES SECURE_BOOT_NUM_BOOT_BLKS SECURE_BOOT_NOR_BOOT_SIZE
export BTRM_BOOT_ONLY BTRM_NAND_BOOT_PARTITION_SIZE BTRM_NUM_IMAGES_IN_PARTITION BTRM_IMAGE_SIZE_ALLOCATION BTRM_NUM_NVRAM_DATA_IN_PARTITION
export SECURE_BOOT_PROCESS_FLD_OEM_COT SECURE_BOOT_ENCRYPT_BTLDRS
export BRCM_AUXFS_PERCENT BRCM_GPON_SERIAL_NUMBER BRCM_GPON_PASSWORD
export BRCM_VOICE_BOARD_ID BRCM_MAIN_TP_NUM
export BRCM_DRIVER_FBOND_DEBUG
export BRCM_MISC1_PARTITION_SIZE BRCM_MISC2_PARTITION_SIZE BRCM_MISC3_PARTITION_SIZE BRCM_MISC4_PARTITION_SIZE
export BUILD_BRCM_CMS BUILD_BRCM_HNDROUTER BUILD_HND_MFG BUILD_HND_NIC BUILD_HND_EAP BUILD_HND_EAP_UBOOT BUILD_BRCM_CPEROUTER BUILD_BRCM_AIRIQ BUILD_HND_EAP_AP1 BUILD_BRCM_HOSTAPD
export BRCM_RDP_PARAM1_SIZE BRCM_RDP_PARAM2_SIZE BRCM_DHD_PARAM1_SIZE BRCM_DHD_PARAM2_SIZE BRCM_DHD_PARAM3_SIZE OOPSLOG_PARTITION_NAME
export BRCM_INCREMENTAL_IMAGE_LOAD
export SECURE_BOOT_ARCH SECURE_BOOT_KEY_DIR SECURE_BOOT_TURNKEY SECURE_BOOT_TK_ABORT_TIMEOUT SECURE_BOOT_TK_REQ_MFG SECURE_BOOT_TK_REQ_FLD SECURE_BOOT_TK_MODE_REQ SECURE_BOOT_TK_MID SECURE_BOOT_TK_KS_OFFS SECURE_BOOT_TK_OID BUILD_SBI_NOHDR BUILD_SBI_SIGN BUILD_SBI_NOHDR_MFG
export BUILD_BCM_WLAN_NO_MFGBIN
export BUILD_RDPA
export BUILD_WEB_SOCKETS
endif # PROFILE
endif #menuconfig
###########################################
# Define Basic Variables
#
###########################################
BL_BUILD_DIR=$(BUILD_DIR)/cfe/build/broadcom/bcm63xx_rom
BRCM_BOARD := bcm963xx
BRCMDRIVERS_DIR = $(BUILD_DIR)/bcmdrivers
SWMDK_BASE = mdk
RDPSDK_DIR=$(BUILD_DIR)/rdp
ifeq ($(strip $(BRCM_CHIP)),63138)
RDP_PROJECT=DSL_63138
endif
ifeq ($(strip $(BRCM_CHIP)),63148)
RDP_PROJECT=DSL_63148
endif
ifeq ($(strip $(BRCM_CHIP)),6838)
ifeq ($(strip $(BUILD_BRCM_FTTDP)),)
RDP_PROJECT=PON_6838
else
RDP_PROJECT=PON_6838_G9991
endif
endif
ifeq ($(strip $(BRCM_CHIP)),6848)
RDP_PROJECT=PON_6838
endif
ifneq ($(findstring _$(strip $(BRCM_CHIP))_,_6858_6846_63158_6856_),)
export BRCM_FULL_CHIP_NAME=$(strip $(BRCM_CHIP)$(subst $\",,$(BRCM_CHIP_REV)))
endif
ifeq ($(strip $(BRCM_CHIP)),6858)
BCM_EPON_STACK_IMPL=2
ifeq ($(strip $(BUILD_BRCM_FTTDP)),)
RDP_PROJECT=PON_6858
else
RDP_PROJECT=PON_6858_G9991
endif
else
BCM_EPON_STACK_IMPL=1
endif
ifeq ($(strip $(BRCM_CHIP)),4908)
RDP_PROJECT=WL4908
endif
ifeq ($(strip $(BRCM_CHIP)),6846)
RDP_PROJECT=PON_6846
endif
ifeq ($(strip $(BRCM_CHIP)),63158)
RDP_PROJECT=DSL_63158
endif
ifeq ($(strip $(BRCM_CHIP)),6856)
RDP_PROJECT=PON_6856
endif
ifneq ($(strip $(RDP_PROJECT)),)
PROJECT_DIR = $(RDPSDK_DIR)/projects/$(RDP_PROJECT)
include $(PROJECT_DIR)/make.proj_flags
endif
export RDPSDK_DIR BCM_EPON_STACK_IMPL
HOSTTOOLS_DIR = $(BUILD_DIR)/hostTools
HOSTTOOLS_PERL_LIB = $(HOSTTOOLS_DIR)/PerlLib:$(HOSTTOOLS_DIR)/local_install/Perl/:$(HOSTTOOLS_DIR)/PerlLib/$(HOST_PERLARCH)/
IMAGES_DIR = $(BUILD_DIR)/image
RELEASE_DIR = $(BUILD_DIR)/release
TARGETS_DIR = $(BUILD_DIR)/targets
DEFAULTCFG_DIR = $(TARGETS_DIR)/defaultcfg
FSSRC_DIR = $(TARGETS_DIR)/fs.src
# nor flash (FIXME - lefotover)
CFE_FILE = $(TARGETS_DIR)/cfe/cfe$(BRCM_CHIP).bin
CFESEC_FILE = $(TARGETS_DIR)/cfe/cfesec$(BRCM_CHIP).bin
ifeq ($(strip $(BUILD_DYNAMIC_CFE)),y)
# build on the fly
CFE_ROM_FILE = $(BUILD_DIR)/cfe/build/broadcom/build_cferom_nand/cfe$(BRCM_CHIP)rom.bin
CFE_RAM_FILE = $(BUILD_DIR)/cfe/build/broadcom/build_cferam_nand/cfe$(BRCM_CHIP)ram.bin
CFE_ROM_EMMC_FILE = $(BUILD_DIR)/cfe/build/broadcom/build_cferom_emmc/cfe$(BRCM_CHIP)rom.bin
CFE_RAM_EMMC_FILE = $(BUILD_DIR)/cfe/build/broadcom/build_cferam_emmc/cfe$(BRCM_CHIP)ram.bin
else
# not build-on-the-fly
CFE_ROM_FILE = $(TARGETS_DIR)/cfe/cfe$(BRCM_CHIP)rom.bin
CFE_RAM_FILE = $(TARGETS_DIR)/cfe/cfe$(BRCM_CHIP)ram.bin
ifeq ($(find $(strip $(BRCM_FULL_CHIP_NAME))),6858B0)
CFE_ROM_EMMC_FILE = $(TARGETS_DIR)/cfe/cfe$(BRCM_CHIP)rom_emmc.bin
CFE_RAM_EMMC_FILE = $(TARGETS_DIR)/cfe/cfe$(BRCM_CHIP)ram_emmc_b0.bin
else
CFE_ROM_EMMC_FILE = $(TARGETS_DIR)/cfe/cfe$(BRCM_CHIP)rom_emmc.bin
CFE_RAM_EMMC_FILE = $(TARGETS_DIR)/cfe/cfe$(BRCM_CHIP)ram_emmc.bin
endif
# end not build-on-the-fly
endif
BLD_SEC_TK=0
BUILD_SBI_UNSEC=$(HOSTTOOLS_DIR)/SecureBootUtils/build_sbi.pl --sec_mode "UNSEC" --sec_arch "$(SECURE_BOOT_ARCH)" --byteorder "$(ARCH_ENDIAN)" --chip "$(BRCM_CHIP)"
ifeq ($(strip $(BUILD_SECURE_BOOT)),y)
ifeq ($(strip $(SECURE_BOOT_TURNKEY)),y)
ifeq ($(strip $(BUILD_DYNAMIC_CFE)),y)
CFE_ROM_FILE_TK = $(BUILD_DIR)/cfe/build/broadcom/build_cferom_nand_tk/cfe$(BRCM_CHIP)rom.bin
CFE_ROM_EMMC_FILE_TK = $(BUILD_DIR)/cfe/build/broadcom/build_cferom_emmc_tk/cfe$(BRCM_CHIP)rom.bin
endif
BLD_SEC_TK=1
endif
SEC_CRED_DIR=$(BUILD_DIR)/$(SECURE_BOOT_KEY_DIR)
export SEC_CRED_DIR
ifeq ($(strip $(SECURE_BOOT_ARCH)),GEN2)
SEC_MODE=MFG
SIGN_SECOPT=sign
NOHDR_SECOPT=noheader
else
SEC_MODE=FLD
ifeq ($(strip $(SECURE_BOOT_PROCESS_FLD_OEM_COT)),y)
NOHDR_SECOPT=oem encrypt noheader
SIGN_SECOPT=oem sign
else
NOHDR_SECOPT=encrypt noheader
SIGN_SECOPT=sign
endif
BUILD_SBI_NOHDR_MFG=$(HOSTTOOLS_DIR)/SecureBootUtils/build_sbi.pl --sec_arch "$(SECURE_BOOT_ARCH)" --build_top "$(BUILD_DIR)" --sec_mode "MFG" --cred_dir "$(SEC_CRED_DIR)" --byteorder "$(ARCH_ENDIAN)" --chip "$(BRCM_CHIP)" --sec_opt "$(NOHDR_SECOPT)"
endif
#common set of arguments for each feature: MFG SEC/FLD SEC, encrypted non headered (cferam) and Unsecure headered
BUILD_SBI_SIGN=$(HOSTTOOLS_DIR)/SecureBootUtils/build_sbi.pl --sec_mode "$(SEC_MODE)" --sec_arch "$(SECURE_BOOT_ARCH)" --sec_opt "$(SIGN_SECOPT)" --cred_dir "$(SEC_CRED_DIR)" --byteorder "$(ARCH_ENDIAN)" --chip "$(BRCM_CHIP)"
BUILD_SBI=$(HOSTTOOLS_DIR)/SecureBootUtils/build_sbi.pl --sec_mode "$(SEC_MODE)" --sec_arch "$(SECURE_BOOT_ARCH)" --cred_dir "$(SEC_CRED_DIR)" --byteorder "$(ARCH_ENDIAN)" --chip "$(BRCM_CHIP)"
BUILD_SBI_NOHDR=$(HOSTTOOLS_DIR)/SecureBootUtils/build_sbi.pl --sec_arch "$(SECURE_BOOT_ARCH)" --build_top "$(BUILD_DIR)" --sec_mode "$(SEC_MODE)" --cred_dir "$(SEC_CRED_DIR)" --byteorder "$(ARCH_ENDIAN)" --chip "$(BRCM_CHIP)" --sec_opt "$(NOHDR_SECOPT)"
ifneq ($(findstring _$(strip $(BRCM_CHIP))_,_4908_6838_6848_6858_63158_6856_),)
CFESEC_ROM_FILE = $(CFE_ROM_FILE)
CFESEC_RAM_FILE = $(CFE_RAM_FILE)
else
CFESEC_ROM_FILE = $(TARGETS_DIR)/cfe/cfesec$(BRCM_CHIP)rom.bin
CFESEC_RAM_FILE = $(TARGETS_DIR)/cfe/cfesec$(BRCM_CHIP)ram.bin
endif
ifeq ($(strip $(BRCM_CHIP)),63138)
CFESEC_ROM_EMMC_FILE = $(TARGETS_DIR)/cfe/cfesec$(BRCM_CHIP)rom_emmc.bin
CFESEC_RAM_EMMC_FILE = $(TARGETS_DIR)/cfe/cfesec$(BRCM_CHIP)ram_emmc.bin
else
CFESEC_ROM_EMMC_FILE = $(CFE_ROM_EMMC_FILE)
CFESEC_RAM_EMMC_FILE = $(CFE_RAM_EMMC_FILE)
endif
endif
export CFE_RAM_FILE
ifeq ($(strip $(BRCM_CHIP)),4908)
PRE_CFE_ROM = --precferom $(TARGETS_DIR)/cfe/precfe$(BRCM_CHIP)rom.bin
endif
BRCM_DTB = 9$(BRCM_CHIP).dtb
DTB_DIR = $(DTS_DIR)/dts/$(BRCM_CHIP)
DTB_FILE = $(DTB_DIR)/$(BRCM_DTB)
SHARED_DIR = $(BUILD_DIR)/shared
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi ; fi)
GENDEFCONFIG_CMD = $(HOSTTOOLS_DIR)/scripts/gendefconfig
USERSPACE_PUBLIC_LIBS_DIR=$(BUILD_DIR)/userspace/public/libs
USERSPACE_DL_MODULES_DIR=$(BUILD_DIR)/userspace/dlModules
USERSPACE_DL_MODULES_BEEP_DIR=$(USERSPACE_DL_MODULES_DIR)/beep
BEEP_PKT_INFO_SUFIX = -pkginfo.txt
BEEP_TAR_GZ_PREFIX = pkg_beep_
BEEP_TAR_GZ_SUFIX = .tar.gz
KERNEL_DEBUG?=0
KERNEL_KALLSYMS=0
#need to export perl library path
# as it is needed by root makefile rules
PERL5LIB=$(HOSTTOOLS_PERL_LIB)
export PERL5LIB
# unexport conficting perl switches that Centos 7 adds by default
unexport PERL_MB_OPT PERL_LOCAL_LIB_ROOT PERL_MM_OPT
ifdef FORCE
COND_FAIL:=(echo "NOT FAILING DUE TO FORCE=$(FORCE)";true)
else #FORCE
COND_FAIL:=(false)
endif #else FORCE
#
# This is for CMS
# We could put this in the make menuconfig, but it might
# confuse the users. For now, we only support one target OS.
# Everytime we see OALDIR, substitute it with linux
#
TARGET_OS = LINUX
OALDIR = $(subst LINUX,linux,$(strip $(TARGET_OS)))
export PROFILE_ARCH PROFILE_KERNEL_VER KERNEL_DIR BRCMDRIVERS_DIR PROJECT_DIR \
LINUXDIR HOSTTOOLS_DIR IMAGES_DIR TARGETS_DIR DEFAULTCFG_DIR \
FSSRC_DIR CFE_FILE SHARED_DIR CONFIG_BCM_KERNEL_CUSTOM BCM_KF\
CMS_LOG_FLAGS OALDIR USERSPACE_PUBLIC_LIBS_DIR \
KERNEL_DEBUG ARCH ARCH_ENDIAN KARCH TOOLCHAIN_BASE BRCM_DTB DTB_DIR DTB_FILE
unexport LS_COLORS
export DESKTOP_LINUX BRCM_BOARD BRCM_UCLIBC
BRCM_BUSYBOX_EXTRA_PATH=/opt
# these vars are needed by busybox
export BUILD_BUSYBOX_GUNZIP BUILD_BUSYBOX_GZIP \
BUILD_BUSYBOX_TAR BUILD_BUSYBOX_UNTAR \
BUILD_BUSYBOX_TELNET \
BUILD_BUSYBOX_VI \
BUILD_BUSYBOX_AWK \
BUILD_BUSYBOX_PIDOF \
BUILD_BUSYBOX_BRCM_VANILLA \
BUILD_BUSYBOX_NTPD \
BUILD_WGET_HTTPS
# update profile BCM_WLIMPL if overridden from CLI
ifneq ($(strip $(WLIMPL)),)
export BCM_WLIMPL := $(WLIMPL)
endif
ifneq ($(strip $(BUILD_BRCM_CPEROUTER)),)
$(info "Build BCA Wireless Router")
#enable HND WAY of compiling
export BUILD_BRCM_HNDROUTER=y
export BCA_CPEROUTER=y
endif
ifneq ($(strip $(BUILD_BRCM_HNDROUTER)),)
ifeq ($(strip $(BUILD_BRCM_CPEROUTER)),)
export BUILD_BRCM_HNDROUTER_ALONE=y
endif
ifeq ($(strip $(BUILD_HND_NIC)),)
export BCM_EXTFDIMAGE_PATH=/etc/wlan/dhd
endif
HNDCOMP_RDIR = main/components/router-sysdep
HNDROUTER_DIR = bcmdrivers/broadcom/net/wl/impl$(BCM_WLIMPL)/$(HNDCOMP_RDIR)
ifneq ($(wildcard $(BUILD_DIR)/$(HNDROUTER_DIR)),)
HNDROUTER_BASE = $(HNDROUTER_DIR)
HNDDRIVER_BASE = $(HNDCOMP_RDIR)
HNDAPPS_BASE = $(HNDCOMP_RDIR)
export HNDAPPS_IN_COMP=y
export HNDAPPS_DIR=$(BUILD_DIR)/$(HNDROUTER_DIR)
else
HNDROUTER_BASE = $(subst /components,/src,$(HNDROUTER_DIR))
HNDDRIVER_BASE = $(subst /components,/src,$(HNDCOMP_RDIR))
HNDAPPS_BASE = $(subst /components,/src,$(HNDCOMP_RDIR))
endif
export HNDROUTER_BASE
export HNDDRIVER_BASE
export HNDAPPS_BASE
endif # BCA_HNDROUTER
###########################################
#
# Define Toolchain
#
###########################################
ifeq ($(strip $(DESKTOP_LINUX)),)
TOOLCHAIN = $(TOOLCHAIN_TOP)/usr
KTOOLCHAIN = $(KTOOLCHAIN_TOP)/usr
LIBDIR = $(TOOLCHAIN_TOP)/$(TOOLCHAIN_LIBDIR)
HOSTUSRLIBDIR = $(TOOLCHAIN_TOP)/usr/lib
USRGCCLIBDIR = $(TOOLCHAIN_TOP)/usr/lib/gcc/$(TOOLCHAIN_PREFIX)/$(TOOLCHAIN_VER)
ifeq ($(strip $(ARCH)),arm64)
EXTRALIBDIR_NAME := lib64
else
EXTRALIBDIR_NAME := lib
endif
EXTRALIBDIR = $(TOOLCHAIN_TOP)/usr/$(TOOLCHAIN_PREFIX)/$(EXTRALIBDIR_NAME)
EXTRAINCDIR = $(TOOLCHAIN_TOP)/usr/lib/gcc/$(TOOLCHAIN_PREFIX)/$(TOOLCHAIN_VER)/include
LIB_PATH = $(TOOLCHAIN_TOP)/lib
LIBCDIR = $(TOOLCHAIN_TOP)/lib
ifndef NO_WERRS
# The new compiler has a bug that if you specify -Werror=frame-larger-than=X, it treats X as 1 (and errors on all functions)
#export BRCM_WERROR_CFLAGS := -Werror=return-type -Werror=uninitialized -Wframe-larger-than=1024
#export BRCM_WERROR_CFLAGS := -Werror=return-type -Werror=uninitialized -Wno-date-time
export BRCM_WERROR_CFLAGS := -Wno-date-time
else
export BRCM_WERROR_CFLAGS := -Wno-date-time
endif
ifeq ($(ARCH),mips)
BRCM_COMMON_CFLAGS := -Os -march=mips32 -fomit-frame-pointer -fno-strict-aliasing -mabi=32 -G0 -msoft-float -pipe -Wa,-mips32 $(BRCM_WERROR_CFLAGS)
BRCM_APP_CFLAGS := $(BRCM_COMMON_CFLAGS) -mno-shared
endif
ifeq ($(ARCH),arm)
BRCM_COMMON_CFLAGS := -Os -march=armv7-a -fomit-frame-pointer -mno-thumb-interwork -mabi=aapcs-linux -marm -fno-common -ffixed-r8 -msoft-float -D__ARM_ARCH_7A__ $(BRCM_WERROR_CFLAGS)
#for mips' -mno-shared (do not generate posistion independent code), arm is -mno-apcs-reentrant which is the default
ifeq ($(CMS_MEM_LEAK_TRACING),y)
# These extra flags are needed by ARM stack backtrace function
BRCM_COMMON_CFLAGS += -fasynchronous-unwind-tables -rdynamic
endif
BRCM_APP_CFLAGS := $(BRCM_COMMON_CFLAGS)
endif # ARCH eq arm
CROSS_COMPILE = $(TOOLCHAIN)/bin/$(TOOLCHAIN_PREFIX)-
KCROSS_COMPILE = $(KTOOLCHAIN)/bin/$(KTOOLCHAIN_PREFIX)-
endif # DESKTOP_LINUX eq empty
ifeq ($(strip $(DESKTOP_LINUX)),y)
CROSS_COMPILE = /usr/bin/
endif
CMN_COMPILE_FLAGS :=
AR = $(CROSS_COMPILE)ar
AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
CPP = $(CROSS_COMPILE)cpp
NM = $(CROSS_COMPILE)nm
STRIP = $(CROSS_COMPILE)strip
SSTRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy
OBJDUMP = $(CROSS_COMPILE)objdump
RANLIB = $(CROSS_COMPILE)ranlib
READELF = $(CROSS_COMPILE)readelf
KNM = $(KCROSS_COMPILE)nm
KSTRIP = $(KCROSS_COMPILE)strip
KOBJCOPY = $(KCROSS_COMPILE)objcopy
KOBJDUMP = $(KCROSS_COMPILE)objdump
# If building on desktop, don't strip binaries
ifeq ($(strip $(DESKTOP_LINUX)),y)
STRIP = /bin/touch
SSTRIP = /bin/touch
endif
# If building on desktop, set LIBDIR for legacy makefiles
# that still use LIBDIR (e.g. zebra)
ifeq ($(strip $(DESKTOP_LINUX)),y)
LIB_PATH = /usr/lib
LIBDIR = /usr/lib
LIBCDIR = /usr/lib
endif
# STRIP is used to strip the kernel modules. Currently, there is no
# usage scenario which requires unstripped kernel modules.
# SSTRIP is used to strip userspace apps in the final fs dir.
export TOOLCHAIN_TOP TOOLCHAIN LEGACY_TOOLCHAIN CROSS_COMPILE \
AR AS LD CC CXX CPP NM STRIP SSTRIP OBJCOPY OBJDUMP RANLIB READELF \
LIB_PATH LIBDIR HOSTUSRLIBDIR EXTRALIBDIR EXTRAINCDIR LIBCDIR \
BUILD_GDBSERVER KNM KSTRIP KOBJCOPY KOBJDUMP
###########################################
#
# Application-specific settings
#
###########################################
TARGET_FS = $(TARGETS_DIR)/$(PROFILE)/fs
TARGET_BOOTFS = $(TARGETS_DIR)/$(PROFILE)/bootfs
PROFILE_DIR = $(TARGETS_DIR)/$(PROFILE)
INSTALL_DIR=$(PROFILE_DIR)/fs.install
INSTALLDIR=$(PROFILE_DIR)/fs.install
MODULESDIR=$(PROFILE_DIR)/modules
PLATFORMDIR=$(PROFILE_DIR)
BCM_FSBUILD_DIR=$(PROFILE_DIR)/fs.build$(BCM_INSTALL_SUFFIX_DIR)
PROFILE_PATH = $(TARGETS_DIR)/$(PROFILE)/$(PROFILE)
VENDOR_NAME = bcm
FLASH_BASE_IMAGE_NAME = $(VENDOR_NAME)$(PROFILE)
FS_KERNEL_IMAGE_NAME = $(FLASH_BASE_IMAGE_NAME)_fs_kernel
CFE_FS_KERNEL_IMAGE_NAME = $(FLASH_BASE_IMAGE_NAME)_cfe_fs_kernel
FLASH_IMAGE_NAME = $(FLASH_BASE_IMAGE_NAME)_flash_image_$(BRCM_BOARD_ID)
FLASH_IMAGE_NAME_EMMC_DATA_PHYSPART = $(FLASH_BASE_IMAGE_NAME)_emmc_datapartition_flash_image_$(BRCM_BOARD_ID)
FLASH_IMAGE_NAME_EMMC_BOOT_PHYSPART = $(FLASH_BASE_IMAGE_NAME)_emmc_bootpartition_flash_image_$(BRCM_BOARD_ID)
FLASH_NAND_CFEROM_FS_IMAGE_NAME_16 = $(FLASH_BASE_IMAGE_NAME)_nand_cferom_fs_image_16
FLASH_NAND_FS_IMAGE_NAME_16 = $(FLASH_BASE_IMAGE_NAME)_nand_fs_image_16
BCM_FLASH_NAND_CFEROM_FS_IMAGE_NAME_128 = $(FLASH_BASE_IMAGE_NAME)_nand_cferom_fs_image_128
BCM_FLASH_NAND_FS_IMAGE_NAME_128 = $(FLASH_BASE_IMAGE_NAME)_nand_fs_image_128
FLASH_NAND_CFEROM_FS_IMAGE_NAME_128 = $(IMGNAME)_cferom
FLASH_NAND_FS_IMAGE_NAME_128 = $(IMGNAME)
FLASH_NAND_CFEROM_FS_IMAGE_NAME_256 = $(FLASH_BASE_IMAGE_NAME)_nand_cferom_fs_image_256
FLASH_NAND_FS_IMAGE_NAME_256 = $(FLASH_BASE_IMAGE_NAME)_nand_fs_image_256
FLASH_NAND_CFEROM_FS_IMAGE_NAME_512 = $(FLASH_BASE_IMAGE_NAME)_nand_cferom_fs_image_512
FLASH_NAND_FS_IMAGE_NAME_512 = $(FLASH_BASE_IMAGE_NAME)_nand_fs_image_512
FLASH_NAND_CFEROM_FS_IMAGE_NAME_1024 = $(FLASH_BASE_IMAGE_NAME)_nand_cferom_fs_image_1024
FLASH_NAND_FS_IMAGE_NAME_1024 = $(FLASH_BASE_IMAGE_NAME)_nand_fs_image_1024
FLASH_NAND_CFEROM_FS_IMAGE_NAME_2048 = $(FLASH_BASE_IMAGE_NAME)_nand_cferom_fs_image_2048
FLASH_NAND_FS_IMAGE_NAME_2048 = $(FLASH_BASE_IMAGE_NAME)_nand_fs_image_2048
FLASH_NAND_BLOCK_16KB=16384
FLASH_NAND_BLOCK_128KB=131072
FLASH_NAND_BLOCK_256KB=262144
FLASH_NAND_BLOCK_512KB=524288
FLASH_NAND_BLOCK_1024KB=1048576
FLASH_NAND_BLOCK_2048KB=2097152
ifneq ($(findstring _$(strip $(BRCM_CHIP))_,_63138_63148_4908_6858_63158_6856_6846_),)
FLASH_BOOT_OFS=65536
else
FLASH_BOOT_OFS=0
endif
INC_BRCMDRIVER_PUB_PATH=$(BRCMDRIVERS_DIR)/opensource/include
INC_BRCMDRIVER_PRIV_PATH=$(BRCMDRIVERS_DIR)/broadcom/include
INC_ADSLDRV_PATH=$(BRCMDRIVERS_DIR)/broadcom/char/adsl/impl1
INC_ATMAPI_DRV_PATH=$(BRCMDRIVERS_DIR)/broadcom/char/atmapi/impl1
INC_MOCACFGDRV_PATH=$(BRCMDRIVERS_DIR)/opensource/char/moca/impl2
INC_GPON_PATH=$(BRCMDRIVERS_DIR)/broadcom/char/gpon/impl6
INC_BRCMSHARED_PUB_PATH=$(SHARED_DIR)/opensource/include
INC_BRCMSHARED_PRIV_PATH=$(SHARED_DIR)/broadcom/include
INC_BRCMBOARDPARMS_PATH=$(SHARED_DIR)/opensource/boardparms
INC_FLASH_PATH=$(SHARED_DIR)/opensource/flash
INC_UTILS_PATH=$(SHARED_DIR)/opensource/utils
INC_SPI_PATH=$(SHARED_DIR)/opensource/spi
INC_SPUDRV_PATH=$(BRCMDRIVERS_DIR)/broadcom/char/spudd/impl1
INC_PWRMNGTDRV_PATH=$(BRCMDRIVERS_DIR)/broadcom/char/pwrmngt/impl1
INC_ENETDRV_PATH=$(BRCMDRIVERS_DIR)/opensource/net/enet/impl5
INC_EPONDRV_PATH=$(BRCMDRIVERS_DIR)/broadcom/char/epon/impl1
INC_RDPA_MW_PATH=$(BRCMDRIVERS_DIR)/opensource/char/rdpa_mw/impl1
INC_RDP_FLAGS = -I$(PROJECT_DIR)/target/bdmf/system \
-I$(PROJECT_DIR)/target/bdmf/system/linux \
-I$(PROJECT_DIR)/target/bdmf/system/linux/ce \
-I$(PROJECT_DIR)/target/bdmf/framework \
-I$(PROJECT_DIR)/target/bdmf/shell \
-I$(PROJECT_DIR)/target/rdp_subsystem \
-I$(PROJECT_DIR)/target/rdp_subsystem/RU \
-I$(PROJECT_DIR)/target/rdpa \
-I$(PROJECT_DIR)/target/rdpa_gpl \
-I$(PROJECT_DIR)/target/rdd \
-I$(INC_BRCMSHARED_PUB_PATH)/rdp \
-I$(INC_BRCMSHARED_PUB_PATH)/pmc \
-I$(INC_BRCMSHARED_PUB_PATH)/drv/mdio \
-I$(INC_BRCMSHARED_PUB_PATH)/drv/phys \
-I$(INC_BRCMSHARED_PRIV_PATH)/$(BRCM_BOARD) \
-I$(INC_BRCMSHARED_PUB_PATH)/$(BRCM_BOARD) \
-I$(INC_BRCMDRIVER_PUB_PATH)/$(BRCM_BOARD) \
-I$(INC_BRCMDRIVER_PRIV_PATH)/$(BRCM_BOARD) \
-I$(SHARED_DIR)/opensource/drv/lport \
-I$(KERNEL_DIR)/net/core \
-I$(BRCMDRIVERS_DIR)/opensource/char/rdpa_gpl/impl1/include \
-I$(BRCMDRIVERS_DIR)/opensource/char/rdpa_gpl/impl1/include/autogen \
-I$(BRCMDRIVERS_DIR)/opensource/char/rdpa_gpl_ext/impl1/include \
-I$(BRCMDRIVERS_DIR)/opensource/char/rdpa_gpl_ext/impl1/include/gpon_stack \
-I$(BRCMDRIVERS_DIR)/opensource/char/rdpa_gpl_ext/impl1/include/autogen \
-I$(BRCMDRIVERS_DIR)/broadcom/char/pon_drv/impl1 \
-I$(BRCMDRIVERS_DIR)/opensource/char/fpm/impl1 \
$(PROJ_DEFS)
INC_ENET_DMA_FLAGS = -I$(INC_BRCMSHARED_PUB_PATH)/drv/phys \
-I$(INC_BRCMSHARED_PUB_PATH)/bcm963xx \
-I$(BRCMDRIVERS_DIR)/opensource/include/bcm963xx \
-I$(BRCMDRIVERS_DIR)/opensource/net/enet/shared \
-I$(BRCMDRIVERS_DIR)/broadcom/include/bcm963xx
export TARGET_FS TARGET_BOOTFS PROFILE_DIR INSTALL_DIR \
BCM_FSBUILD_DIR BCM_INSTALL_SUFFIX BCM_INSTALL_SUFFIX_DIR \
VENDOR_NAME FLASH_BASE_IMAGE_NAME \
FLASH_BOOT_OFS \
BUILD_NAND_IMG_BLKSIZE_16KB \
BUILD_NAND_IMG_BLKSIZE_128KB \
BUILD_NAND_IMG_BLKSIZE_256KB \
BUILD_NAND_IMG_BLKSIZE_512KB \
BUILD_NAND_IMG_BLKSIZE_1024KB \
INC_BRCMDRIVER_PUB_PATH INC_BRCMDRIVER_PRIV_PATH \
INC_ADSLDRV_PATH INC_ATMAPI_DRV_PATH \
INC_BRCMSHARED_PUB_PATH INC_BRCMSHARED_PRIV_PATH \
INC_BRCMBOARDPARMS_PATH INC_FLASH_PATH \
INC_UTILS_PATH \
INC_PWRMNGTDRV_PATH INC_SPI_PATH \
INC_RDPA_MW_PATH \
INC_ENET_DMA_FLAGS
##################################################################
#
# Start CMS specific defines
#
##################################################################
ifeq ($(strip $(DESKTOP_LINUX)),y)
#Defines when are are building for Desktop Linux
ifdef BRCM_CMS_COMPILER_OPTS
CMN_COMPILER_OPTS := -Wall -W $(BRCM_CMS_COMPILER_OPTS) -DDESKTOP_LINUX -fPIC
else
# The -O is needed to detect uninitialized variables, but sometimes prevents
# gdb from printing out a variable value. So if you need to do some serious
# debugging, set BRCM_CMS_COMPILER_OPTS=-g in your shell.
CMN_COMPILER_OPTS := -Wall -W -O -g -DDESKTOP_LINUX -fPIC
endif
ifneq ($(strip $(BUILD_DESKTOP_BEEP)),)
CMN_COMPILER_OPTS += -DBUILD_DESKTOP_BEEP
endif
ifneq ($(strip $(ARCH)),x86_64)
# Force 32 bit compiles
CMN_COMPILER_OPTS += -m32
export BCM_LD_FLAGS := -m32
endif
CMS_COMMON_LIBS := -lcms_util -lbcm_crc -lbcm_flashutil -lbcm_boardctl -lcrypt -lrt
CMS_LIB_RPATH = $(ALLOWED_LIB_DIRS):$(INSTALL_DIR)$(subst :,:$(INSTALL_DIR),$(ALLOWED_LIB_DIRS))
else # real target system
# Defines when we are building for real target system
CMN_COMPILER_OPTS := $(BRCM_COMMON_CFLAGS) -Wall -D$(ARCH) -g -fPIC
CMN_COMPILER_OPTS2 := $(BRCM_COMMON_CFLAGS) -Wall -g -fPIC
ifneq ($(strip $(BUILD_BRCM_CMS)),)
CMS_COMMON_LIBS := -lcms_util -lbcm_crc -lbcm_flashutil -lbcm_boardctl -lcrypt
else # BUILD_BRCM_CMS
CMS_COMMON_LIBS := -lbcm_crc -lbcm_flashutil -lbcm_boardctl -lcrypt
endif # BUILD_BRCM_CMS
ifeq ($(CMS_MEM_LEAK_TRACING),y)
ifeq ($(ARCH),arm)
# arm backtrace code calls dlopen
CMS_COMMON_LIBS += -ldl
endif
endif
CMS_LIB_RPATH =
endif # DESKTOP_LINUX
# This is the cms_core library plus all the libraries that libcms_core
# depend on.
ifneq ($(strip $(BUILD_BRCM_CMS)),)
CMS_CORE_LIBS := -lcms_core -lcms_qdm -lnanoxml -ldl
else # BUILD_BRCM_CMS
CMS_CORE_LIBS := -ldl
endif # BUILD_BRCM_CMS
ifneq ($(strip $(BRCM_DRIVER_ADSL)),)
CMS_CORE_LIBS += -lxdslctl
ifneq ($(strip $(BUILD_DSL_SELT_TEST)),)
CMS_CORE_LIBS += -lseltctl
endif
endif
ifneq ($(strip $(BRCM_DRIVER_XTM)),)
CMS_CORE_LIBS += -latmctl
endif
ifneq ($(strip $(BUILD_MoCACTL)),)
CMS_CORE_LIBS += -lmocactl -lm
export BUILD_MoCACTL;
endif
ifneq ($(strip $(BUILD_MoCACTL2)),)
CMS_CORE_LIBS += -lpthread
endif
ifneq ($(strip $(BUILD_HOMEPLUG)),)
CMS_CORE_LIBS += -lhomeplugctl -lhomeplugctl_drv
export BUILD_HOMEPLUG
endif
ifneq ($(strip $(BUILD_GPONCTL)),)
CMS_CORE_LIBS += -lgponctl -lgponif
endif
ifneq ($(strip $(BUILD_OMCI)),)
CMS_CORE_LIBS += -lomciutil
BUILD_CMS_UTIL=y
ifneq ($(strip $(BUILD_BCMIPC)),)
CMS_CORE_LIBS += -lbcmipc
endif
endif
ifneq ($(strip $(BUILD_VLANCTL)),)
CMS_CORE_LIBS += -lvlanctl
endif
ifneq ($(strip $(BUILD_SPUCTL)),)
CMS_CORE_LIBS += -lspuctl
endif
ifneq ($(strip $(BUILD_PWRCTL)),)
CMS_CORE_LIBS += -lpwrctl
endif
ifneq ($(strip $(BUILD_ETHSWCTL)),)
CMS_CORE_LIBS += -lethswctl -lethctl
endif
ifneq ($(strip $(BUILD_EPONCTL)),)
CMS_CORE_LIBS += -leponctl
endif
ifneq ($(strip $(BUILD_CMFAPI)),)
CMS_CORE_LIBS += -lcmfapi
endif
ifneq ($(strip $(BUILD_FAPCTL)),)
CMS_CORE_LIBS += -lfapctl
endif
ifneq ($(strip $(BUILD_CLI_CMD)),)
CMS_CORE_LIBS += -lm
endif
ifneq ($(strip $(BUILD_BRCTL)),)
CMS_CORE_LIBS += -lbridgeutil
endif
ifneq ($(strip $(BUILD_BCMTM)),)
CMS_CORE_LIBS += -lbcmtm
endif
CMS_LIB_PATH = $(patsubst %,-L$(INSTALL_DIR)%,$(subst :, ,$(ALLOWED_LIB_DIRS)))
#
# Several features will trigger the building of libpcap.
ifneq ($(strip $(BUILD_SENDPACKETS))$(strip $(BUILD_TCPDUMP)),)
BUILD_LIBPCAP=y
endif
ifneq ($(strip $(BUILD_LXC)),)
BUILD_BUSYBOX_GZIP=y
BUILD_BUSYBOX_TAR=y
BUILD_BUSYBOX_UNTAR=y
BUILD_BUSYBOX_AWK=y
endif
ifneq ($(strip $(BUILD_DBUS)),)
export DO_BUILD_EXPAT=y
endif
ifneq ($(strip $(BRCM_ANDROID)),)
BUILD_LIBPCAP=y
BUILD_BUSYBOX_GZIP=y
BUILD_BUSYBOX_GUNZIP=y
BUILD_BUSYBOX_TAR=y
BUILD_BUSYBOX_UNTAR=y
endif
# this means the user wants to have a LTE interface
ifneq ($(strip $(BRCM_DRIVER_LTE)),)
BUILD_CELLULAR=y
BUILD_SAMOS=y
BUILD_LIBXML2=y
BUILD_LIBSQLITE=y
BUILD_LIBCAP=y
export BUILD_SAMOS
export BUILD_CELLULAR
export BUILD_LIB_STLPORT=y
endif
#
# Many features will trigger the building of OpenSSL.
# OpenSSL is both a library and an app.
# We could distinguish betwen building OpenSSL lib and OpenSSL app,
# but for now, we always build and install both. I have a plan to
# get rid of the app completely.
#
ifneq ($(strip $(BUILD_CERT)),)
DO_BUILD_OPENSSL=y
DO_BUILD_EXPAT=y
endif
ifneq ($(strip $(BUILD_TR69C_SSL)),)
DO_BUILD_OPENSSL=y
DO_BUILD_EXPAT=y
endif
ifneq ($(strip $(BUILD_HTTPD_SSL)),)
DO_BUILD_OPENSSL=y
DO_BUILD_EXPAT=y
endif
ifneq ($(strip $(BUILD_HTTPD_BASIC_SSL)),)
DO_BUILD_OPENSSL=y
DO_BUILD_EXPAT=y
endif
ifneq ($(strip $(BUILD_IPSEC_TOOLS)),)
DO_BUILD_OPENSSL=y
DO_BUILD_EXPAT=y
endif
ifneq ($(strip $(BUILD_OMCI_AUTH)),)
DO_BUILD_OPENSSL=y
DO_BUILD_EXPAT=y
endif
export DO_BUILD_OPENSSL DO_BUILD_EXPAT
#
# Top level decisions about which Data Model(s) we are going to use
#
CMS_DMP_FLAGS :=
BUILD_TR98_PROFILES :=
BUILD_HYBRID181_PROFILES :=
BUILD_PURE181_PROFILES :=
BUILD_TR104_PROFILES :=
ifneq ($(strip $(BUILD_DM_LEGACY98)),)
BUILD_TR98_PROFILES := y
CMS_DMP_FLAGS += -DSUPPORT_DM_LEGACY98
endif
ifneq ($(strip $(BUILD_DM_HYBRID)),)
BUILD_TR98_PROFILES := y
BUILD_HYBRID181_PROFILES := y
CMS_DMP_FLAGS += -DSUPPORT_DM_HYBRID
endif
ifneq ($(strip $(BUILD_DM_PURE181)),)
BUILD_HYBRID181_PROFILES := y
BUILD_PURE181_PROFILES := y
CMS_DMP_FLAGS += -DSUPPORT_DM_PURE181
endif
ifneq ($(strip $(BUILD_DM_DETECT)),)
BUILD_TR98_PROFILES := y
BUILD_HYBRID181_PROFILES := y
BUILD_PURE181_PROFILES := y
CMS_DMP_FLAGS += -DSUPPORT_DM_DETECT
endif
ifneq ($(strip $(BUILD_DM_TR104_V2)),)
BUILD_TR104_PROFILES := 2
else
BUILD_TR104_PROFILES := 1
endif
export BUILD_DM_WLAN_RETAIL
export BUILD_TR104_PROFILES
#
# ==> These TR98 profiles are always defined when the root
# of the data model is InternetGatewayDevice, i.e. when we are in
# Legacy TR98 and Hybrid98+181 modes.
#
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_BASELINE_1 -DDMP_X_BROADCOM_COM_BASELINE_1
CMS_DMP_FLAGS += -DDMP_ETHERNETLAN_1
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_DEBUG_1
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_SECURITY_1
ifeq ($(strip $(BUILD_DM_WLAN_RETAIL)),)
CMS_DMP_FLAGS += -DDMP_DEVICEASSOCIATION_1
CMS_DMP_FLAGS += -DDMP_IPPING_1
CMS_DMP_FLAGS += -DDMP_DUSTATECHNGCOMPLPOLICY_1
endif
endif
#
# ==> This is a small subset of the TR181 profiles which are always
# defined in both Hybrid98+181 and Pure TR181 modes.
#
ifneq ($(strip $(BUILD_HYBRID181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_BASELINE_1 -DDMP_DEVICE2_X_BROADCOM_COM_BASELINE_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_BASELINE_2
CMS_DMP_FLAGS += -DDMP_DEVICE2_BASELINE_3
CMS_DMP_FLAGS += -DDMP_DEVICE2_IPINTERFACE_1 -DDMP_DEVICE2_IPINTERFACE_2
# In Hybrid, we don't use TR181 EthernetInterface, but we must define it
# in order to get EthernetLink, which we need.
CMS_DMP_FLAGS += -DDMP_DEVICE2_ETHERNETLINK_1 -DDMP_DEVICE2_ETHERNETINTERFACE_1 -DDMP_DEVICE2_VLANTERMINATION_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_PPPINTERFACE_1 -DDMP_DEVICE2_PPPINTERFACE_2
ifeq ($(strip $(BUILD_DM_WLAN_RETAIL)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_IPPING_1 -DDMP_DEVICE2_TRACEROUTE_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_ROUTING_1 -DDMP_DEVICE2_ROUTING_2
CMS_DMP_FLAGS += -DDMP_DEVICE2_DUSTATECHNGCOMPLPOLICY_1
endif
endif
#
# ==> These TR181 profiles are always defined in Pure TR181 mode (but
# not in Hybrid98+181 mode)
#
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_BRIDGE_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_ROUTING_1 -DDMP_DEVICE2_ROUTING_2
CMS_DMP_FLAGS += -DDMP_DEVICE2_NAT_1 -DDMP_DEVICE2_PROCESSORS_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_HOSTS_1 -DDMP_DEVICE2_HOSTS_2
CMS_DMP_FLAGS += -DDMP_DEVICE2_DHCPV4SERVERCLIENTINFO_1
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_DEBUG_1
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_SECURITY_1
ifeq ($(strip $(BUILD_DM_WLAN_RETAIL)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_DEVICEASSOCIATION_1
else
CMS_DMP_FLAGS += -DSUPPORT_RETAIL_DM
endif
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_BASELINE_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_SIMPLEFIREWALL_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_ADVANCEDFIREWALL_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_MEMORYSTATUS_1 -DDMP_DEVICE2_PROCESSSTATUS_1
endif
# TR104 profile
ifneq ($(strip $(BUILD_DM_TR104_V2)),)
CMS_DMP_FLAGS += -DDMP_VOIPPROFILE_1
CMS_DMP_FLAGS += -DDMP_INTERWORK_1
CMS_DMP_FLAGS += -DDMP_TRUNK_1
CMS_DMP_FLAGS += -DDMP_CALLSTATISTICS_1
CMS_DMP_FLAGS += -DDMP_TERMINAL_1
endif
#
# ADSLWAN_1 profile is used to mean presence of xDSL technology on
# the modem, the presence of ATM technology, and presence of ADSL.
# BUILD_DSL is a pre-requisit for loop diag, atm loopback, bonding,
# vdsl phy, and multi-mode phy. ATM WAN and PTM WAN have their own
# controls in make menuconfig, so users should be smart enough to
# unselect that if DSL driver is not built.
#
ifneq ($(strip $(BUILD_DSL)),)
export BUILD_DSL
export BUILD_XDSLCTL
# Compile flags module or application that use ADSL MIBS
BUILD_DSL_FLAGS := -DNONE
BUILD_DSL_FLAGS += -DLINUX_FW_EXTRAVERSION=$(BRCM_VERSION)$(BRCM_RELEASE)$(shell echo $(BRCM_EXTRAVERSION) | head -c 2)
CMS_DMP_FLAGS += -DSUPPORT_DSL
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_DSL_1 -DDMP_DEVICE2_ADSL_1 -DDMP_DEVICE2_ADSL2_1
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_DSL_1
endif
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_ADSLWAN_1 -DDMP_X_BROADCOM_COM_ADSLWAN_1
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_XTMSTATS_1
endif
ifneq ($(strip $(BUILD_DSL_LOOP_DIAG)),)
CMS_DMP_FLAGS += -DDMP_DSLDIAGNOSTICS_1
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS +=-DDMP_DEVICE2_DSLDIAGNOSTICS_1
endif
endif
ifneq ($(strip $(BUILD_DSL_SELT_TEST)),)
BUILD_DSL_FLAGS += -DSUPPORT_SELT
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_SELT_1
export BUILD_DSL_SELT_TEST=y
endif
ifeq ($(strip $(BRCM_PHY_BONDING)),y)
BUILD_DSL_FLAGS += -DSUPPORT_DSL_BONDING
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_DSLBONDING_1
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_BONDEDDSL_1
endif
export BRCM_PHY_BONDING=y
endif
ifeq ($(strip $(BRCM_PHY_LOOPBACK)),y)
CMS_DMP_FLAGS += -DSUPPORT_DSL_LOOPBACK
export BRCM_PHY_LOOPBACK=y
endif
ifeq ($(strip $(BRCM_MULTI_PHY)),y)
BUILD_DSL_FLAGS += -DSUPPORT_MULTI_PHY
export BRCM_MULTI_PHY=y
endif
ifeq ($(strip $(BRCM_PHY_BONDING5B)),y)
BUILD_DSL_FLAGS += -DSUPPORT_DSL_BONDING5B
export BRCM_PHY_BONDING5B=y
endif
ifeq ($(strip $(BRCM_PHY_BONDING_C0)),y)
export BRCM_PHY_BONDING_C0=y
endif
ifeq ($(strip $(BRCM_ANNEXAB_COMBO)),y)
CMS_DMP_FLAGS += -DSUPPORT_ANNEXAB_COMBO
export BRCM_ANNEXAB_COMBO=y
endif
DSL_GINP_RTX_DRIVER_DEFINES := -DNONE
ifeq ($(strip $(BRCM_PHY_GINP_RTX)),y)
ifneq ($(findstring _$(strip $(BRCM_CHIP))_,_63268_63138_63148_63158_),)
CMS_DMP_FLAGS += -DSUPPORT_DSL_GINP_RTX
DSL_GINP_RTX_DRIVER_DEFINES += -DSUPPORT_DSL_GINP_RTX
export BRCM_PHY_GINP_RTX=y
endif
endif
export DSL_GINP_RTX_DRIVER_DEFINES
DSL_EXT_BONDING_DRIVER_DEFINES := -DNONE
ifeq ($(strip $(BRCM_EXT_PHY_BONDING)),y)
CMS_DMP_FLAGS += -DSUPPORT_DSL_BONDING
ifeq ($(strip $(BRCM_CHIP)),63268)
CMS_DMP_FLAGS += -DSUPPORT_EXT_DSL_BONDING -DDMP_X_BROADCOM_COM_DSLBONDING_1
endif
ifeq ($(strip $(BRCM_CHIP)),6368)
CMS_DMP_FLAGS += -DSUPPORT_EXT_DSL_BONDING
endif
DSL_EXT_BONDING_DRIVER_DEFINES += -DSUPPORT_EXT_DSL_BONDING
export BRCM_EXT_PHY_BONDING=y
endif
export DSL_EXT_BONDING_DRIVER_DEFINES
DSL_XTM_SAR_TX_RX_IUDMA_631XX_DEFINES := -DNONE
ifeq ($(strip $(BRCM_DSL_TX_RX_IUDMA)),y)
DSL_XTM_SAR_TX_RX_IUDMA_631XX_DEFINES += -DSUPPORT_631XX_TX_RX_IUDMA
export SUPPORT_631XX_TX_RX_IUDMA=y
export BRCM_DSL_TX_RX_IUDMA=y
else
# Following enables RDP mode but no runner acceleration, if the
# SUPPORT_631XX_NO_FC_XDSL_ACCELERATION switch is enabled.
#export SUPPORT_631XX_NO_FC_XDSL_ACCELERATION=y
ifeq "$(SUPPORT_631XX_NO_FC_XDSL_ACCELERATION)" "y"
DSL_XTM_SAR_TX_RX_IUDMA_631XX_DEFINES += -DSUPPORT_631XX_NO_FC_XDSL_ACCELERATION
endif
endif
export DSL_XTM_SAR_TX_RX_IUDMA_631XX_DEFINES
# VDSL flags have to be turned on for VDSL and Multimode phy
ifneq ($(strip $(BUILD_PHY_VDSL)),)
CMS_DMP_FLAGS += -DDMP_VDSL2WAN_1 -DDMP_X_BROADCOM_COM_VDSL2WAN_1
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_VDSL2_1
endif
endif
ifneq ($(strip $(BUILD_PHY_MULTIMODE)),)
CMS_DMP_FLAGS += -DDMP_VDSL2WAN_1 -DDMP_X_BROADCOM_COM_VDSL2WAN_1
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_VDSL2_1
endif
endif
# G.FAST flags
DSL_GFAST_DEFINES := -DNONE
ifeq ($(strip $(BRCM_PHY_GFAST)),y)
ifneq ($(findstring _$(strip $(BRCM_CHIP))_,_63138_63158_),)
DSL_GFAST_DEFINES += -DSUPPORT_DSL_GFAST
export BRCM_PHY_GFAST=y
ifeq ($(strip $(BRCM_PHY_GFASTCOMBO)),y)
DSL_GFAST_DEFINES += -DSUPPORT_DSL_GFASTCOMBO
export BRCM_PHY_GFASTCOMBO=y
endif
ifeq ($(strip $(BUILD_PURE181_PROFILES)),y)
CMS_DMP_FLAGS += -DDMP_DEVICE2_FAST_1
endif
endif
endif
ifeq ($(strip $(BRCM_PHY_CO)),y)
ifneq ($(findstring _$(strip $(BRCM_CHIP))_,_63158_),)
DSL_GFAST_DEFINES += -DBRCM_PHY_CO
export BRCM_PHY_CO=y
endif
endif
CMS_DMP_FLAGS += ${BUILD_DSL_FLAGS} ${DSL_GFAST_DEFINES}
CMN_COMPILE_FLAGS += ${BUILD_DSL_FLAGS} ${DSL_GFAST_DEFINES}
export BUILD_PHY_ADSL BUILD_DSL_FLAGS
endif
# ==== end of BUILD_DSL section ====
# ==== start of BUILD_CELLULAR section ====
#
ifneq ($(strip $(BUILD_CELLULAR)),)
CMS_DMP_FLAGS += -DSUPPORT_CELLULAR
ifneq ($(strip $(BUILD_DM_HYBRID)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_CELLULARWAN_1
CMS_DMP_FLAGS += -DDMP_CELLULARINTERFACEBASE_1 -DDMP_CELLULARINTERFACEEXTENDED_1 -DDMP_CELLULARINTERFACESTATS_1
endif
CMS_CORE_LIBS += -lsqlite3
endif
# ==== end of BUILD_CELLULAR section ====
#
# Various technologies as WAN interface selections
#
ifneq ($(findstring _$(strip $(BRCM_CHIP))_,_6838_6848_6858_6846_6856_),)
ifeq ($(BUILD_GPON),y)
export BCM_PON=y
endif
ifeq ($(BUILD_EPON_SDK),y)
export BCM_PON=y
endif
ifneq ($(findstring _$(strip $(BRCM_CHIP))_,_6858_6846_6856_),)
export BCM_PON_XRDP=y
endif
ifneq ($(findstring _$(strip $(BRCM_CHIP))_,_6838_6848_),)
export BCM_PON_RDP=y
endif
endif
ifneq ($(findstring _$(strip $(BRCM_CHIP))_,_63138_63148_4908_63158_),)
ifneq ($(findstring _$(strip $(BRCM_CHIP))_,_63138_63148_4908_),)
export BCM_DSL_RDP=y
endif
ifneq ($(findstring _$(strip $(BRCM_CHIP))_,_63158_),)
export BCM_DSL_XRDP=y
endif
endif
ifneq ($(findstring _$(strip $(BRCM_CHIP))_,_6858_63158_6846_6856_),)
export BCM_XRDP=y
endif
ifneq ($(findstring _$(strip $(BRCM_CHIP))_,_6838_6848_63138_63148_4908_),)
export BCM_RDP=y
endif
# this means the user wants to have a ATM WAN interface
# We don't have a SUPPORT_ATM flag. It is implied by SUPPORT_DSL.
ifneq ($(strip $(BUILD_ATMWAN)),)
export BUILD_WAN_HTML=y
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_ATMWAN_1
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_ATMLINK_1 -DDMP_DEVICE2_X_BROADCOM_COM_ATMLINK_1
endif
endif
# ATMLOOPBACK is automatically selected in config.in when ATM WAN is selected
ifneq ($(strip $(BUILD_ATMLOOPBACK)),)
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_ATMLOOPBACK_1 -DDMP_X_BROADCOM_COM_ATMLOOPBACK_1
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_ATMLOOPBACK_1 -DDMP_DEVICE2_X_BROADCOM_COM_ATMLOOPBACK_1
endif
endif
# this means the modem has PTM technology and user wants to have
# a PTM WAN interface
ifneq ($(strip $(BUILD_PTMWAN)),)
export BUILD_WAN_HTML=y
CMS_DMP_FLAGS += -DSUPPORT_PTM
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_PTMWAN_1 -DDMP_X_BROADCOM_COM_PTMWAN_1
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_PTMLINK_1 -DDMP_DEVICE2_X_BROADCOM_COM_PTMLINK_1
endif
endif
# this means the user wants to have a Moca WAN interface
# Look for SUPPORT_MOCA below for main Moca defines
ifneq ($(strip $(BUILD_MOCAWAN)),)
export BUILD_WAN_HTML=y
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_MOCAWAN_1
endif
# TR181 does not have a separate Data Model define for MocaWAN
# So if you enable Moca, you automatically get MocaWAN
endif
# this means user wants to have a ethernet WAN interface
ifneq ($(strip $(BUILD_ETHWAN)),)
export BUILD_WAN_HTML=y
CMS_DMP_FLAGS += -DSUPPORT_ETHWAN
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_ETHERNETWAN_1
endif
# TR181 does not have a separate Data Model define for ethwan
endif
# this means user wants to have FAP TM
ifneq ($(strip $(BUILD_FAPCTL)),)
CMS_DMP_FLAGS += -DSUPPORT_FAPCTL
CMS_DMP_FLAGS += -DSUPPORT_TMCTL
CMS_CORE_LIBS += -ltmctl
endif
ifneq ($(strip $(BRCM_DRIVER_SPDSVC)),)
export BUILD_SPDSVC=y
endif
ifneq ($(strip $(BRCM_DRIVER_TCPSPDTEST)),)
export BUILD_TCPSPDTEST=y
endif
# this means user wants to have BCM TM
ifneq ($(strip $(BUILD_BCMTM)),)
CMS_DMP_FLAGS += -DSUPPORT_TMCTL
CMS_DMP_FLAGS += -DSUPPORT_BCMTM
CMS_CORE_LIBS += -ltmctl
endif
# this means user wants to have RDD related features as us such as TM
ifeq ($(BUILD_RDPA),y)
CMN_COMPILE_FLAGS += -DSUPPORT_RDPA
CMS_DMP_FLAGS += -DSUPPORT_RDPA
ifeq ($(BCM_PON),y)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_RDPA_1
endif
endif
ifneq ($(strip $(BUILD_RDPACTL)),)
CMS_CORE_LIBS += -lrdpactl -ltmctl -lbdmf
CMS_DMP_FLAGS += -DSUPPORT_TMCTL
endif
# this means the user wants to have a EPON WAN interface
ifneq ($(strip $(BUILD_EPONWAN)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_PONWAN_1 -DDMP_X_BROADCOM_COM_EPONWAN_1
export BUILD_WAN_HTML=y
endif
# this means the user wants to have a GponRG Full Omci build
ifneq ($(strip $(BUILD_GPONRG_OMCI_FULL)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_PONWAN_1 -DDMP_X_BROADCOM_COM_GPONWAN_1 -DDMP_X_BROADCOM_COM_GPONRG_OMCI_FULL_1
endif
# this means the user wants to have a GPON OMCI TR69 dual stack
ifneq ($(strip $(BUILD_OMCI_TR69_DUAL_STACK)),)
CMS_DMP_FLAGS += -DOMCI_TR69_DUAL_STACK
endif
ifneq ($(strip $(BUILD_OMCI)),)
ifeq ($(strip $(BUILD_GPONRG_OMCI_FULL)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_GPONONT_1
endif
endif
# this means user wants to have a L2TP AC (PPPoL2TPAC) WAN service
ifneq ($(strip $(BUILD_L2TPAC)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_L2TPAC_1
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_L2TPAC_2
endif
ifneq ($(strip $(BUILD_GRE_TUNNEL)),)
CMS_DMP_FLAGS += -DSUPPORT_GRE_TUNNEL
# Add data model specific flags later
endif
# Use MocaCTL as the main indicator of whether we will have Moca on our
# system or not.
ifneq ($(strip $(BUILD_MoCACTL)),)
CMS_DMP_FLAGS += -DSUPPORT_MOCA
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_MOCALAN_1
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_MOCA_1
endif
endif
ifneq ($(strip $(BUILD_MoCACTL2)),)
CMS_DMP_FLAGS += -DBRCM_MOCA_DAEMON
endif
ifeq ($(strip $(BRCM_AVS_PWRSAVE)),)
ifneq ($(strip $(BRCM_MOCA_AVS)),)
CMN_COMPILE_FLAGS += -DSUPPORT_MOCA_AVS
endif
endif
ifneq ($(strip $(BUILD_SOAP)),)
CMS_DMP_FLAGS += -DSUPPORT_SOAP
endif
ifneq ($(strip $(BUILD_IPSEC_TOOLS)),)
CMS_DMP_FLAGS += -DSUPPORT_IPSEC
ifneq ($(strip $(BUILD_DM_PURE181)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_IPSEC_1
else
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_IPSEC_1
endif
ifneq ($(strip $(BUILD_DM_DETECT)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_IPSEC_1
endif
endif
ifneq ($(strip $(BUILD_SNMP)),)
CMS_DMP_FLAGS += -DSUPPORT_SNMP -DDMP_X_BROADCOM_COM_SNMP_1
ifneq ($(strip $(BUILD_SNMP_ADSL_MIB)),)
export SNMP_ADSL_MIB=1
else
export SNMP_ADSL_MIB=0
endif
ifneq ($(strip $(BUILD_SNMP_ATM_MIB)),)
export SNMP_ATM_MIB=1
else
export SNMP_ATM_MIB=0
endif
ifneq ($(strip $(BUILD_SNMP_BRIDGE_MIB)),)
export SNMP_BRIDGE_MIB=1
else
export SNMP_BRIDGE_MIB=0
endif
ifneq ($(strip $(BUILD_SNMP_AT_MIB)),)
export SNMP_AT_MIB=1
else
export SNMP_AT_MIB=0
endif
ifneq ($(strip $(BUILD_SNMP_SYSOR_MIB)),)
export SNMP_SYSOR_MIB=1
else
export SNMP_SYSOR_MIB=0
endif
ifneq ($(strip $(BUILD_SNMP_TCP_MIB)),)
export SNMP_TCP_MIB=1
else
export SNMP_TCP_MIB=0
endif
ifneq ($(strip $(BUILD_SNMP_UDP_MIB)),)
export SNMP_UDP_MIB=1
else
export SNMP_UDP_MIB=0
endif
ifneq ($(strip $(BUILD_SNMP_IP_MIB)),)
export SNMP_IP_MIB=1
else
export SNMP_IP_MIB=0
endif
ifneq ($(strip $(BUILD_SNMP_ICMP_MIB)),)
export SNMP_ICMP_MIB=1
else
export SNMP_ICMP_MIB=0
endif
ifneq ($(strip $(BUILD_SNMP_SNMP_MIB)),)
export SNMP_SNMP_MIB=1
else
export SNMP_SNMP_MIB=0
endif
ifneq ($(strip $(BUILD_SNMP_ATMFORUM_MIB)),)
export SNMP_ATMFORUM_MIB=1
else
export SNMP_ATMFORUM_MIB=0
endif
ifneq ($(strip $(BUILD_SNMP_CHINA_TELECOM_CPE_MIB)),)
export BUILD_SNMP_CHINA_TELECOM_CPE_MIB=y
endif
ifneq ($(strip $(BUILD_CT_1_39_OPEN)),)
export BUILD_CT_1_39_OPEN=y
endif
ifneq ($(strip $(BUILD_SNMP_CHINA_TELECOM_CPE_MIB_V2)),)
export BUILD_SNMP_CHINA_TELECOM_CPE_MIB_V2=y
endif
ifneq ($(strip $(BUILD_SNMP_BRCM_CPE_MIB)),)
export BUILD_SNMP_BRCM_CPE_MIB=y
endif
ifneq ($(strip $(BUILD_SNMP_UDP)),)
export BUILD_SNMP_UDP=y
endif
ifneq ($(strip $(BUILD_SNMP_EOC)),)
export BUILD_SNMP_EOC=y
endif
ifneq ($(strip $(BUILD_SNMP_AAL5)),)
export BUILD_SNMP_AAL5=y
endif
ifneq ($(strip $(BUILD_SNMP_AUTO)),)
export BUILD_SNMP_AUTO=y
endif
ifneq ($(strip $(BUILD_SNMP_DEBUG)),)
export BUILD_SNMP_DEBUG=y
endif
ifneq ($(strip $(BUILD_SNMP_TRANSPORT_DEBUG)),)
export BUILD_SNMP_TRANSPORT_DEBUG=y
endif
ifneq ($(strip $(BUILD_SNMP_LAYER_DEBUG)),)
export BUILD_SNMP_LAYER_DEBUG=y
endif
endif # BUILD_SNMP
ifneq ($(strip $(BUILD_TR64)),)
CMS_DMP_FLAGS += -DSUPPORT_TR64C -DDMP_X_BROADCOM_COM_TR64_1
endif
ifneq ($(strip $(BUILD_IPV6)),)
CMS_DMP_FLAGS += -DSUPPORT_IPV6
ifneq ($(strip $(BUILD_DM_LEGACY98)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_IPV6_1
else
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_DEV2_IPV6_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_DSLITE_1 -DDMP_DEVICE2_DSLITE_2
CMS_DMP_FLAGS += -DDMP_DEVICE2_IPV6RD_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_IPV6INTERFACE_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_IPV6ROUTING_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_DHCPV6CLIENT_1 -DDMP_DEVICE2_DHCPV6CLIENTSERVERIDENTITY_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_DHCPV6SERVER_1 -DDMP_DEVICE2_DHCPV6SERVERADV_1 -DDMP_DEVICE2_DHCPV6SERVERCLIENTINFO_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_NEIGHBORDISCOVERY_1 -DDMP_DEVICE2_ROUTERADVERTISEMENT_1
ifneq ($(strip $(BUILD_MAP)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_MAPBASIC_1 -DDMP_DEVICE2_MAPADV_1
CMS_DMP_FLAGS += -DSUPPORT_MAP
endif
endif
endif
ifneq ($(strip $(BUILD_TR69C)),)
CMS_DMP_FLAGS += -DSUPPORT_TR69C
export BUILD_TR69C
endif
ifneq ($(strip $(BUILD_TR69C_SSL)),)
CMS_DMP_FLAGS += -DSUPPORT_TR69C
endif
ifneq ($(strip $(BUILD_TR69C_BCM_SSL)),)
CMS_DMP_FLAGS += -DSUPPORT_TR69C
endif
ifneq ($(strip $(BUILD_TR69_TR143)),)
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DOWNLOAD_1
CMS_DMP_FLAGS += -DDMP_UPLOAD_1
CMS_DMP_FLAGS += -DDMP_DOWNLOADTCP_1
CMS_DMP_FLAGS += -DDMP_UPLOADTCP_1
CMS_DMP_FLAGS += -DDMP_UDPECHO_1
CMS_DMP_FLAGS += -DDMP_UDPECHOPLUS_1
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_DOWNLOAD_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_UPLOAD_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_DOWNLOADTCP_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_UPLOADTCP_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_UDPECHO_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_UDPECHOPLUS_1
endif
endif
ifneq ($(strip $(BUILD_TR69_PERIODIC_STATISTICS)),)
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_PERIODICSTATSBASE_1
CMS_DMP_FLAGS += -DDMP_PERIODICSTATSADV_1
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_PERIODICSTATSBASE_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_PERIODICSTATSADV_1
endif
export BUILD_TR69_PERIODIC_STATISTICS
endif
ifneq ($(strip $(BUILD_TR69_VENDOR_RPC)),)
CMS_DMP_FLAGS += -DSUPPORT_TR69C_VENDOR_RPC
endif
ifneq ($(strip $(BUILD_STUN)),)
CMS_DMP_FLAGS += -DSUPPORT_STUN
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_UDPCONNREQ_1
endif
ifneq ($(strip $(BUILD_HYBRID181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_UDPCONNREQ_1
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_UDPCONNREQ_1
endif
endif
ifneq ($(strip $(BUILD_TR69_AUTONOMOUS_TRANSFER_COMPLETE_RPC)),)
CMS_DMP_FLAGS += -DSUPPORT_TR69C_AUTONOMOUS_TRANSFER_COMPLETE
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_AUTONXFERCOMPLPOLICY_1
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_AUTONXFERCOMPLPOLICY_1
endif
endif
ifneq ($(strip $(BUILD_TR69_AUTONOMOUS_DU_STATE_CHANGE_COMPLETE_RPC)),)
CMS_DMP_FLAGS += -DSUPPORT_TR69C_AUTONOMOUS_DU_STATE_CHANGE_COMPLETE
CMS_DMP_FLAGS += -DDMP_DEVICE2_DUSTATECHNGCOMPLPOLICY_1
endif
ifneq ($(strip $(BUILD_PROFILE_SUPPORTED_DATA_MODEL)),)
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DPROFILE_SUPPORTED_DATA_MODEL
CMS_DMP_FLAGS += -DDMP_DEVICE2_SUPPORTEDDATAMODEL_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_SUPPORTEDDATAMODEL_2
endif
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
ifneq ($(strip $(BUILD_BEEP_USPD)),)
CMS_DMP_FLAGS += -DSUPPORT_BEEP_USPD
endif
endif
ifneq ($(strip $(BUILD_XMPP)),)
CMS_DMP_FLAGS += -DSUPPORT_XMPP
CMS_DMP_FLAGS += -DDMP_DEVICE2_XMPPCONNREQ_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_XMPPBASIC_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_XMPPADVANCED_1
export BUILD_XMPP
endif
ifneq ($(strip $(BUILD_ALLJOYN)),)
CMS_DMP_FLAGS += -DSUPPORT_ALLJOYN
export BUILD_ALLJOYN
export BUILD_LIBCAP=y
export DO_BUILD_OPENSSL=y
endif
ifneq ($(strip $(BUILD_UPNP_IGD_HTTP_CONNREQ)),)
CMS_DMP_FLAGS += -DSUPPORT_UPNP_IGD_HTTP_CONNREQ
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_UPNPIGDHTTPCONNREQ_1
export BUILD_LIBMINIUPNPC=y
endif
ifneq ($(strip $(BUILD_BEEP_BBCD)),)
export BUILD_WEB_SOCKETS=y
export BUILD_CERT=dynamic
export DO_BUILD_OPENSSL=y
endif
ifneq ($(strip $(BUILD_WEB_SOCKETS_TEST)),)
export BUILD_WEB_SOCKETS=y
export BUILD_JQPLOT=y
export BUILD_CERT=dynamic
export BUILD_JQUERY=y
export BUILD_SIGMA=y
export DO_BUILD_OPENSSL=y
export DO_BUILD_EXPAT=y
endif
ifneq ($(strip $(BUILD_SPDSVC)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_SPDSVC_1
export BUILD_WEB_SOCKETS=y
export BUILD_JQPLOT=y
export BUILD_CERT=dynamic
export DO_BUILD_OPENSSL=y
export DO_BUILD_EXPAT=y
endif
ifneq ($(strip $(BUILD_DPI)),)
CMS_DMP_FLAGS += -DSUPPORT_DPI
export BUILD_WEB_SOCKETS=y
export BUILD_D3=y
export BUILD_CERT=dynamic
export DO_BUILD_OPENSSL=y
export DO_BUILD_EXPAT=y
endif
ifneq ($(strip $(BRCM_CPU_MEMORY_WEB_PAGE)),)
CMS_DMP_FLAGS += -DSUPPORT_CPU_MEMORY_WEB_PAGE
export BUILD_WEB_SOCKETS=y
export BUILD_JQPLOT=y
export BUILD_CERT=dynamic
export DO_BUILD_OPENSSL=y
export DO_BUILD_EXPAT=y
endif
ifneq ($(strip $(BUILD_JQPLOT)),)
CMS_DMP_FLAGS += -DSUPPORT_JQPLOT
endif
ifneq ($(strip $(BUILD_WEB_SOCKETS)),)
CMS_DMP_FLAGS += -DSUPPORT_WEB_SOCKETS
endif
ifneq ($(strip $(BUILD_EPON_SDK_VOICE_OAM)),)
CMS_DMP_FLAGS += -DDMP_X_CT_ORG_EPON_1 -DDMP_EPON_VOICE_OAM -DDMP_X_BROADCOM_COM_EPON_1
endif
ifneq ($(strip $(BUILD_GPON)),)
export BUILD_GPON
CMS_DMP_FLAGS += -DDMP_X_ITU_ORG_GPON_1 -DDMP_X_BROADCOM_COM_GPON_1
export BUILD_WAN_HTML=y
ifeq ($(strip $(BUILD_DM_LEGACY98)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_OPTICAL_1
endif
ifneq ($(filter y,$(BUILD_EPONWAN) $(BUILD_GPON)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_XPON_1
endif
ifneq ($(strip $(BRCM_VOICE_SUPPORT)),)
CMS_DMP_FLAGS += -DDMP_X_ITU_ORG_VOICE_1
ifneq ($(strip $(BUILD_DM_TR104_V2)),)
CMS_DMP_FLAGS += -DDMP_VOICE_SERVICE_2
else
CMS_DMP_FLAGS += -DDMP_VOICE_SERVICE_1
endif
endif
ifneq ($(strip $(BRCM_VOICE_APP_SIP)),)
CMS_DMP_FLAGS += -DDMP_X_ITU_ORG_VOICE_SIP_1
endif
endif
ifneq ($(strip $(BUILD_OMCI)),)
CMS_DMP_FLAGS += -DBRCM_OMCI
endif
ifneq ($(strip $(BUILD_DBUSREMOTE_TCP)),)
CMS_DMP_FLAGS += -DSUPPORT_DBUSREMOTE -DDMP_X_BROADCOM_COM_DBUSREMOTE_1
export BUILD_DBUSREMOTE_TCP
endif
ifneq ($(strip $(BUILD_HTTPD)),)
CMS_DMP_FLAGS += -DSUPPORT_HTTPD
endif
ifneq ($(strip $(BUILD_QUICKSETUP)),)
CMS_DMP_FLAGS += -DSUPPORT_QUICKSETUP -DDMP_X_BROADCOM_COM_QUICKSETUP_1
endif
ifneq ($(strip $(BUILD_HTTPD_SSL)),)
CMS_DMP_FLAGS += -DSUPPORT_HTTPD -DSUPPORT_HTTPD_SSL
else
ifneq ($(strip $(BUILD_HTTPD_BASIC_SSL)),)
CMS_DMP_FLAGS += -DSUPPORT_HTTPD -DSUPPORT_HTTPD_BASIC_SSL
endif
endif
ifneq ($(strip $(BUILD_CLI_MENU)),)
CMS_DMP_FLAGS += -DSUPPORT_CLI_MENU
endif
ifneq ($(strip $(BUILD_CLI_CMD)),)
CMS_DMP_FLAGS += -DSUPPORT_CLI_CMD -DCLI_CMD_EDIT
endif
ifneq ($(strip $(BUILD_CONSOLED)),)
CMS_DMP_FLAGS += -DSUPPORT_CONSOLED
endif
ifneq ($(strip $(BUILD_TELNETD)),)
CMS_DMP_FLAGS += -DSUPPORT_TELNETD
endif
ifneq ($(strip $(BUILD_SSHD)),)
CMS_DMP_FLAGS += -DSUPPORT_SSHD
endif
ifneq ($(strip $(BUILD_FTPD)),)
CMS_DMP_FLAGS += -DSUPPORT_FTPD
endif
ifneq ($(strip $(BUILD_EBTABLES)),)
CMS_DMP_FLAGS += -DSUPPORT_EBTABLES
endif
ifneq ($(strip $(BUILD_TOD)),)
CMS_DMP_FLAGS += -DSUPPORT_TOD -DDMP_X_BROADCOM_COM_ACCESSTIMERESTRICTION_1
endif
ifneq ($(strip $(BUILD_URLFILTER)),)
CMS_DMP_FLAGS += -DSUPPORT_URLFILTER
endif
ifneq ($(strip $(BUILD_IPROUTE2)),)
CMS_DMP_FLAGS += -DSUPPORT_POLICYROUTING
endif
ifneq ($(strip $(BUILD_UPNP)),)
CMS_DMP_FLAGS += -DSUPPORT_UPNP -DDMP_X_BROADCOM_COM_UPNP_1
endif
ifneq ($(strip $(BUILD_HASHED_PASSWORDS)),)
CMS_DMP_FLAGS += -DSUPPORT_HASHED_PASSWORDS
endif
ifneq ($(strip $(BUILD_DDNSD)),)
CMS_DMP_FLAGS += -DSUPPORT_DDNSD -DDMP_X_BROADCOM_COM_DYNAMICDNS_1
endif
ifneq ($(strip $(BUILD_DPROXY)),)
CMS_DMP_FLAGS += -DSUPPORT_DNSPROXY -DDMP_X_BROADCOM_COM_DNSPROXY_1
endif
ifneq ($(strip $(BUILD_DNSPROBE)),)
CMS_DMP_FLAGS += -DSUPPORT_DNSPROBE
endif
ifneq ($(strip $(BUILD_DPROXYWITHPROBE)),)
CMS_DMP_FLAGS += -DSUPPORT_DNSPROXYWITHPROBE -DDMP_X_BROADCOM_COM_DNSPROXY_1
endif
ifneq ($(strip $(BUILD_SUPERDMZ)),)
CMS_DMP_FLAGS += -DSUPPORT_ADVANCED_DMZ
endif
ifneq ($(strip $(BUILD_IPPD)),)
CMS_DMP_FLAGS += -DSUPPORT_IPP -DDMP_X_BROADCOM_COM_IPPRINTING_1
endif
ifneq ($(strip $(BUILD_DLNA)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_DLNA_1
export BUILD_DLNA
BUILD_LIBSQLITE=y
endif
ifneq ($(or $(strip $(BUILD_WLVISUALIZATION)),$(strip $(BUILD_WBD))),)
ifneq ($(strip $(BUILD_WLVISUALIZATION)),)
export BUILD_WLVISUALIZATION
endif
BUILD_LIBSQLITE=y
BUILD_LIBJSONC=y
BUILD_LIBXML2=y
endif
ifneq ($(strip $(BUILD_HOMEPLUG)),)
CMS_DMP_FLAGS += -DSUPPORT_HOMEPLUG -DDMP_DEVICE2_HOMEPLUG_1 -DDMP_DEVICE2_GATEWAYINFO_1
endif
ifneq ($(strip $(BRCM_HOMEPLUG_EXT_CHIP_60321)),)
CMS_DMP_FLAGS += -DHOMEPLUG_CHIP_60321
export BRCM_HOMEPLUG_EXT_CHIP_60321=y
endif
ifneq ($(strip $(BRCM_HOMEPLUG_EXT_CHIP_60345)),)
CMS_DMP_FLAGS += -DHOMEPLUG_CHIP_60345
export BRCM_HOMEPLUG_EXT_CHIP_60345=y
endif
ifneq ($(strip $(BUILD_HOMEPLUG_DEBUG)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_HOMEPLUG_DEBUG_1 -DSUPPORT_HOMEPLUG_DEBUG
endif
ifneq ($(strip $(BRCM_HOMEPLUG_NO_SNR_ASCII)),)
CMS_DMP_FLAGS += -DHOMEPLUG_NO_SNR_ASCII
endif
ifneq ($(strip $(BUILD_FBCTL)),)
CMS_DMP_FLAGS += -DSUPPORT_FBCTL
export BUILD_FBCTL
endif
ifneq ($(strip $(BUILD_BLOGCTL)),)
CMS_DMP_FLAGS += -DSUPPORT_BLOGCTL
export BUILD_BLOGCTL
endif
ifneq ($(strip $(BUILD_FCCTL)),)
CMS_DMP_FLAGS += -DSUPPORT_FCCTL
export BUILD_FCCTL
endif
ifneq ($(strip $(BUILD_DSLDIAGD)),)
CMS_DMP_FLAGS += -DSUPPORT_DSLDIAGD
endif
ifneq ($(strip $(BUILD_SNTP)),)
CMS_DMP_FLAGS += -DSUPPORT_SNTP
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_TIME_1
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_TIME_1
endif
export BUILD_SNTP
endif
ifneq ($(strip $(BUILD_BUSYBOX_NTPD)),)
CMS_DMP_FLAGS += -DSUPPORT_NTPD
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_TIME_1
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_TIME_1
endif
export BUILD_BUSYBOX_NTPD
endif
ifneq ($(strip $(BUILD_UDHCP)),)
CMS_DMP_FLAGS += -DSUPPORT_UDHCP
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_DHCPV4_1 -DDMP_DEVICE2_DHCPV4CLIENT_1 -DDMP_DEVICE2_DHCPV4SERVER_1
endif
ifneq ($(strip $(BRCM_DHCP_SERVER_DEFAULT)),)
CMS_DMP_FLAGS += -DDHCP_SERVER_DEFAULT
endif
ifneq ($(strip $(BRCM_DHCP_CLIENT_DEFAULT)),)
CMS_DMP_FLAGS += -DDHCP_CLIENT_DEFAULT
endif
endif
ifneq ($(strip $(BUILD_UDHCP_RELAY)),)
# SUPPORT_DHCP_RELAY is for generic dhcp relay code (data model independent)
CMS_DMP_FLAGS += -DSUPPORT_DHCP_RELAY
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
# this is the original TR98 Broadcom proprietary DHCP relay code
CMS_DMP_FLAGS += -DDHCP_RELAY
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_DHCPV4RELAY_1
endif
endif
ifneq ($(strip $(BUILD_TMS)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_ETHERNETOAM_1
endif
ifneq ($(strip $(BUILD_SPUCTL)),)
CMS_DMP_FLAGS += -DSUPPORT_SPUCTL
ifneq ($(strip $(BRCM_DRIVER_SPU_TEST)),)
CMS_DMP_FLAGS += -DSUPPORT_SPU_TEST
endif
endif
ifneq ($(strip $(BUILD_ETHSWCTL)),)
CMS_DMP_FLAGS += -DSUPPORT_ETHSWCTL
export BUILD_ETHSWCTL
endif
ifneq ($(strip $(BUILD_PWRCTL)),)
CMS_DMP_FLAGS += -DSUPPORT_PWRMNGT -DDMP_X_BROADCOM_COM_PWRMNGT_1
endif
ifneq ($(strip $(BRCM_HOSTMIPS_PWRSAVE)),)
CMS_DMP_FLAGS += -DSUPPORT_HOSTMIPS_PWRSAVE
CMN_COMPILE_FLAGS += -DSUPPORT_HOSTMIPS_PWRSAVE
endif
ifneq ($(strip $(BRCM_CPU_FREQ_PWRSAVE)),)
CMS_DMP_FLAGS += -DSUPPORT_HOSTMIPS_PWRSAVE
CMN_COMPILE_FLAGS += -DSUPPORT_HOSTMIPS_PWRSAVE
endif
ifneq ($(strip $(BRCM_CPUIDLE_CLK_DIVIDER)),)
CMS_DMP_FLAGS += -DSUPPORT_HOSTMIPS_PWRSAVE
CMN_COMPILE_FLAGS += -DSUPPORT_HOSTMIPS_PWRSAVE
endif
ifneq ($(strip $(BRCM_DDR_SELF_REFRESH_PWRSAVE)),)
CMS_DMP_FLAGS += -DSUPPORT_DDR_SELF_REFRESH_PWRSAVE
CMN_COMPILE_FLAGS += -DSUPPORT_DDR_SELF_REFRESH_PWRSAVE
endif
ifneq ($(strip $(BRCM_DDR_AUTO_SELF_REFRESH)),)
CMS_DMP_FLAGS += -DSUPPORT_DDR_AUTO_SELF_REFRESH
CMN_COMPILE_FLAGS += -DSUPPORT_DDR_AUTO_SELF_REFRESH
endif
ifneq ($(strip $(BRCM_ETH_PWRSAVE)),)
CMS_DMP_FLAGS += -DSUPPORT_ETH_PWRSAVE
CMN_COMPILE_FLAGS += -DSUPPORT_ETH_PWRSAVE
endif
ifneq ($(strip $(BRCM_ENERGY_EFFICIENT_ETHERNET)),)
CMS_DMP_FLAGS += -DSUPPORT_ENERGY_EFFICIENT_ETHERNET
CMN_COMPILE_FLAGS += -DSUPPORT_ENERGY_EFFICIENT_ETHERNET
endif
ifneq ($(strip $(BRCM_ETH_DEEP_GREEN_MODE)),)
CMS_DMP_FLAGS += -DSUPPORT_ETH_DEEP_GREEN_MODE
CMN_COMPILE_FLAGS += -DSUPPORT_ETH_DEEP_GREEN_MODE
endif
ifneq ($(strip $(WLCSM_DEBUG_TRACE)),)
CMN_COMPILE_FLAGS += -DWLCSM_DEBUG
endif
ifneq ($(strip $(BRCM_AVS_PWRSAVE)),)
CMS_DMP_FLAGS += -DSUPPORT_AVS_PWRSAVE
CMN_COMPILE_FLAGS += -DSUPPORT_AVS_PWRSAVE
else
ifeq ($(strip $(BRCM_CHIP)),6318)
ifneq ($(strip $(BRCM_IKOS)),y)
$(error ERROR: AVS Must be enabled on 6318)
endif
endif
endif
ifneq ($(strip $(BUILD_IPERF)),)
export BUILD_LIB_STLPORT=y
endif
ifneq ($(strip $(BUILD_BRCM_OMCI)),)
CMS_DMP_FLAGS += -DSUPPORT_BRCM_OMCI
endif
ifneq ($(strip $(BUILD_BMU)),)
CMS_DMP_FLAGS += -DSUPPORT_BMU -DDMP_X_BROADCOM_COM_BMU_1
export BUILD_LIB_STLPORT=y
export BUILD_BMU BUILD_BMU_0CELL BUILD_BMU_2CELL BUILD_BMU_3CELL
endif
ifneq ($(strip $(BRCM_STANDBY)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_STANDBY_1
endif
ifneq ($(strip $(BUILD_CMFD)),)
CMS_DMP_FLAGS += -DSUPPORT_CMFD
endif
ifneq ($(strip $(BUILD_GPONCTL)),)
CMS_DMP_FLAGS += -DSUPPORT_GPONCTL
endif
ifneq ($(strip $(BUILD_RNGD)),)
CMS_DMP_FLAGS += -DSUPPORT_HWRANDOM
endif
ifneq ($(strip $(BUILD_EPON_SDK)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_EPON_1
endif
# TR140 Storage Service
ifneq ($(strip $(BUILD_STORAGESERVICE)),)
CMS_DMP_FLAGS += -DSUPPORT_STORAGESERVICE -DDMP_STORAGESERVICE_1
endif
ifneq ($(strip $(BUILD_NTFS_3G)),)
CMS_DMP_FLAGS += -DSUPPORT_NTFS_3G
endif
ifneq ($(strip $(BUILD_SAMBA)),)
CMS_DMP_FLAGS += -DSUPPORT_SAMBA
endif
# end Storage Service
#
# Multicast related defines
#
ifneq ($(strip $(BUILD_MCAST_SNOOP)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_MCAST_1
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_IGMPSNOOP_1
ifneq ($(strip $(BUILD_IPV6)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_MLDSNOOP_1
endif
ifeq ($(BCM_PON),y)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_DCSP_MCAST_REMARK_1
endif
CMS_CORE_LIBS += -lbcmmcast
endif
ifneq ($(strip $(BUILD_MCAST_PROXY)),)
CMS_DMP_FLAGS += -DSUPPORT_IGMP -DDMP_X_BROADCOM_COM_IGMP_1
ifneq ($(strip $(BUILD_IPV6)),)
CMS_DMP_FLAGS += -DSUPPORT_MLD -DDMP_X_BROADCOM_COM_MLD_1
endif
endif
# end Multicast
ifneq ($(strip $(BUILD_AUTODETECTION)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_AUTODETECTION_1
endif
ifneq ($(strip $(BUILD_OPENVSWITCH)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_OPENVSWITCH_1
endif
#
# =============== Begin Modular Software Section ===========
#
# was BUILD_OSGI_JVM
# Now all the various pieces are individually controlled for maximum flexibility
#
ifneq ($(strip $(BUILD_JVM_JAMVM)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_JAMVM_1
CMS_DMP_FLAGS += -DJAMVM_MIN_HEAP=$(JAMVM_MIN_HEAP_SIZE)
CMS_DMP_FLAGS += -DJAMVM_MAX_HEAP=$(JAMVM_MAX_HEAP_SIZE)
CMS_DMP_FLAGS += -DJAMVM_STACK=$(JAMVM_STACK_SIZE_PER_THREAD)
endif
ifneq ($(strip $(BUILD_OSGI_FELIX)),)
CMS_DMP_FLAGS += -DSUPPORT_OSGI_FELIX
endif
ifneq ($(strip $(BUILD_MODSW_EE)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_SM_BASELINE_1
endif
ifneq ($(strip $(BUILD_MODSW_OSGIEE)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_X_BROADCOM_COM_MODSW_OSGIEE_1
export BUILD_MODSW_OSGIEE
endif
ifneq ($(strip $(BUILD_MODSW_OPENWRTEE)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_X_BROADCOM_COM_MODSW_OPENWRTEE_1
export BUILD_MODSW_OPENWRTEE
endif
ifneq ($(strip $(BUILD_MODSW_DOCKEREE)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_X_BROADCOM_COM_MODSW_DOCKEREE_1
export BUILD_MODSW_DOCKEREE
endif
ifneq ($(strip $(BUILD_MODSW_LINUXPFP)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_X_BROADCOM_COM_MODSW_LINUXPFP_1
endif
ifneq ($(strip $(BUILD_MODSW_LINUXPFP)),)
BUILD_LINMOSD := 1
endif
ifneq ($(strip $(BUILD_LINMOSD)),)
CMS_DMP_FLAGS += -DSUPPORT_LINMOSD
endif
ifneq ($(strip $(BUILD_TR69C_BEEP)),)
CMS_DMP_FLAGS += -DSUPPORT_BEEP_TR69C -DSUPPORT_TR69C
endif
# osgid and linmosd needs libmodsw, so if either of these two things
# are defined, then build libmodsw.
ifneq ($(strip $(BUILD_OSGI_FELIX)),)
BUILD_LIBMODSW := 1
endif
ifneq ($(strip $(BUILD_LINMOSD)),)
BUILD_LIBMODSW := 1
endif
ifneq ($(strip $(BUILD_MODSW_EE)),)
BUILD_BEEP := y
export BUILD_BEEP
endif
ifneq ($(strip $(BUILD_MODSW_BEE)),)
BUILD_BEE := y
BUILD_LIBMODSW := 1
CMS_DMP_FLAGS += -DSUPPORT_BEEP
BUILD_LIBJSONC=y
BUILD_LIBSQLITE=y
BUILD_LIBCURL=y
BUILD_LIBCURL_WITH_SSL=y
BUILD_LIBCURL_WITH_HTTP2=y
DO_BUILD_OPENSSL=y
endif
ifneq ($(strip $(BUILD_BEEP)),)
BUILD_LIBCURL=y
BUILD_LIBCURL_WITH_SSL=y
BUILD_LIBCURL_WITH_HTTP2=y
DO_BUILD_OPENSSL=y
BUILD_DBUS=y
endif
ifneq ($(strip $(BUILD_AVS_DEVICE_SDK)),)
BUILD_ZLIB=y
BUILD_FFI=y
BUILD_GETTEXT=y
BUILD_GLIB=y
BUILD_LIBJSONC=y
BUILD_LIBSQLITE=y
BUILD_LIBCURL=y
BUILD_LIBCURL_WITH_SSL=y
BUILD_LIBCURL_WITH_HTTP2=y
DO_BUILD_OPENSSL=y
endif
ifneq ($(strip $(BUILD_LIBMODSW)),)
# Specially for the busybox configuration.
export BUILD_LIBMODSW
CMS_DMP_FLAGS += -DSUPPORT_LIBMODSW
endif
ifneq ($(strip $(BUILD_MODSW_CLI)),)
CMS_DMP_FLAGS += -DSUPPORT_MODSW_CLI
endif
ifneq ($(strip $(BUILD_MODSW_WEBUI)),)
CMS_DMP_FLAGS += -DSUPPORT_MODSW_WEBUI
endif
ifneq ($(strip $(BUILD_MODSW_WEBUI_ADMIN)),)
CMS_DMP_FLAGS += -DSUPPORT_MODSW_WEBUI_ADMIN
endif
ifneq ($(strip $(BUILD_PCP)),)
CMS_DMP_FLAGS += -DSUPPORT_PCP
endif
ifneq ($(strip $(BUILD_MODSW_WEBUI_SUPPORT)),)
CMS_DMP_FLAGS += -DSUPPORT_MODSW_WEBUI_SUPPORT
endif
#
# =============== End Modular Software Section ===========
#
#
# netfilter modules
#
ifneq ($(strip $(BRCM_KERNEL_NF_NAT_ALG_IPSEC)),)
CMS_DMP_FLAGS += -DSUPPORT_IPSEC_PASSTHROUGH
endif
ifneq ($(strip $(BRCM_KERNEL_NF_NAT_ALG_PPTP)),)
CMS_DMP_FLAGS += -DSUPPORT_PPTP
endif
ifneq ($(strip $(BRCM_KERNEL_NF_NAT_ALG_SIP)),)
CMS_DMP_FLAGS += -DSUPPORT_SIP
endif
ifneq ($(strip $(BRCM_KERNEL_NF_LAYER7_FILTER)),)
CMS_DMP_FLAGS += -DSUPPORT_L7_FILTER
endif
ifneq ($(strip $(BRCM_KERNEL_NF_MANGLE)),)
CMS_DMP_FLAGS += -DSUPPORT_NF_MANGLE
endif
ifneq ($(strip $(BUILD_CONNTRACK_TOOLS)),)
CMS_DMP_FLAGS += -DSUPPORT_CONNTRACK_TOOLS
endif
#
# netfilter modules end
#
# In the beginning, there was a config param called VCONFIG, which enabled
# a Broadcom feature called "port mapping". Starting in 4.x, we renamed this
# feature "Interface Grouping". But TR98 calls it "Layer 2 Bridging".
# And in TR181, interface grouping is just part of the standard bridge
# functionality, there is no specific define that controls interface grouping.
#
# Bottom line: SUPPORT_PORT_MAP is the data model independent way to indicate
# support for interface grouping. For Legacy98 and Hybrid, it is defined
# when VCONFIG is enabled. For Pure181, SUPPORT_PORT_MAP is always defined.
#
ifneq ($(strip $(BUILD_VCONFIG)),)
CMS_DMP_FLAGS += -DSUPPORT_INTF_GROUPING
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DSUPPORT_PORT_MAP -DDMP_BRIDGING_1
endif
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DSUPPORT_PORT_MAP
endif
ifneq ($(strip $(BUILD_WANVLANMUX)),)
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DSUPPORT_WANVLANMUX
endif
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
# Pure TR181 mode: always enable VLANMUX, so no defines needed?
CMS_DMP_FLAGS += -DSUPPORT_WANVLANMUX -DDMP_DEVICE2_VLANTERMINATION_1
endif
ifneq ($(strip $(BUILD_VLANCTL)),)
CMS_DMP_FLAGS += -DSUPPORT_VLANCTL
endif
ifneq ($(strip $(BUILD_LANVLAN)),)
# Unfortunately, we don't have a TR98 specific LANVLAN define,
# so SUPPORT_LANVLAN means both generic LANVLAN and TR98 LANVLAN support.
# Wastes a little code space on PURE181 builds.
CMS_DMP_FLAGS += -DSUPPORT_LANVLAN
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_VLANTERMINATION_1
endif
endif
#ifneq ($(strip $(BUILD_BCM_ALLOW_REAL_HW_SWITCHING)),)
#CMS_DMP_FLAGS += -DSUPPORT_CMS_ALLOW_REAL_HW_SWITCHING
#endif
# Temporarily blocking this configuration from menuconfig until Ethernet Driver is ready for this.
ifneq ($(BUILD_RDPA),y)
CMS_DMP_FLAGS += -DSUPPORT_CMS_ALLOW_REAL_HW_SWITCHING
endif
ifneq ($(findstring _$(strip $(BRCM_CHIP))_,_63138_63148_4908_63158_),)
CMS_DMP_FLAGS += -DSUPPORT_CMS_ALLOW_REAL_HW_SWITCHING
endif
ifneq ($(strip $(BRCM_DRIVER_USB)),)
CMS_DMP_FLAGS += -DSUPPORT_USB
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_USBLAN_1
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_USBINTERFACE_1
ifneq ($(strip $(LINUX_DRIVER_USB_HOST)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_USBHOSTSBASIC_1 -DDMP_DEVICE2_USBHOSTSADV_1
endif
endif
endif
# EthLag only enabled when Kernel ethernet bonding and PURE181 both are selected
ifneq ($(strip $(BRCM_KERNEL_BONDING)),)
ifneq ($(strip $(BUILD_DM_PURE181)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_ETHLAG_1
endif
endif
# ==== Begin QoS, rate shaping, policing config section ====
# Currently, all builds support QoS, but maybe in the future we could
# disable QoS for some very simple devices?
CMS_DMP_FLAGS += -DSUPPORT_QOS
# Enable various Data Model related QoS defines based on what profiles
# we are compiling
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_QOS_1 -DDMP_QOSDYNAMICFLOW_1
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_QOS_1
ifeq ($(BCM_PON),y)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_TM_1
endif
ifneq ($(findstring _$(strip $(BRCM_CHIP))_,_63158_),)
ifeq ($(BUILD_RDPA),y)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_TM_1
endif
endif
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_QOS_1 -DDMP_DEVICE2_QOS_2
CMS_DMP_FLAGS += -DDMP_DEVICE2_QOSSTATS_1
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_DEVICE2_QOS_1
ifeq ($(BCM_PON),y)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_TM_1
endif
ifneq ($(findstring _$(strip $(BRCM_CHIP))_,_63158_),)
ifeq ($(BUILD_RDPA),y)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_TM_1
endif
endif
endif
ifneq ($(strip $(BRCM_TC_RATE_LIMIT)),)
CMS_DMP_FLAGS += -DSUPPORT_RATE_LIMIT
endif
ifneq ($(strip $(BRCM_TC_POLICING)),)
CMS_DMP_FLAGS += -DSUPPORT_POLICING
endif
# ==== End QoS, rate shaping, policing config section ====
ifneq ($(strip $(BRCM_KERNEL_FTRACE)),)
CMS_DMP_FLAGS += -DSUPPORT_FTRACE
endif
ifneq ($(strip $(BUILD_VLAN_AGGR)),)
CMS_DMP_FLAGS += -DCONFIG_BCM_VLAN_AGGREGATION -DCONFIG_BCM_KF_VLAN_AGGREGATION
endif
#
# These variables come from the debug section of make menuconfig
#
ifeq ($(strip $(CMS_LOG_DEBUG)),)
CMS_LOG_FLAGS := -DCMS_LOG0
else
ifneq ($(strip $(CMS_LOG_LEVEL_1)),)
CMS_LOG_FLAGS := -DCMS_LOG2
endif
ifneq ($(strip $(CMS_LOG_LEVEL_2)),)
CMS_LOG_FLAGS := -DCMS_LOG3
endif
ifneq ($(strip $(CMS_STARTUP_DEBUG)),)
CMS_DMP_FLAGS += -DCMS_STARTUP_DEBUG
endif
endif
ifneq ($(strip $(CMS_SECURITY_LOG)),)
CMS_DMP_FLAGS += -DCMS_SECURITY_LOG
endif
ifneq ($(strip $(CMS_ACTION_LOG)),)
CMS_DMP_FLAGS += -DCMS_ACTION_LOG
endif
ifneq ($(strip $(CMS_MEM_BOUNDARY_CHECK)),)
CMS_DMP_FLAGS += -DCMS_MEM_BOUNDARY_CHECK
endif
ifneq ($(strip $(CMS_MEM_POISON_ALLOC_FREE)),)
CMS_DMP_FLAGS += -DCMS_MEM_POISON_ALLOC_FREE
endif
ifneq ($(strip $(CMS_MEM_LEAK_TRACING)),)
CMS_DMP_FLAGS += -DCMS_MEM_LEAK_TRACING
endif
ifneq ($(strip $(CMS_FATAL_ASSERT)),)
CMS_DMP_FLAGS += -DCMS_FATAL_ASSERT
endif
ifneq ($(strip $(BUILD_DEBUG_TOOLS)),)
CMS_DMP_FLAGS += -DSUPPORT_DEBUG_TOOLS
endif
ifneq ($(strip $(CMS_BYPASS_LOGIN)),)
CMS_DMP_FLAGS += -DCMS_BYPASS_LOGIN
endif
ifneq ($(strip $(BRCM_GMAC)),)
CMS_DMP_FLAGS += -DCMS_BRCM_GMAC
endif
#
# This needs a little cleanup also. Instead of explicitly checking for BUILD_CERT,
# this check should be if (BUILD_HTTPD_SSL or BUILD_TR69_SSL or any other feature
# that requires SSL).
#
ifneq ($(strip $(BUILD_CERT)),)
CMS_DMP_FLAGS += -DSUPPORT_CERT -DDMP_X_BROADCOM_COM_DIGITALCERTIFICATES_1
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_CERTIFICATES_1
endif
endif
ifneq ($(strip $(BUILD_ZEBRA)),)
CMS_DMP_FLAGS += -DSUPPORT_RIP
export BUILD_ZEBRA
endif
ifneq ($(strip $(COMPRESSED_CONFIG_FILE)),)
CMS_DMP_FLAGS += -DCOMPRESSED_CONFIG_FILE
endif
ifneq ($(strip $(BUILD_BACKUP_PSI)),)
CMS_DMP_FLAGS += -DSUPPORT_BACKUP_PSI
endif
ifneq ($(strip $(BUILD_BACKUP_PSI_MIRROR_MODE)),)
CMS_DMP_FLAGS += -DSUPPORT_BACKUP_PSI_MIRROR_MODE
endif
ifneq ($(strip $(BUILD_BACKUP_PSI_DEVICE_DEFAULT)),)
CMS_DMP_FLAGS += -DSUPPORT_BACKUP_PSI_DEVICE_DEFAULT
endif
ifneq ($(strip $(CMS_CONFIG_COMPAT)),)
CMS_DMP_FLAGS += -DCMS_CONFIG_COMPAT
endif
ifneq ($(strip $(CMS_CONFIG_IGNORE_UNRECOGNIZED)),)
CMS_DMP_FLAGS += -DCMS_CONFIG_IGNORE_UNRECOGNIZED
endif
# ==== Wifi (WLAN) config section ====
# If Wireless driver is selected from menuconfig, that means we want to enable
# the Wifi feature
ifneq ($(strip $(BRCM_DRIVER_WIRELESS)), )
CMS_CORE_LIBS += -lwlcsm
#CMS_CORE_LIBS += -lpthread
ifeq ($(strip $(ARCH_ENDIAN)),big)
CMN_WLAN_FLAGS += -DIL_BIGENDIAN
endif
CMN_WLAN_FLAGS += -DBRCM_WLAN -DWIRELESS -I$(BUILD_DIR)/userspace/private/libs/wlcsm/include
CMN_WLAN_FLAGS += -DDSLCPE
export WIRELESS=1
ifneq ($(strip $(BUILD_UNIFIED_WLMNGR)),)
CMN_WLAN_FLAGS += -DWLAN_UNIFIED_WLMNGR
endif
ifneq ($(strip $(BUILD_BRCM_CPEROUTER)),)
CMN_WLAN_FLAGS += -DBCA_CPEROUTER
else
CMN_WLAN_FLAGS += -DDSLCPE_ENDIAN
endif
ifneq ($(strip $(BUILD_BRCM_HNDROUTER)),)
CMN_WLAN_FLAGS += -DBCA_HNDROUTER
endif
ifeq ($(BRCM_WAPI),y)
CMN_WLAN_FLAGS += -DBCMWAPI_WPI -DBCMWAPI_WAI
endif
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
# These flags enable TR98 based Wifi objects
CMS_DMP_FLAGS += -DDMP_WIFILAN_1 -DDMP_X_BROADCOM_COM_WIFILAN_1
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
# In Pure TR181 mode, we use the standard TR181 wifi objects
CMS_DMP_FLAGS += -DDMP_DEVICE2_WIFIRADIO_1 -DDMP_DEVICE2_WIFISSID_1
# Do we have a define for AP mode? Always assume it is enabled?
CMS_DMP_FLAGS += -DDMP_DEVICE2_WIFIACCESSPOINT_1
endif
ifneq ($(strip $(BUILD_BRCM_CMS)),)
BUILD_TR181_WLMNGR = $(or $(strip $(BUILD_DM_PURE181)), $(strip $(BUILD_DM_DETECT)),$(strip $(BUILD_UNIFIED_WLMNGR)))
else
ifneq ($(strip $(BUILD_BRCM_HNDROUTER_ALONE)),)
else
BUILD_TR181_WLMNGR = y
endif
endif
ifneq ($(strip $(BRCM_DRIVER_DHD)),)
export BUILD_DHD_MONITOR=y
endif
# this means user wants to have a wifi WAN interface
ifneq ($(strip $(BUILD_WIFIWAN)),)
export BUILD_WAN_HTML=y
CMS_DMP_FLAGS += -DSUPPORT_WIFIWAN
ifneq ($(strip $(BUILD_TR98_PROFILES)),)
# this flag enables TR98 specific Wifi WAN objects and code
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_WIFIWAN_1
endif
ifneq ($(strip $(BUILD_PURE181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_DEV2_WIFIWAN_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_WIFIENDPOINT_1
endif
endif
export BRCM_DRIVER_DHD
ifneq ($(strip $(BUILD_BCM_WLAN_REMOVE_INTERNAL_DEBUG)),)
# seen for driver/userapp
export NO_BCMINTERNAL = 1
export NO_BCMDBG = 1
endif
endif
# ==== End Wifi (WLAN) config section
ifneq ($(strip $(BCM_CGROUPS)),)
CMS_DMP_FLAGS += -DSUPPORT_CGROUPS
endif
ifneq ($(strip $(BCM_CGROUP_BCM)),)
CMS_DMP_FLAGS += -DSUPPORT_CGROUP_BCM
endif
ifeq ($(BUILD_QRCODE),y)
export BUILD_QRCODE
CMS_DMP_FLAGS += -DSUPPORT_QRCODE
endif
ifeq ($(BUILD_IEEE1905),y)
export BUILD_IEEE1905
CMS_DMP_FLAGS += -DSUPPORT_IEEE1905
CMS_CORE_LIBS += -li5api
# include 1905 DM in hybrid and pure181
ifneq ($(strip $(BUILD_HYBRID181_PROFILES)),)
CMS_DMP_FLAGS += -DDMP_DEVICE2_IEEE1905BASELINE_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_IEEE1905LINKMETRIC_1
CMS_DMP_FLAGS += -DDMP_DEVICE2_IEEE1905NETWORKTOPOLOGY_1
endif
ifneq ($(strip $(BUILD_IEEE1905_GOLDENNODE)),)
CMS_DMP_FLAGS += -DSUPPORT_IEEE1905_GOLDENNODE
endif
ifneq ($(strip $(BUILD_IEEE1905_REGISTRAR)),)
CMS_DMP_FLAGS += -DSUPPORT_IEEE1905_REGISTRAR
endif
ifneq ($(strip $(BRCM_1905_TOPOLOGY_WEB_PAGE)),)
CMS_DMP_FLAGS += -DSUPPORT_1905_TOPOLOGY_WEB_PAGE
export BUILD_WEB_SOCKETS=y
export BUILD_JQPLOT=y
export BUILD_CERT=dynamic
export DO_BUILD_OPENSSL=y
export DO_BUILD_EXPAT=y
export BUILD_JQUERY=y
export BUILD_SIGMA=y
endif
ifeq ($(BRCM_1905_FM),y)
CMS_DMP_FLAGS += -DSUPPORT_IEEE1905_FM
ifeq ($(BRCM_1905_AUTO_WDS),y)
ifneq ($(strip $(BRCM_DRIVER_WIRELESS)),)
CMS_DMP_FLAGS += -DSUPPORT_IEEE1905_AUTO_WDS
endif
endif
endif
endif
ifneq ($(strip $(BRCM_KERNEL_AUXFS_JFFS2)),)
BUILD_MTDUTILS=y
endif
ifneq ($(strip $(BUILD_CRYPTODEV_LINUX)),)
export BUILD_CRYPTODEV_LINUX
endif
ifeq ($(strip $(BRCM_DRIVER_WATCHDOG_TIMER)), y)
CMS_DMP_FLAGS += -DBRCM_WATCHDOG_TIMER
endif
ifneq ($(strip $(BUILD_NFC_LIB)),)
export BUILD_NFC_LIB
endif
ifneq ($(strip $(BUILD_NFC_APP)),)
ifeq ($(strip $(BUILD_NFC_APP)),nfcd)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_NFC_1
endif
export BUILD_NFC_APP
endif
ifneq ($(strip $(BUILD_LXC)),)
CMS_DMP_FLAGS += -DDMP_X_BROADCOM_COM_CONTAINER_1
endif
ifneq ($(strip $(BUILD_OPENVPN)),)
DO_BUILD_OPENSSL=y
DO_BUILD_EXPAT=y
endif
ifeq ($(DO_BUILD_OPENSSL),y)
ifeq ($(strip $(KERNEL_ARCH)),aarch64)
BUILD_OPENSSL_NEON=y
endif
endif
CMN_COMPILE_FLAGS += $(DBGFLAGS) $(PROFILERFLAGS) -D$(TARGET_OS) \
-DCHIP_$(BRCM_CHIP) -DCONFIG_BCM9$(BRCM_CHIP)
CFLAGS = $(CMN_COMPILE_FLAGS) $(CMN_COMPILER_OPTS) $(CUSTOM_CFLAGS) $(ALLOWED_INCLUDE_PATHS)
CFLAGS += -I$(TOOLCHAIN)/include -L$(TOOLCHAIN)/lib
CFLAGS += $(BRCM_WERROR_CFLAGS)
CFLAGS2 = $(CMN_COMPILE_FLAGS) $(CMN_COMPILER_OPTS2) $(CUSTOM_CFLAGS) $(ALLOWED_INCLUDE_PATHS)
CFLAGS2 += -I$(TOOLCHAIN)/include -L$(TOOLCHAIN)/lib
CFLAGS2 += $(BRCM_WERROR_CFLAGS)
ifeq ($(strip $(KERNEL_ARCH)),aarch64)
CFLAGS += -DKERNEL_64
else ifeq ($(strip $(DESKTOP_LINUX)),y)
CFLAGS += -DKERNEL_32
endif
$(BUILD_DIR)/cms_dmp_flags.h : $(PROFILE_DIR)/$(PROFILE) $(BUILD_DIR)/make.common $(LAST_PROFILE_COOKIE)
echo $(CMS_DMP_FLAGS) | perl -e 'local $$/ ; $$a=<>; $$a=" $$a "; while ($$a=~s/(\s+)-D(\S+)=(\S+)(\s+)/$$1\n#define $$2 $$3\n$$4/) {}; while ($$a=~s/(\s+)-D(\S+)(\s+)/$$1\n#define $$2 1\n$$3/) {}; print "\n$$a\n";' > $(BUILD_DIR)/cms_dmp_flags.h
echo >> $(BUILD_DIR)/cms_dmp_flags.h
echo '// '$(CMS_DMP_FLAGS) >> $(BUILD_DIR)/cms_dmp_flags.h
echo >> $(BUILD_DIR)/cms_dmp_flags.h
CMS_COMPILE_FLAGS := $(CMS_LOG_FLAGS) #-include $(BUILD_DIR)/cms_dmp_flags.h
ifeq ($(strip $(BCM_ANALYSIS_COMPILE)),)
CMS_COMPILE_FLAGS += -DMDM_SHARED_MEM
endif
CMS_COMPILE_FLAGS += -DCMS_MEM_DEBUG
ifneq ($(strip $(BUILD_BRCM_CMS)),)
CMS_COMPILE_FLAGS += -DBRCM_CMS_BUILD
ifneq ($(strip $(CMS_FATAL_ASSERT)),)
CMS_COMPILE_FLAGS += -DCMS_FATAL_ASSERT
endif
endif
ifneq ($(strip $(BUILD_BRCM_HNDROUTER)),)
export BCA_HNDROUTER=y
endif
ifneq ($(strip $(BUILD_HND_EAP)),)
export BCA_HND_EAP=y
endif
###### Need to export kernel config to userspace as well
ifeq ($(BRCM_PORTS_ON_INT_EXT_SW),y)
CMN_COMPILE_FLAGS += -DBRCM_PORTS_ON_INT_EXT_SW
endif
ifeq ($(BCM_GPON_AE_AUTO_SWITCH),y)
CMS_COMPILE_FLAGS += -DCONFIG_BCM_GPON_AE_AUTO_SWITCH
endif
ifeq ($(BRCM_GPON_TODD),y)
CMS_COMPILE_FLAGS += -DCONFIG_BCM_GPON_TODD
endif
ifeq ($(BRCM_PTP_1588),y)
CMS_COMPILE_FLAGS += -DCONFIG_BCM_PTP_1588
endif
ifeq ($(BCM_PON),y)
CFLAGS += -DBCM_PON
endif
ifeq ($(BCM_PON_XRDP),y)
CFLAGS += -DBCM_PON_XRDP
endif
ifeq ($(BCM_PON_RDP),y)
CFLAGS += -DBCM_PON_RDP
endif
ifeq ($(BCM_DSL_XRDP),y)
CFLAGS += -DBCM_DSL_XRDP
endif
ifeq ($(BCM_DSL_RDP),y)
CFLAGS += -DBCM_DSL_RDP
endif
ifeq ($(BCM_XRDP),y)
CFLAGS += -DBCM_XRDP
endif
ifeq ($(BCM_RDP),y)
CFLAGS += -DBCM_RDP
endif
ifneq ($(strip $(BRCM_BPM_BUF_TRACKING)),)
export BUILD_BPM_TRACK=y
endif
ifneq ($(strip $(BRCM_DRIVER_GPON)_$(BUILD_GPON)),_)
CFLAGS += -DCONFIG_BCM_MAX_GEM_PORTS=$(BCM_MAX_GEM_PORTS)
export WAN_AUTODETECT=y
else
# This is just to hide the error in rut_gponrg_light.c; this file should not compile for non-gpon
CFLAGS += -DCONFIG_BCM_MAX_GEM_PORTS=1
endif
ifneq ($(strip $(BRCM_EPON_STACK)),)
export WAN_AUTODETECT=y
export BCM_PON=y
endif
ifneq ($(strip $(BRCM_MIPS_RATE_LIMIT)),)
CMS_COMPILE_FLAGS += -DCONFIG_MIPS_RATE_LIMIT=$(BRCM_MIPS_RATE_LIMIT)
endif
ifneq ($(strip $(EPON_ONU_TYPE)),)
CFLAGS += -D$(EPON_ONU_TYPE)
endif
ifneq ($(strip $(GPON_ONU_TYPE)),)
CMS_COMPILE_FLAGS += -D$(GPON_ONU_TYPE)
endif
ifneq ($(strip $(BCM_JUMBO_FRAME)),)
export BCM_JUMBO_FRAME
endif
ifneq ($(strip $(BUILD_EPON_SDK)),)
CMS_COMPILE_FLAGS += -DEPON_SDK_BUILD
endif
ifneq ($(strip $(BUILD_EPON_BCM_OAM)),)
CMS_COMPILE_FLAGS += -DBCM_OAM_BUILD
endif
ifneq ($(strip $(BUILD_EPON_CTC_OAM)),)
CMS_COMPILE_FLAGS += -DCTC_OAM_BUILD
endif
ifneq ($(strip $(BUILD_EPON_DPOE_OAM)),)
CMS_COMPILE_FLAGS += -DDPOE_OAM_BUILD
CMS_COMPILE_FLAGS += -DDPOE_OAM_IMPL1_BUILD
#CMS_COMPILE_FLAGS += -DDPOE_OAM_STUB_BUILD
endif
ifneq ($(strip $(BRCM_PKTCBL_SUPPORT)),)
CMS_COMPILE_FLAGS += -DBRCM_PKTCBL_SUPPORT
export BRCM_PKTCBL_SUPPORT
endif
ifneq ($(strip $(OVERRIDE_EPON_MAC_ADDR)),)
CMS_COMPILE_FLAGS += -DOVERRIDE_EPON_MAC_ADDR
endif
ifneq ($(strip $(EPON_UNI_UNI_ENABLED)),)
CMS_COMPILE_FLAGS += -DEPON_UNI_UNI_ENABLED
endif
ifneq ($(strip $(MLLID_SUPPORTED)),)
CMS_COMPILE_FLAGS += -DMLLID_SUPPORTED
endif
ifneq ($(findstring _$(strip $(BRCM_CHIP))_,_6838_6848_6858_63381_63138_63148_63158_6856_6846_4908_),)
CMS_COMPILE_FLAGS += -DSUPPORT_SECURE_BOOT
endif
ifeq ($(EPON_CLOCK_TRANSPORT),y)
CMS_COMPILE_FLAGS += -DCLOCK_TRANSPORT
CMS_COMPILE_FLAGS += -DCONFIG_EPON_CLOCK_TRANSPORT
endif
ifeq ($(EPON_10G_SUPPORT),y)
CMS_COMPILE_FLAGS += -DCONFIG_EPON_10G_SUPPORT
endif
# Stack Smashing Protection.
ifeq ($(strip $(BRCM_USER_SSP)),y)
SSP_MIN_COMPILER_OPTS := -fstack-protector-all
SSP_TYP_COMPILER_OPTS :=
SSP_MAX_COMPILER_OPTS :=
SSP_MIN_LIBS := $(SSP_LIBS)
SSP_TYP_LIBS :=
SSP_MAX_LIBS :=
ifneq ($(strip $(BRCM_SSP_LEVEL_TYP)),)
SSP_TYP_COMPILER_OPTS := -fstack-protector-all
SSP_MAX_COMPILER_OPTS :=
SSP_TYP_LIBS := $(SSP_LIBS)
SSP_MAX_LIBS :=
endif
ifneq ($(strip $(BRCM_SSP_LEVEL_MAX)),)
SSP_TYP_COMPILER_OPTS := -fstack-protector-all
SSP_MAX_COMPILER_OPTS := -fstack-protector-all
SSP_TYP_LIBS := $(SSP_LIBS)
SSP_MAX_LIBS := $(SSP_LIBS)
endif
export BRCM_USER_SSP
export SSP_MIN_COMPILER_OPTS
export SSP_TYP_COMPILER_OPTS
export SSP_MAX_COMPILER_OPTS
export SSP_LIBS
export SSP_MIN_LIBS
export SSP_TYP_LIBS
export SSP_MAX_LIBS
endif
export CMS_COMPILE_FLAGS
# this means user wants to have tmctl
ifneq ($(strip $(BUILD_DRIVER_TM)),)
BUILD_TMCTL := y
endif
ifneq ($(strip $(BUILD_FAPCTL)),)
BUILD_TMCTL := y
endif
ifneq ($(strip $(BUILD_BCMTM)),)
BUILD_TMCTL := y
endif
ifneq ($(strip $(BUILD_RDPACTL)),)
BUILD_TMCTL := y
endif
ifneq ($(strip $(BRCM_VOICE_SUPPORT)),)
CFLAGS += $(VOICE_CFLAGS)
endif
ifneq ($(strip $(BUILD_GPONRG_OMCI_FULL)),)
export BUILD_GPONRG_OMCI_FULL
endif
# nocms also needs wlan flags
ifneq ($(strip $(BUILD_BRCM_BASE_SHELL)),)
CFLAGS += $(CMN_WLAN_FLAGS)
endif
# special target to force extra libraries to build when desired
ifneq ($(strip $(BUILD_NEWLIBS)),)
BUILD_ZLIB=y
BUILD_FFI=y
endif
ifneq ($(strip $(BUILD_BRCM_CMS)),)
CFLAGS += $(CMS_COMPILE_FLAGS) $(CMN_WLAN_FLAGS)
ifneq ($(strip $(BUILD_TR69C))$(strip $(BUILD_TR69C_SSL))$(strip $(BUILD_TR69C_BCM_SSL)),)
BUILD_TR69C_APP=1
endif
ifneq ($(strip $(BUILD_HTTPD))$(strip $(BUILD_HTTPD_SSL))$(strip $(BUILD_HTTPD_BASIC_SSL)),)
BUILD_ANY_CMS_HTTPD=1
endif
ifneq ($(strip $(BUILD_CONSOLED)),)
BUILD_ANY_CMS_CONSOLED=1
endif
ifneq ($(strip $(BUILD_TELNETD)),)
BUILD_ANY_CMS_TELNETD=1
endif
ifneq ($(strip $(BUILD_TR64)),)
BUILD_ANY_CMS_TR64=1
endif
ifneq ($(strip $(BRCM_DRIVER_WIRELESS)), )
ifneq ($(strip $(BUILD_TR181_WLMNGR)),)
CFLAGS += -DSUPPORT_TR181_WLMNGR
endif
endif
ifneq ($(strip $(BUILD_IPV6)),)
BUILD_ANY_CMS_IPV6=1
endif
ifneq ($(strip $(BUILD_UPNP)),)
BUILD_ANY_CMS_UPNP=$(BUILD_IPTABLES)
endif
endif
ifneq ($(IMAGE_VERSION_STRING),)
IMAGE_VERSION:=$(IMAGE_VERSION_STRING)
else
IMAGE_VERSION:=$(BRCM_VERSION)$(BRCM_RELEASE)$(shell echo $(BRCM_EXTRAVERSION) | sed -e "s/\(0\)\([1-9]\)/\2/")$(shell echo $(PROFILE) | sed -e "s/^[0-9]*//")$(shell date '+%j%H%M')
endif
###########################################
#
# Generic/common rules which are used by lower layer Makefiles
#
###########################################
# Every target should have a dependency on this target to make sure
# the user has specified a profile.
profile_defined_check:
$(info $@: PROFILE=$(PROFILE))
@if [ "$(PROFILE)" = "" ]; then \
echo "You need to specify build profile name from $(TARGETS_DIR) using 'make PROFILE=<profile name>...'"; exit 1; \
fi
# See LAST_PROFILE at the top of this file.
profile_changed_check: profile_defined_check
@if [ "$(HOST_PERLARCH)" = "" ]; then \
perl -MConfig -e 'print $$Config{archname};' > $(HOST_PERLARCH_COOKIE); \
fi
ifneq ($(strip $(IGNORE_LAST_PROFILE)),1)
@if [ "$(LAST_PROFILE)" = "" ]; then \
echo "$(PROFILE)" > $(LAST_PROFILE_COOKIE); \
else \
if [ "$(LAST_PROFILE)" != "$(PROFILE)" ]; then \
echo "The specified profile, $(PROFILE), differs from the last one built, $(LAST_PROFILE)."; \
echo "You must do a make clean before rebuilding."; \
echo "(To skip this check, build with IGNORE_LAST_PROFILE=1)"; \
echo; \
exit 1; \
fi \
fi
else
@echo "$(PROFILE)" > $(LAST_PROFILE_COOKIE);
endif
profile_saved_check:
$(info $@: FORCE=$(FORCE))
@if [ -e $(LAST_PROFILE_COOKIE) -a $(PROFILE_DIR)/$(PROFILE) -nt $(LAST_PROFILE_COOKIE) ]; then \
if [ -z $(FORCE) ]; then\
echo "The specified profile, $(PROFILE), has been modified since the last build."; \
echo "You must run make clean before rebuilding."; \
echo "(To skip this check, build with FORCE=1)"; \
echo; \
else \
touch $(LAST_PROFILE_COOKIE); \
fi; \
exit 1; \
fi
REQUIRED_MAKE_VERSION := 3.81
REQUIRED_HOST_KERNEL_VERSION := 2.6
REQUIRED_AUTOMAKE_VERSION := 1.10.2
ifeq ($(ARCH),arm)
REQUIRED_AUTOCONF_VERSION := 2.65
else
REQUIRED_AUTOCONF_VERSION := 2.59
endif
REQUIRED_LIBTOOLIZE_VERSION := 1.4.0
REQUIRED_BCMTOOL_VERSION := Rel1.8
HOST_KERNEL_VERSION := $(shell uname -r)
BCMTOOL_VERSION := `echo "BCM_TOOLCHAIN_VERSION" | gcc -E -P -o- -include $${TOOLCHAIN_TOP}/usr/include/bcm_toolver.h -xc - | sed 's/^"\(.*\)"$$/\1/'`
prebuild_checks:
@echo "shell is $(SHELL). Bash version is $(shell echo $$BASH_VERSION)"
@if [ -z "$(shell echo $$BASH_VERSION)" ]; then \
echo "***************************************************"; \
echo "ERROR: $(SHELL) does not invoke bash shell"; \
echo "***************************************************"; \
exit 1; \
fi
@if [ $(shell whoami) == root ]; then \
echo "***************************************************"; \
echo "ERROR: Attempting to build as root."; \
echo "***************************************************"; \
exit 1; \
fi
@if [ ! -d $(TOOLCHAIN_TOP) ]; then \
echo "****************************************************"; \
echo "ERROR: could not find Toolchain"; \
echo "$(TOOLCHAIN_TOP)"; \
echo "****************************************************"; \
exit 1; \
fi
@if [ ! -d $(KERNEL_DIR) ]; then \
echo "****************************************************"; \
echo "ERROR: Could not find kernel directory: "; \
echo "$(KERNEL_DIR) "; \
echo "****************************************************"; \
exit 1; \
fi
@if [[ $(BUILD_DIR) == *" "* ]]; then \
echo "****************************************************"; \
echo "ERROR: BUILD_DIR may not contain spaces "; \
echo "$(BUILD_DIR) "; \
echo "****************************************************"; \
exit 1; \
fi
@if ! xxd -v 2>/dev/null; then \
echo "ERROR: xxd is required for build "; \
exit 1; \
fi
@if ! gawk --version 2>/dev/null; then \
echo "ERROR: gawk is required for build quagga "; \
exit 1; \
fi
ifeq ($(strip $(BUILD_SECURE_BOOT)),y)
@if ! openssl version 2>/dev/null; then \
echo "ERROR: openssl is required for secure boot builds "; \
exit 1; \
else \
sslver=`openssl version | cut -d " " -f2 | sed 's/[^0-9]*//g'`; \
if [[ sslver -lt 100 ]]; then \
echo "ERROR: openssl version must be 1.0.0a or greater for secure boot builds "; \
exit 1; \
fi; \
fi
endif
@echo "make.common: checking for required host tools before building:"
@echo "Checking bcm tools version"
@$(HOSTTOOLS_DIR)/scripts/checkver.pl -s $(BCMTOOL_VERSION) -r $(REQUIRED_BCMTOOL_VERSION) --quiet; \
if [ $$? != 0 ]; then \
echo "****************************************************"; \
echo "* WARNING: "; \
echo "* A newer version of the bcm toolchain is available."; \
echo "* It is recommended you upgrade to $(REQUIRED_BCMTOOL_VERSION)."; \
echo "****************************************************"; \
fi; \
echo "$(BCMTOOL_VERSION)";
@echo "Checking make version"
@$(HOSTTOOLS_DIR)/scripts/checkver.pl -s $(MAKE_VERSION) -r $(REQUIRED_MAKE_VERSION) || $(COND_FAIL);
@echo "Checking host kernel version"
@$(HOSTTOOLS_DIR)/scripts/checkver.pl -s $(HOST_KERNEL_VERSION) -r $(REQUIRED_HOST_KERNEL_VERSION) || $(COND_FAIL);
@echo "Checking automake version:"
@$(HOSTTOOLS_DIR)/scripts/checkver.pl -e automake -r $(REQUIRED_AUTOMAKE_VERSION) || $(COND_FAIL);
@if [ "`which automake`" -ef "$TOOLCHAIN_TOP/usr/bin/automake" ]; then \
echo "----------------------------------------------------------------"; \
echo "| ERROR: automake is being run from the cross-compile directory."; \
echo "| Please install a local copy on your build machine."; \
echo "----------------------------------------------------------------"; \
if [ -z "$(FORCE)" ]; then exit 1; fi \
fi
@echo "Checking autoconf version:"
@$(HOSTTOOLS_DIR)/scripts/checkver.pl -e autoconf -r $(REQUIRED_AUTOCONF_VERSION) || $(COND_FAIL);
@if [ "`which autoconf`" -ef "$TOOLCHAIN_TOP/usr/bin/autoconf" ]; then \
echo "----------------------------------------------------------------"; \
echo "| ERROR: autoconf is being run from the cross-compile directory."; \
echo "| Please install a local copy on your build machine."; \
echo "----------------------------------------------------------------"; \
if [ -z "$(FORCE)" ]; then exit 1; fi \
fi
@echo "Checking libtoolize version:"
@$(HOSTTOOLS_DIR)/scripts/checkver.pl -e libtoolize -r $(REQUIRED_LIBTOOLIZE_VERSION) || $(COND_FAIL);
@if [ "`which libtoolize`" -ef "$TOOLCHAIN_TOP/usr/bin/libtoolize" ]; then \
echo "----------------------------------------------------------------"; \
echo "| ERROR: libtoolize is being run from the cross-compile directory."; \
echo "| Please install a local copy on your build machine."; \
echo "----------------------------------------------------------------"; \
if [ -z "$(FORCE)" ]; then exit 1; fi \
fi
@echo "Checking tar version:"
@tarVer=`$(HOSTTOOLS_DIR)/scripts/checkver.pl -e tar`; \
echo "$$tarVer"; \
if [ $$tarVer == "1.23" ]; then \
echo "----------------------------------------------------------------"; \
echo "| There is a known bug in tar 1.23 which causes build failures."; \
echo "| 1.22 and 1.24 are known to be OK. Please upgrade your tar to "; \
echo "| another version"; \
echo "----------------------------------------------------------------"; \
if [ -z "$(FORCE)" ]; then exit 1; fi \
fi
@if ! echo "#include <lzo/lzo1x.h>" | gcc -E - >/dev/null; then \
echo "ERROR: lzo/lzo1x.h development library is required for build"; \
echo " usually, this is provided by the liblzo2-dev library"; \
if [ -z "$(FORCE)" ]; then exit 1; fi \
fi
@if ! echo "#include <uuid/uuid.h>" | gcc -E - >/dev/null; then \
echo "ERROR: libuuid development library is required for build"; \
if [ -z "$(FORCE)" ]; then exit 1; fi \
fi
@if ! pkg-config --exists --print-errors zlib ; then \
echo "ERROR: pkg-config zlib failed"; \
echo "Your distribution may require you to use a special setting of PKG_CONFIG_PATH"; \
if [ -z "$(FORCE)" ]; then exit 1; fi \
fi
@if ! pkg-config --exists --print-errors uuid ; then \
echo "ERROR: pkg-config uuid failed"; \
echo "Your distribution may require you to use a special setting of PKG_CONFIG_PATH"; \
if [ -z "$(FORCE)" ]; then exit 1; fi \
fi
@if ! perl -MCPAN -MExtUtils::MakeMaker -e exit 2>/dev/null ; then \
echo "ERROR: you are missing a basic functioning perl installation"; \
echo " please be sure that you have perl installed including"; \
echo " the CPAN and ExtUtils::MakeMaker components"; \
echo " These components are standard built-in components in the perl core"; \
echo " but some distributions package them seperately anyway."; \
if [ -z "$(FORCE)" ]; then exit 1; fi \
fi
@echo "Checking patch version:";
@$(HOSTTOOLS_DIR)/scripts/checkver.pl -e patch || $(COND_FAIL);
@if [[ -n "$(BUILD_EMMC_IMG)" ]]; then \
echo "Checking sgdisk version:"; \
$(HOSTTOOLS_DIR)/scripts/checkver.pl -e sgdisk || $(COND_FAIL); \
fi
sanity_check: profile_changed_check
.PHONY: prebuild_checks sanity_check
$(LAST_PROFILE_COOKIE): sanity_check
# This next rule has a surprising but beneficial side effect.
# I am transitioning to a single Makefile that supports full source
# and binary only releases. But in a binary only release, there are no
# .o's and no .c's. But the Makefile defines OBJS = file1.c file2.c etc,
# and the OBJS are always prereq's to the EXE. Normally, this would cause
# make to fail because of no rule to make the .o's. However, this next rule
# fools make into thinking that the .o's depend on the
# LAST_PROFILE_COOKIE and sanity_check, so it goes off evaluating them
# and thinks it has satisified the prereqs for the .o's. In reality, it
# hasn't, but that's OK, because this is a binary only release and the
# pre-built binary should be used anyways.
# In a full source release, detection of changed .c's still work correctly
# due to the dependency files (.d's) that are generated.
$(OBJS) : $(LAST_PROFILE_COOKIE)
generic_oaldir:
$(MAKE) -C $(OALDIR)
oal.a: $(OBJS)
$(AR) -rcs $@ $(OBJS)
generic_exe_install: $(EXE)
mkdir -p $(INSTALL_DIR)/bin$(BCM_INSTALL_SUFFIX_DIR)
install -m 755 $(EXE) $(INSTALL_DIR)/bin$(BCM_INSTALL_SUFFIX_DIR)
generic_public_lib_install: $(LIB)
mkdir -p $(INSTALL_DIR)/lib$(BCM_INSTALL_SUFFIX_DIR)
install -m 755 $(LIB) $(INSTALL_DIR)/lib$(BCM_INSTALL_SUFFIX_DIR)
mkdir -p $(BCM_FSBUILD_DIR)/public/lib$(BCM_INSTALL_SUFFIX_DIR)
install -m 755 $(LIB) $(BCM_FSBUILD_DIR)/public/lib$(BCM_INSTALL_SUFFIX_DIR)
generic_private_lib_install: $(LIB)
mkdir -p $(INSTALL_DIR)/lib$(BCM_INSTALL_SUFFIX_DIR)
install -m 755 $(LIB) $(INSTALL_DIR)/lib$(BCM_INSTALL_SUFFIX_DIR)
mkdir -p $(BCM_FSBUILD_DIR)/private/lib
install -m 755 $(LIB) $(BCM_FSBUILD_DIR)/private/lib
ifneq ($(strip $(EID_FILE)),)
generic_eid_file_install:
@echo "running generic_eid_file_install for $(EID_FILE)"
@mkdir -p $(INSTALL_DIR)/rom/rom/etc/cms_entity_info.d
@if [ -e scripts/$(EID_FILE).custom ]; then \
echo installing $(EID_FILE).custom to $(INSTALL_DIR)/rom/rom/etc/cms_entity_info.d/$(EID_FILE); \
install -m 644 scripts/$(EID_FILE).custom $(INSTALL_DIR)/rom/rom/etc/cms_entity_info.d/$(EID_FILE); \
else \
echo installing $(EID_FILE) to $(INSTALL_DIR)/rom/rom/etc/cms_entity_info.d/; \
install -m 644 scripts/$(EID_FILE) $(INSTALL_DIR)/rom/rom/etc/cms_entity_info.d; \
fi
generic_eid_file_clean:
rm -f $(INSTALL_DIR)/rom/rom/etc/cms_entity_info.d/$(EID_FILE)
.PHONY: generic_eid_file_clean generic_eid_file_install
endif
generic_clean:
rm -f *.o *.d *.d.* core.* *.a output.txt $(EXE) $(LIB)
rm -rf output
generic_oalclean:
$(MAKE) -C $(OALDIR) clean
generic_binaryonly_dist_clean:
rm -rf *.c *.h linux
# See example in GNU Make, 4.6
generic_subdir_clean:
for dir in $(SUBDIRS); do \
if [ -d $$dir ] ; then \
if [ -f $$dir/Makefile ] ; then \
$(MAKE) -C $$dir clean; \
fi \
fi \
done
# this rule makes the individual makefiles cleaner, but at the cost
# of single threading the makes to one directory at a time.
generic_subdir_make_default:
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir; \
done
#
# Some debug targets, to dump out various variables
#
show_build_vars:
@echo "BUILD_DIR=$(BUILD_DIR)"
@echo "KERNEL_VER=$(PROFILE_KERNEL_VER)"
@echo "TARGETS_DIR=$(TARGETS_DIR)"
@echo "PROFILE=$(PROFILE)"
JAVA := java
ifeq ($(shell hash md5sum && echo y),y)
MD5 := md5sum
else
MD5 := perl $(HOSTTOOLS_DIR)/perlmd5/perlmd5.pl
endif
YUICOMPRESSOR_SCRIPT := $(HOSTTOOLS_DIR)/yuicompressor/yuicompressor-2.4.8.jar
# V-----------------------------------V
define CREATE_WEB_TRG
# 1: target name
# 2: source directory (relative to current dir)
# 3: target directory (relative to $(INSTALL_DIR)/webs)
# 4: staging directory (relative to current dir)
# 5: tar file
# 6: local file list (optional) - only copy over
# The CREATE_WEB_TRG creates several makefile targets within the calling makefile. The
# main target is named after param1. Invoking this target will cause all web files
# directory to be minimized and copyied to the target directory. The web file list
# defaults to being all files under the source directroy (param2), unless a file list
# is specified (param6). If a filelist is specified, then only files matching that
# list are copied. Notice that wildcards are allowed in the filelist, but full
# pathnames are not (all files must be relative to the source directory (param2)).
# param4 - the staging directory, specifies a directory which is used to temporarily
# house the minimized files, and md5 sums before copying.
# once the files have been minimized, each minimized file, and the md5 sum of its source
# is added to the minimized file tarball (param5). This prevents the minimizer from
# having to run on each make clean (minimization may take a significant amount of time).
# Files are only re-minimized if a) java is installed on the build system, and b) the
# source md5 does not match the md5 stored against the file within the tar file/ staging
# directory
# This also automatically creates a WEB_CLEAN target, and makes clean depend on this.
# This means if someone does a clean, the staging directory is wiped out, along with
# any files produced.
_SRC_DIR_$(strip $(1)) := $(abspath $(strip $(2)))
_TRG_DIR_$(strip $(1)) := $(shell [[ _$(strip $(3)) == _/* ]] && echo "$(strip $(3))" || echo "$$(INSTALL_DIR)/webs/$(strip $(3))")
_STG_DIR_$(strip $(1)) := $(abspath $(strip $(4)))
_TAR_FILE_$(strip $(1)) := $(abspath $(strip $(5)))
_SRCS_$(strip $(1)) := $$(shell cd $$(_SRC_DIR_$(strip $(1))); [ -z "$(6)" ] && find $(abspath $(strip $(2))) -type f || find $(6:%=$(abspath $(strip $(2)))/%) -type f )
_STGS_$(strip $(1)) := $$(patsubst $$(_SRC_DIR_$(strip $(1)))/%,$$(_STG_DIR_$(strip $(1)))/%,$$(_SRCS_$(strip $(1))))
_TRGS_$(strip $(1)) := $$(patsubst $$(_SRC_DIR_$(strip $(1)))/%,$$(_TRG_DIR_$(strip $(1)))/%,$$(_SRCS_$(strip $(1))))
_UNTAR_MARK_$(strip $(1)) := $$(_STG_DIR_$(strip $(1)))/.untarred_$(strip $(1)) #file which signifies that untar is done
.SECONDARY: $$(_STGS_$(strip $(1)))
#$$(info "V---------------------------------V")
#$$(info "_SRC_DIR_$(strip $(1)) = $$(_SRC_DIR_$(strip $(1)))")
#$$(info "_TRG_DIR_$(strip $(1)) = $$(_TRG_DIR_$(strip $(1))) ($(strip $(3)))")
#$$(info "_TAR_FILE_$(strip $(1)) = $$(_TAR_FILE_$(strip $(1)))")
#$$(info "_SRCS_$(strip $(1)) = $$(_SRCS_$(strip $(1)))")
#$$(info "_TRGS_$(strip $(1)) = $$(_TRGS_$(strip $(1)))")
#$$(info "^---------------------------------^")
$(strip $(1)): $$(_TRGS_$(strip $(1)))
@echo "DONE $$@"
$$(_TRG_DIR_$(strip $(1)))/%: $$(_STG_DIR_$(strip $(1)))/%
@echo "Installing $$(@F) ..."
@mkdir -p $$(@D);
@install -D -m 444 $$< $$(@D)
# do not minify js files that are already minified.
$$(_STG_DIR_$(strip $(1)))/%.min.js: $$(_SRC_DIR_$(strip $(1)))/%.min.js
@echo "Staging $$(@F)";
@mkdir -p $$(@D);
@install -D -m 664 $$< $$(@D)
#Note: the following is run regardless of date stamps.
$$(_STG_DIR_$(strip $(1)))/%.js: $$(_SRC_DIR_$(strip $(1)))/%.js ALWAYS_RUN_$(strip $(1))
@echo "Building $$@";
@if [ -e $$(@) ] && [ -e $$(@).md5 ] && [ $$$$($(MD5) $$(<) | cut -c -32) == $$$$(cat $$(@).md5) ]; then \
echo "Nothing to be done for $$(@F)"; \
else \
echo "Minify $$(@F)..."; \
mkdir -p $$(@D); \
if [ $(NO_MINIFY) ]; then \
hash $(JAVA) 2>&- && $(JAVA) -jar $(YUICOMPRESSOR_SCRIPT) $$(<) > $$(@); \
[ $$$$? != 0 ] && (echo "MINIFICATION FAILURE DETECTED: $$(@F)" >&2) && exit 1; \
echo "Not minifying $$(@F)"; \
mkdir -p $$(@D); \
install -D -m 664 $$< $$(@D); \
else \
hash $(JAVA) 2>&- && $(JAVA) -jar $(YUICOMPRESSOR_SCRIPT) $$(<) > $$(@); \
if [ $$$$? == 0 ]; then \
$(MD5) $$(<) | cut -c -32 > $$(@).md5; \
if [ -n $$(_TAR_FILE_$(strip $(1))) ]; then \
if [ ! -e $$(_TAR_FILE_$(strip $(1))) ] || [ -w $$(_TAR_FILE_$(strip $(1))) ]; then \
cd $$(_STG_DIR_$(strip $(1))); \
while true; do mkdir $$(_STG_DIR_$(strip $(1)))/_mutex_dir 2> /dev/null && break; echo "WAITING FOR LOCK: $$@"; sleep 0.1; done; \
tar --delete -f $$(_TAR_FILE_$(strip $(1))) $$(@:$$(_STG_DIR_$(strip $(1)))/%=%) $$(@:$$(_STG_DIR_$(strip $(1)))/%=%).md5; \
tar -upvf $$(_TAR_FILE_$(strip $(1))) $$(@:$$(_STG_DIR_$(strip $(1)))/%=%) $$(@:$$(_STG_DIR_$(strip $(1)))/%=%).md5; \
rmdir $$(_STG_DIR_$(strip $(1)))/_mutex_dir 2> /dev/null; \
else \
echo "WARNING: COULD NOT UPDATE TAR FILE WITH MINIMIZED FILE - $$(_TAR_FILE_$(strip $(1)))" >&2; \
echo " Please ensure this file is checked out for edit" >&2; \
fi; \
fi; \
else \
echo "MINIFY FAILED $$(@F)..." >&2; \
cp -f $$< $$@; \
chmod +w $$@; \
fi; \
fi; \
fi
# do not minify css files that are already minified.
$$(_STG_DIR_$(strip $(1)))/%.min.css: $$(_SRC_DIR_$(strip $(1)))/%.min.css
@echo "Staging $$(@F)";
@mkdir -p $$(@D);
@install -m 664 $$< $$(@D);
#Note: the following is run regardless of date stamps.
$$(_STG_DIR_$(strip $(1)))/%.css: $$(_SRC_DIR_$(strip $(1)))/%.css ALWAYS_RUN_$(strip $(1))
@echo "Building $$@";
@if [ -e $$(@) ] && [ -e $$(@).md5 ] && [ $$$$(md5sum $$(<) | cut -c -32) == $$$$(cat $$(@).md5) ]; then \
echo "Nothing to be done for $$(@F)"; \
else \
echo "Minify $$(@F)..."; \
mkdir -p $$(@D); \
if [ $(NO_MINIFY) ]; then \
hash $(JAVA) 2>&- && $(JAVA) -jar $(YUICOMPRESSOR_SCRIPT) $$(<) > $$(@); \
[ $$$$? != 0 ] && (echo "MINIFICATION FAILURE DETECTED: $$(@F)" >&2) && exit 1; \
echo "Not minifying $$(@F)"; \
mkdir -p $$(@D); \
install -D -m 664 $$< $$(@D); \
else \
hash $(JAVA) 2>&- && $(JAVA) -jar $(YUICOMPRESSOR_SCRIPT) $$(<) > $$(@); \
if [ $$$$? == 0 ]; then \
$(MD5) $$(<) | cut -c -32 > $$(@).md5; \
if [ -n $$(_TAR_FILE_$(strip $(1))) ]; then \
if [ ! -e $$(_TAR_FILE_$(strip $(1))) ] || [ -w $$(_TAR_FILE_$(strip $(1))) ]; then \
cd $$(_STG_DIR_$(strip $(1))); \
while true; do mkdir $$(_STG_DIR_$(strip $(1)))/_mutex_dir 2> /dev/null && break; echo "WAITING FOR LOCK: $$@"; sleep 0.1; done; \
tar --delete -f $$(_TAR_FILE_$(strip $(1))) $$(@:$$(_STG_DIR_$(strip $(1)))/%=%) $$(@:$$(_STG_DIR_$(strip $(1)))/%=%).md5; \
tar -upvf $$(_TAR_FILE_$(strip $(1))) $$(@:$$(_STG_DIR_$(strip $(1)))/%=%) $$(@:$$(_STG_DIR_$(strip $(1)))/%=%).md5; \
rmdir $$(_STG_DIR_$(strip $(1)))/_mutex_dir 2> /dev/null; \
else \
echo "WARNING: COULD NOT UPDATE TAR FILE WITH MINIMIZED FILE - $$(_TAR_FILE_$(strip $(1)))" >&2; \
echo " Please ensure this file is checked out for edit" >&2; \
fi; \
fi; \
else \
echo "MINIFY FAILED $$(@F)..."; >&2 \
mkdir -p $$(@D); \
install -D -m 664 $$< $$(@D); \
fi; \
fi; \
fi
ALWAYS_RUN_$(strip $(1)):
@echo "Building $(strip $(1))"
@rmdir $$(_STG_DIR_$(strip $(1)))/_mutex_dir 2> /dev/null || true
.PHONY: ALWAYS_RUN_$(strip $(1)) WEB_CLEAN_$(strip $(1)) $(strip $(1))
$$(_STG_DIR_$(strip $(1)))/%: $$(_SRC_DIR_$(strip $(1)))/%
@echo "Staging $$(@F) ..."
@mkdir -p $$(@D);
@install -D -m 664 $$< $$(@D)
# for performance, we only want to do a single untar.
$$(_UNTAR_MARK_$(strip $(1))):
@echo "running $$@"
@mkdir -p $$(_STG_DIR_$(strip $(1)))
@[ -f $$(_TAR_FILE_$(strip $(1))) ] && tar -xf $$(_TAR_FILE_$(strip $(1))) -C $$(_STG_DIR_$(strip $(1))) || true
touch $$@
$$(_STGS_$(strip $(1))): | $$(_UNTAR_MARK_$(strip $(1)))
clean: WEB_CLEAN_$(strip $(1))
WEB_CLEAN_$(strip $(1)):
@echo "running $$@"
-rm -f $$(_TRGS_$(strip $(1)))
-rm -rf $$(_STG_DIR_$(strip $(1)))
-rm -f $$(_UNTAR_MARK_$(strip $(1)))
endef
# ^-----------------------------------^