blob: 341276e1cac74deff83609d208809b8b373d1a34 [file] [log] [blame]
liubin281ac462023-07-19 14:22:54 +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
b.liu17d7f8b2023-10-08 16:57:59 +08007#BUILD_LIB_TYPE = shared
liubin281ac462023-07-19 14:22:54 +08008# gcc-4.9 / gcc-8.4
b.liu17d7f8b2023-10-08 16:57:59 +08009#BUILD_PLATFORM = gcc-8.4
liubin281ac462023-07-19 14:22:54 +080010OUT_DIR = $(ROOT)/out
11BUILD_ROOT = $(ROOT)/mbtk
12BUILD_TOOLCHAIN_DIR = $(ROOT)/toolchain/$(BUILD_PLATFORM)
13LOCAL_PATH=.
14
15ifeq ($(BUILD_PLATFORM), gcc-4.9)
16CC=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-uclibcgnueabi-gcc
17AR=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-uclibcgnueabi-ar
18else ifeq ($(BUILD_PLATFORM), gcc-8.4)
b.liu17d7f8b2023-10-08 16:57:59 +080019CC=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-muslgnueabi-gcc
20AR=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-muslgnueabi-ar
liubin281ac462023-07-19 14:22:54 +080021else
22CC=gcc
23AR=ar
24endif
25
26MAKE=make
27
28$(info BUILD_LIB_TYPE=$(BUILD_LIB_TYPE))
29$(info BUILD_PLATFORM=$(BUILD_PLATFORM))
30$(info ROOT=$(ROOT))
31$(info CC=$(CC))
32$(info AR=$(AR))
33
34CFLAGS= --sysroot=$(BUILD_TOOLCHAIN_DIR) -Os -pipe -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=non-virtual-dtor -Werror=address -Werror=sequence-point -ffunction-sections -Wl,--gc-sections -Wl,--no-undefined
35
36AWK=awk
37
38#CFLAGS += -Wno-error=format-truncation -Wno-error=format-overflow= -Wno-error=stringop-overread -Wno-error=deprecated-declarations
39
40INC_DIR = \
41 -I$(LOCAL_PATH)/inc \
42 -I$(BUILD_ROOT)/include \
43 -I$(BUILD_ROOT)/include/mbtk \
44 -I$(BUILD_ROOT)/include/lynq \
45 -I$(BUILD_ROOT)/include/mqtt \
46 -I$(BUILD_ROOT)/include/ql
47
48# -DCONFIG_AB_SYSTEM
49DEFINE = \
50 -DMBTK_SUPPORT \
51 -DMARVELL_EXTENDED \
52 -DPXA1826_AUDIO \
53 -D__USE_GNU \
54 -DNOT_DROPPED_FLAGS_TEST \
55 -DNDEBUG \
56 -UDEBUG \
57 -D_FORTIFY_SOURCE=2
58
59LIB_DIR = \
60 -L$(OUT_DIR)/lib
61
62LIBS = -lpthread -lstdc++
63
64# Common temp files to delete from each directory.
65TEMPFILES=core core.* *.o temp.* *.out