blob: 301b5f929ded79bac259714850aed41b2d6bdffd [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
7SUBS = math string
8
Szabolcs Nagy78892282018-04-24 17:10:05 +01009HOST_CC = gcc
Szabolcs Nagya2027462018-07-27 11:14:11 +010010HOST_CFLAGS = -std=c99 -O2
11HOST_CFLAGS += -Wall -Wno-unused-function
12
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
18# Enable debug info.
19HOST_CFLAGS += -g
20CFLAGS += -g
Szabolcs Nagy78892282018-04-24 17:10:05 +010021
Szabolcs Nagy1e0c8022019-08-06 12:04:27 +010022# Optimize the shared libraries on aarch64 assuming they fit in 1M.
23#CFLAGS_SHARED = -fPIC -mcmodel=tiny
24
Szabolcs Nagy78892282018-04-24 17:10:05 +010025# Use for cross compilation with gcc.
26#CROSS_COMPILE = aarch64-none-linux-gnu-
27
28# Use with cross testing.
29#EMULATOR = qemu-aarch64-static
30#EMULATOR = sh -c 'scp $$1 user@host:/dir && ssh user@host /dir/"$$@"' --
Szabolcs Nagy1fd2aaa2019-11-20 18:05:06 +000031
32# Additional flags for subprojects.
33math-cflags =
34math-ldlibs =
35math-ulpflags =
36math-testflags =
37string-cflags =
38
39# Use if mpfr is available on the target for ulp error checking.
40#math-ldlibs += -lmpfr -lgmp
41#math-cflags += -DUSE_MPFR
42
43# Use with gcc.
44math-cflags += -frounding-math -fexcess-precision=standard -fno-stack-protector
45math-cflags += -ffp-contract=fast -fno-math-errno
46
47# Use with clang.
48#math-cflags += -ffp-contract=fast
49
50# Disable vector math code
51#math-cflags += -DWANT_VMATH=0
52
53# Disable fenv checks
54#math-ulpflags = -q -f
55#math-testflags = -nostatus