blob: 4d6a1df96207275d89413376e52e0f4f131615b8 [file] [log] [blame]
b.liub17525e2025-05-14 17:22:29 +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
9ROOT = $(BUILD_ROOT)
10OUT_DIR = $(ROOT)/out
11BUILD_TOOLCHAIN_DIR = $(ROOT)/toolchain
12LOCAL_PATH=.
13
14export STAGING_DIR=
15
b.liub913ecf2025-05-27 18:51:54 +080016CC=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-gnueabi-gcc
17AR=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-gnueabi-ar
b.liub17525e2025-05-14 17:22:29 +080018
19MAKE=make
20
21$(info BUILD_LIB_TYPE=$(BUILD_LIB_TYPE))
22$(info ROOT=$(ROOT))
23$(info CC=$(CC))
24$(info AR=$(AR))
25
26# -Werror=non-virtual-dtor
27#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
28CFLAGS_DEF = --sysroot=$(BUILD_TOOLCHAIN_DIR) -Os -pipe -rdynamic -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -Wall -Werror -g
29
30CFLAGS_IGNORE_WARN = --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
31
32AWK=awk
33
34#CFLAGS += -Wno-error=format-truncation -Wno-error=format-overflow= -Wno-error=stringop-overread -Wno-error=deprecated-declarations
35
36CFLAGS=$(CFLAGS_IGNORE_WARN)
37
38INC_DIR = \
39 -I$(LOCAL_PATH)/ \
40 -I$(BUILD_ROOT)/mbtk/include \
41 -I$(BUILD_ROOT)/mbtk/include/mbtk \
42 -I$(BUILD_ROOT)/mbtk/include/lynq \
43 -I$(BUILD_ROOT)/mbtk/include/mqtt \
44 -I$(BUILD_ROOT)/mbtk/include/ql_v2
45
46# -DCONFIG_AB_SYSTEM
47DEFINE = \
48 -DMBTK_SUPPORT \
49 -DMARVELL_EXTENDED \
50 -DPXA1826_AUDIO \
51 -D__USE_GNU \
52 -DNOT_DROPPED_FLAGS_TEST \
53 -DNDEBUG \
54 -UDEBUG \
55 -D_FORTIFY_SOURCE=2 \
56 -D_GNU_SOURCE
57
58# -L$(OUT_DIR)/lib
59LIB_DIR = \
60 -L$(BUILD_ROOT)/mbtk/lib
61
62LIBS = -lpthread -lstdc++
63
64# Common temp files to delete from each directory.
65TEMPFILES=core core.* *.o temp.* *.out