blob: 177e1ac4f53a3e14772a7560f7f79eba86ffe5e7 [file] [log] [blame]
Szabolcs Nagy78892282018-04-24 17:10:05 +01001# Example config.mk
2#
Szabolcs Nagye823e3a2021-02-17 14:28:25 +00003# Copyright (c) 2018-2020, Arm Limited.
Szabolcs Nagy11253b02018-11-12 11:10:57 +00004# SPDX-License-Identifier: MIT
Szabolcs Nagy78892282018-04-24 17:10:05 +01005
Szabolcs Nagy1fd2aaa2019-11-20 18:05:06 +00006# Subprojects to build
Ola Liljedahl6a988f62020-02-27 15:10:03 +01007SUBS = math string networking
Szabolcs Nagy1fd2aaa2019-11-20 18:05:06 +00008
Szabolcs Nagy1dfd7b82020-02-12 15:10:29 +00009# Target architecture: aarch64, arm or x86_64
10ARCH = aarch64
Szabolcs Nagya2027462018-07-27 11:14:11 +010011
Branislav Rankov4d55c2d2020-05-28 18:11:20 +010012# Use for cross compilation with gcc.
13#CROSS_COMPILE = aarch64-none-linux-gnu-
14
Szabolcs Nagy1dfd7b82020-02-12 15:10:29 +000015# Compiler for the target
Szabolcs Nagy78892282018-04-24 17:10:05 +010016CC = $(CROSS_COMPILE)gcc
17CFLAGS = -std=c99 -pipe -O3
Szabolcs Nagya2027462018-07-27 11:14:11 +010018CFLAGS += -Wall -Wno-missing-braces
Szabolcs Nagy433a3b12019-10-17 12:31:17 +010019CFLAGS += -Werror=implicit-function-declaration
Szabolcs Nagya2027462018-07-27 11:14:11 +010020
Szabolcs Nagy1dfd7b82020-02-12 15:10:29 +000021# Used for test case generator that is executed on the host
22HOST_CC = gcc
23HOST_CFLAGS = -std=c99 -O2
24HOST_CFLAGS += -Wall -Wno-unused-function
25
Szabolcs Nagya2027462018-07-27 11:14:11 +010026# Enable debug info.
27HOST_CFLAGS += -g
28CFLAGS += -g
Szabolcs Nagy78892282018-04-24 17:10:05 +010029
Szabolcs Nagy1e0c8022019-08-06 12:04:27 +010030# Optimize the shared libraries on aarch64 assuming they fit in 1M.
31#CFLAGS_SHARED = -fPIC -mcmodel=tiny
32
Branislav Rankov4d55c2d2020-05-28 18:11:20 +010033# Enable MTE support.
34#CFLAGS += -march=armv8.5-a+memtag -DWANT_MTE_TEST=1
Szabolcs Nagy78892282018-04-24 17:10:05 +010035
36# Use with cross testing.
37#EMULATOR = qemu-aarch64-static
38#EMULATOR = sh -c 'scp $$1 user@host:/dir && ssh user@host /dir/"$$@"' --
Szabolcs Nagy1fd2aaa2019-11-20 18:05:06 +000039
40# Additional flags for subprojects.
41math-cflags =
42math-ldlibs =
43math-ulpflags =
44math-testflags =
45string-cflags =
Ola Liljedahl6a988f62020-02-27 15:10:03 +010046networking-cflags =
Szabolcs Nagy1fd2aaa2019-11-20 18:05:06 +000047
48# Use if mpfr is available on the target for ulp error checking.
49#math-ldlibs += -lmpfr -lgmp
50#math-cflags += -DUSE_MPFR
51
52# Use with gcc.
53math-cflags += -frounding-math -fexcess-precision=standard -fno-stack-protector
54math-cflags += -ffp-contract=fast -fno-math-errno
55
56# Use with clang.
57#math-cflags += -ffp-contract=fast
58
59# Disable vector math code
60#math-cflags += -DWANT_VMATH=0
61
62# Disable fenv checks
63#math-ulpflags = -q -f
64#math-testflags = -nostatus
Ola Liljedahl6a988f62020-02-27 15:10:03 +010065
Szabolcs Nagye1127942020-05-01 13:14:50 +010066# Remove GNU Property Notes from asm files.
67#string-cflags += -DWANT_GNU_PROPERTY=0
68
Ola Liljedahl6a988f62020-02-27 15:10:03 +010069# Enable assertion checks.
70#networking-cflags += -DWANT_ASSERT
71
72# Avoid auto-vectorization of scalar code and unroll loops
73networking-cflags += -O2 -fno-tree-vectorize -funroll-loops