b.liu | d440f9f | 2025-04-18 10:44:31 +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
|
| 7 | BUILD_LIB_TYPE = shared
|
| 8 | # gcc-4.9 / gcc-8.4
|
| 9 | BUILD_PLATFORM = gcc-8.4
|
| 10 | ROOT = $(BUILD_ROOT)
|
| 11 | OUT_DIR = $(ROOT)/out
|
| 12 | BUILD_TOOLCHAIN_DIR = $(ROOT)/toolchain/linux64
|
| 13 | LOCAL_PATH=.
|
| 14 |
|
| 15 | export STAGING_DIR=
|
| 16 |
|
| 17 | ifeq ($(BUILD_PLATFORM), gcc-4.9)
|
| 18 | CC=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-muslgnueabi-gcc
|
| 19 | AR=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-muslgnueabi-ar
|
| 20 | else ifeq ($(BUILD_PLATFORM), gcc-8.4)
|
b.liu | 2cff732 | 2025-05-26 18:41:13 +0800 | [diff] [blame] | 21 | CC=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-gnueabi-gcc
|
| 22 | AR=$(BUILD_TOOLCHAIN_DIR)/bin/arm-openwrt-linux-gnueabi-ar
|
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 23 | else
|
| 24 | CC=gcc
|
| 25 | AR=ar
|
| 26 | endif
|
| 27 |
|
| 28 | MAKE=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
|
| 38 | CFLAGS = --sysroot=$(BUILD_TOOLCHAIN_DIR) -Os -pipe -rdynamic -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -Wall -Werror -g
|
| 39 |
|
| 40 | 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
|
| 41 |
|
| 42 | AWK=awk
|
| 43 |
|
| 44 | #CFLAGS += -Wno-error=format-truncation -Wno-error=format-overflow= -Wno-error=stringop-overread -Wno-error=deprecated-declarations
|
| 45 |
|
| 46 | INC_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.liu | b17525e | 2025-05-14 17:22:29 +0800 | [diff] [blame] | 53 | -I$(BUILD_ROOT)/include/ql_v2 \
|
b.liu | f15ba34 | 2025-05-14 19:31:01 +0800 | [diff] [blame] | 54 | -I$(BUILD_ROOT)/include/gsw \
|
| 55 | -I$(BUILD_ROOT)/../marvell/services/optee_client/libteec/include
|
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 56 |
|
| 57 | # -DCONFIG_AB_SYSTEM
|
| 58 | DEFINE = \
|
| 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
|
| 70 | LIB_DIR = \
|
b.liu | ee93f10 | 2025-05-16 11:21:44 +0800 | [diff] [blame] | 71 | -L$(BUILD_ROOT)/rootfs/lib \
|
| 72 | -L$(BUILD_ROOT)/rootfs/usr/lib
|
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 73 |
|
| 74 | LIBS = -lpthread -lstdc++ -lwpa_client
|
| 75 |
|
| 76 | # Common temp files to delete from each directory.
|
| 77 | TEMPFILES=core core.* *.o temp.* *.out
|