# Common make definitions, customized for each platform | |
# Definitions required in all program directories to compile and link | |
# C programs using gcc. | |
ROOT = $(BUILD_ROOT)/.. | |
OUT_DIR = $(ROOT)/out | |
LOCAL_PATH=. | |
HOME_DIR := $(shell echo ~) | |
#BUILD_TOOLCHAIN_DIR = $(ROOT)/toolchain/gcc-$(BUILD_GCC_VERSION)-$(BUILD_STD_LIBC) | |
BUILD_TOOLCHAIN_DIR = $(HOME_DIR)/openwrt_toolchains/gcc-$(BUILD_GCC_VERSION)-$(BUILD_STD_LIBC) | |
ifeq ($(BUILD_STD_LIBC), glibc) | |
CC=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-gnueabi-gcc | |
AR=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-gnueabi-ar | |
else | |
CC=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-muslgnueabi-gcc | |
AR=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-muslgnueabi-ar | |
endif | |
MAKE=make | |
$(info BUILD_LIB_TYPE=$(BUILD_LIB_TYPE)) | |
$(info BUILD_PLATFORM=$(BUILD_PLATFORM)) | |
$(info BUILD_BRANCH=$(BUILD_BRANCH)) | |
$(info BUILD_PROJECT=$(BUILD_PROJECT)) | |
$(info ROOT=$(ROOT)) | |
$(info CC=$(CC)) | |
$(info AR=$(AR)) | |
# -Werror=non-virtual-dtor | |
#CFLAGS= --sysroot=$(BUILD_TOOLCHAIN_DIR) -Os -pipe -rdynamic -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -mfloat-abi=hard -fno-exceptions -Wno-multichar -ffunction-sections -fdata-sections -funwind-tables -Wa,--noexecstack -fno-short-enums -no-canonical-prefixes -fno-canonical-system-headers -mfpu=neon -fno-builtin-sin -fno-strict-volatile-bitfields -Wno-psabi -mthumb-interwork -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -g -Wstrict-aliasing=2 -fgcse-after-reload -frerun-cse-after-loop -frename-registers -mthumb -fomit-frame-pointer -fno-strict-aliasing -Werror=format-security -Werror=return-type -Werror=address -Werror=sequence-point -ffunction-sections -Wl,--gc-sections -Wl,--no-undefined -Wno-sign-compare -Wno-pointer-arith | |
CFLAGS = --sysroot=$(BUILD_TOOLCHAIN_DIR) -Os -pipe -rdynamic -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -Wall -Werror -g -Wno-error=format | |
CFLAGS_TEST = --sysroot=$(BUILD_TOOLCHAIN_DIR) -Os -pipe -rdynamic -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -mfloat-abi=hard -fno-exceptions -Wno-multichar -ffunction-sections -fdata-sections -funwind-tables -Wa,--noexecstack -fno-short-enums -no-canonical-prefixes -fno-canonical-system-headers -mfpu=neon -fno-builtin-sin -fno-strict-volatile-bitfields -Wno-psabi -mthumb-interwork -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -g -Wstrict-aliasing=2 -fgcse-after-reload -frerun-cse-after-loop -frename-registers -mthumb -fomit-frame-pointer -fno-strict-aliasing -Werror=format-security -Werror=return-type -Werror=address -Werror=sequence-point -ffunction-sections -Wl,--gc-sections -Wl,--no-undefined -Wno-sign-compare -Wno-pointer-arith | |
AWK=awk | |
#CFLAGS += -Wno-error=format-truncation -Wno-error=format-overflow= -Wno-error=stringop-overread -Wno-error=deprecated-declarations | |
INC_DIR = \ | |
-I$(LOCAL_PATH)/ \ | |
-I$(LOCAL_PATH)/inc \ | |
-I$(BUILD_ROOT)/include \ | |
-I$(BUILD_ROOT)/include/mbtk \ | |
-I$(BUILD_ROOT)/include/lynq \ | |
-I$(BUILD_ROOT)/include/mqtt \ | |
-I$(BUILD_ROOT)/include/ql | |
# -DCONFIG_AB_SYSTEM | |
# -DMBTK_DUMP_SUPPORT | |
DEFINE = \ | |
-DMBTK_SUPPORT \ | |
-DMARVELL_EXTENDED \ | |
-DPXA1826_AUDIO \ | |
-D__USE_GNU \ | |
-DNOT_DROPPED_FLAGS_TEST \ | |
-DNDEBUG \ | |
-UDEBUG \ | |
-D_FORTIFY_SOURCE=2 \ | |
-D_GNU_SOURCE \ | |
-DMBTK_BUILD_TIME=\""$(shell date +%Y/%m/%d\ %H:%M:%S)\"" \ | |
-DMBTK_BUILD_GIT=\""$(shell git log | grep commit | head -1 | cut -d ' ' -f 2)\"" | |
#MBTK_BUILD_GIT="$(shell git log | grep commit | head -1 | cut -d ' ' -f 2)" | |
#$(info MBTK_BUILD_GIT=$(MBTK_BUILD_GIT)) | |
#$(info TOPDIR=$(TOPDIR)) | |
# BUILD_PROJECT=$(shell cat $(ROOT)/../build_version | grep PROJECT | cut -d '=' -f 2) | |
#$(info BUILD_PROJECT=$(BUILD_PROJECT)) | |
#BUILD_PROJECT_X=$(shell ${BUILD_PROJECT:0:4}) | |
#BUILD_PROJECT_X=$(shell echo $(BUILD_PROJECT) | cut -c 1-4) | |
#$(info BUILD_PROJECT_X=$(BUILD_PROJECT_X)) | |
DEFINE += -DMBTK_ALL_CID_SUPPORT | |
ifeq ($(MBTK_SOURCE_VERSION), 2) | |
DEFINE += -DMBTK_SOURCE_VERSION_2 | |
endif | |
#ifeq ($(MBTK_DEV_INFO_VERSION), 2) | |
#DEFINE += -DMBTK_DEV_INFO_VERSION_2 | |
#endif | |
ifeq ($(CONFIG_MBTK_5G_SUPPORT), Y) | |
DEFINE += -DMBTK_5G_SUPPORT | |
endif | |
LIB_DIR = \ | |
-L$(OUT_DIR)/lib | |
LIBS = -lpthread -lstdc++ | |
# Common temp files to delete from each directory. | |
TEMPFILES=core core.* *.o temp.* *.out |