liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 1 | # 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.liu | 17d7f8b | 2023-10-08 16:57:59 +0800 | [diff] [blame] | 7 | #BUILD_LIB_TYPE = shared
|
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 8 | # gcc-4.9 / gcc-8.4
|
b.liu | 17d7f8b | 2023-10-08 16:57:59 +0800 | [diff] [blame] | 9 | #BUILD_PLATFORM = gcc-8.4 |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 10 | OUT_DIR = $(ROOT)/out
|
| 11 | BUILD_ROOT = $(ROOT)/mbtk
|
| 12 | BUILD_TOOLCHAIN_DIR = $(ROOT)/toolchain/$(BUILD_PLATFORM)
|
| 13 | LOCAL_PATH=.
|
| 14 |
|
| 15 | ifeq ($(BUILD_PLATFORM), gcc-4.9)
|
| 16 | CC=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-uclibcgnueabi-gcc
|
| 17 | AR=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-uclibcgnueabi-ar
|
| 18 | else ifeq ($(BUILD_PLATFORM), gcc-8.4)
|
b.liu | 17d7f8b | 2023-10-08 16:57:59 +0800 | [diff] [blame] | 19 | CC=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-muslgnueabi-gcc
|
| 20 | AR=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-muslgnueabi-ar
|
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 21 | else
|
| 22 | CC=gcc
|
| 23 | AR=ar
|
| 24 | endif
|
| 25 |
|
| 26 | MAKE=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 |
|
| 34 | CFLAGS= --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 |
|
| 36 | AWK=awk
|
| 37 |
|
| 38 | #CFLAGS += -Wno-error=format-truncation -Wno-error=format-overflow= -Wno-error=stringop-overread -Wno-error=deprecated-declarations
|
| 39 |
|
| 40 | INC_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
|
| 49 | DEFINE = \
|
| 50 | -DMBTK_SUPPORT \
|
| 51 | -DMARVELL_EXTENDED \
|
| 52 | -DPXA1826_AUDIO \
|
| 53 | -D__USE_GNU \
|
| 54 | -DNOT_DROPPED_FLAGS_TEST \
|
| 55 | -DNDEBUG \
|
| 56 | -UDEBUG \
|
b.liu | 8883171 | 2023-10-10 15:26:32 +0800 | [diff] [blame^] | 57 | -D_FORTIFY_SOURCE=2 \
|
| 58 | -D_GNU_SOURCE
|
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 59 |
|
| 60 | LIB_DIR = \
|
| 61 | -L$(OUT_DIR)/lib
|
| 62 |
|
| 63 | LIBS = -lpthread -lstdc++
|
| 64 |
|
| 65 | # Common temp files to delete from each directory.
|
| 66 | TEMPFILES=core core.* *.o temp.* *.out
|