blob: 5fa7cafb98d128f81ab0d895fc0d7688e4ab5369 [file] [log] [blame]
b.liud440f9f2025-04-18 10:44:31 +08001# Common make definitions, customized for each platform
2
3# Definitions required in all program directories to compile and link
4# C programs using gcc.
5
6# static / shared
7BUILD_LIB_TYPE = shared
8# gcc-4.9 / gcc-8.4
9BUILD_PLATFORM = gcc-8.4
10ROOT = $(BUILD_ROOT)
11OUT_DIR = $(ROOT)/out
12BUILD_TOOLCHAIN_DIR = $(ROOT)/toolchain/linux64
13LOCAL_PATH=.
14
15export STAGING_DIR=
16
17ifeq ($(BUILD_PLATFORM), gcc-4.9)
18CC=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-muslgnueabi-gcc
19AR=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-muslgnueabi-ar
20else ifeq ($(BUILD_PLATFORM), gcc-8.4)
b.liu2cff7322025-05-26 18:41:13 +080021CC=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-gnueabi-gcc
22AR=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-gnueabi-ar
b.liud440f9f2025-04-18 10:44:31 +080023else
24CC=gcc
25AR=ar
26endif
27
28MAKE=make
29
30$(info BUILD_LIB_TYPE=$(BUILD_LIB_TYPE))
31$(info BUILD_PLATFORM=$(BUILD_PLATFORM))
32$(info ROOT=$(ROOT))
33$(info CC=$(CC))
34$(info AR=$(AR))
35
36# -Werror=non-virtual-dtor
37#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
38CFLAGS = --sysroot=$(BUILD_TOOLCHAIN_DIR) -Os -pipe -rdynamic -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -Wall -Werror -g
39
40CFLAGS_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
41
42AWK=awk
43
44#CFLAGS += -Wno-error=format-truncation -Wno-error=format-overflow= -Wno-error=stringop-overread -Wno-error=deprecated-declarations
45
46INC_DIR = \
47 -I$(LOCAL_PATH)/ \
48 -I$(LOCAL_PATH)/inc \
49 -I$(BUILD_ROOT)/include \
50 -I$(BUILD_ROOT)/include/mbtk \
51 -I$(BUILD_ROOT)/include/lynq \
52 -I$(BUILD_ROOT)/include/mqtt \
b.liub17525e2025-05-14 17:22:29 +080053 -I$(BUILD_ROOT)/include/ql_v2 \
b.liuf15ba342025-05-14 19:31:01 +080054 -I$(BUILD_ROOT)/include/gsw \
55 -I$(BUILD_ROOT)/../marvell/services/optee_client/libteec/include
b.liud440f9f2025-04-18 10:44:31 +080056
57# -DCONFIG_AB_SYSTEM
58DEFINE = \
59 -DMBTK_SUPPORT \
60 -DMARVELL_EXTENDED \
61 -DPXA1826_AUDIO \
62 -D__USE_GNU \
63 -DNOT_DROPPED_FLAGS_TEST \
64 -DNDEBUG \
65 -UDEBUG \
66 -D_FORTIFY_SOURCE=2 \
67 -D_GNU_SOURCE
68
69# -L$(OUT_DIR)/lib
70LIB_DIR = \
b.liuee93f102025-05-16 11:21:44 +080071 -L$(BUILD_ROOT)/rootfs/lib \
72 -L$(BUILD_ROOT)/rootfs/usr/lib
b.liud440f9f2025-04-18 10:44:31 +080073
74LIBS = -lpthread -lstdc++ -lwpa_client
75
76# Common temp files to delete from each directory.
77TEMPFILES=core core.* *.o temp.* *.out