blob: 2336c52565838e362c665ab4856f4d30529fff85 [file] [log] [blame]
Szabolcs Nagy78892282018-04-24 17:10:05 +01001# Example config.mk
2#
Szabolcs Nagy1fd2aaa2019-11-20 18:05:06 +00003# Copyright (c) 2018-2019, 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
Szabolcs Nagy1dfd7b82020-02-12 15:10:29 +000012# Compiler for the target
Szabolcs Nagy78892282018-04-24 17:10:05 +010013CC = $(CROSS_COMPILE)gcc
14CFLAGS = -std=c99 -pipe -O3
Szabolcs Nagya2027462018-07-27 11:14:11 +010015CFLAGS += -Wall -Wno-missing-braces
Szabolcs Nagy433a3b12019-10-17 12:31:17 +010016CFLAGS += -Werror=implicit-function-declaration
Szabolcs Nagya2027462018-07-27 11:14:11 +010017
Szabolcs Nagy1dfd7b82020-02-12 15:10:29 +000018# Used for test case generator that is executed on the host
19HOST_CC = gcc
20HOST_CFLAGS = -std=c99 -O2
21HOST_CFLAGS += -Wall -Wno-unused-function
22
Szabolcs Nagya2027462018-07-27 11:14:11 +010023# Enable debug info.
24HOST_CFLAGS += -g
25CFLAGS += -g
Szabolcs Nagy78892282018-04-24 17:10:05 +010026
Szabolcs Nagy1e0c8022019-08-06 12:04:27 +010027# Optimize the shared libraries on aarch64 assuming they fit in 1M.
28#CFLAGS_SHARED = -fPIC -mcmodel=tiny
29
Szabolcs Nagy78892282018-04-24 17:10:05 +010030# Use for cross compilation with gcc.
31#CROSS_COMPILE = aarch64-none-linux-gnu-
32
33# Use with cross testing.
34#EMULATOR = qemu-aarch64-static
35#EMULATOR = sh -c 'scp $$1 user@host:/dir && ssh user@host /dir/"$$@"' --
Szabolcs Nagy1fd2aaa2019-11-20 18:05:06 +000036
37# Additional flags for subprojects.
38math-cflags =
39math-ldlibs =
40math-ulpflags =
41math-testflags =
42string-cflags =
Ola Liljedahl6a988f62020-02-27 15:10:03 +010043networking-cflags =
Szabolcs Nagy1fd2aaa2019-11-20 18:05:06 +000044
45# Use if mpfr is available on the target for ulp error checking.
46#math-ldlibs += -lmpfr -lgmp
47#math-cflags += -DUSE_MPFR
48
49# Use with gcc.
50math-cflags += -frounding-math -fexcess-precision=standard -fno-stack-protector
51math-cflags += -ffp-contract=fast -fno-math-errno
52
53# Use with clang.
54#math-cflags += -ffp-contract=fast
55
56# Disable vector math code
57#math-cflags += -DWANT_VMATH=0
58
59# Disable fenv checks
60#math-ulpflags = -q -f
61#math-testflags = -nostatus
Ola Liljedahl6a988f62020-02-27 15:10:03 +010062
63# Enable assertion checks.
64#networking-cflags += -DWANT_ASSERT
65
66# Avoid auto-vectorization of scalar code and unroll loops
67networking-cflags += -O2 -fno-tree-vectorize -funroll-loops