Szabolcs Nagy | 7889228 | 2018-04-24 17:10:05 +0100 | [diff] [blame] | 1 | # Example config.mk |
| 2 | # |
Szabolcs Nagy | 1fd2aaa | 2019-11-20 18:05:06 +0000 | [diff] [blame] | 3 | # Copyright (c) 2018-2019, Arm Limited. |
Szabolcs Nagy | 11253b0 | 2018-11-12 11:10:57 +0000 | [diff] [blame] | 4 | # SPDX-License-Identifier: MIT |
Szabolcs Nagy | 7889228 | 2018-04-24 17:10:05 +0100 | [diff] [blame] | 5 | |
Szabolcs Nagy | 1fd2aaa | 2019-11-20 18:05:06 +0000 | [diff] [blame] | 6 | # Subprojects to build |
| 7 | SUBS = math string |
| 8 | |
Szabolcs Nagy | 7889228 | 2018-04-24 17:10:05 +0100 | [diff] [blame] | 9 | HOST_CC = gcc |
Szabolcs Nagy | a202746 | 2018-07-27 11:14:11 +0100 | [diff] [blame] | 10 | HOST_CFLAGS = -std=c99 -O2 |
| 11 | HOST_CFLAGS += -Wall -Wno-unused-function |
| 12 | |
Szabolcs Nagy | 7889228 | 2018-04-24 17:10:05 +0100 | [diff] [blame] | 13 | CC = $(CROSS_COMPILE)gcc |
| 14 | CFLAGS = -std=c99 -pipe -O3 |
Szabolcs Nagy | a202746 | 2018-07-27 11:14:11 +0100 | [diff] [blame] | 15 | CFLAGS += -Wall -Wno-missing-braces |
Szabolcs Nagy | 433a3b1 | 2019-10-17 12:31:17 +0100 | [diff] [blame] | 16 | CFLAGS += -Werror=implicit-function-declaration |
Szabolcs Nagy | a202746 | 2018-07-27 11:14:11 +0100 | [diff] [blame] | 17 | |
| 18 | # Enable debug info. |
| 19 | HOST_CFLAGS += -g |
| 20 | CFLAGS += -g |
Szabolcs Nagy | 7889228 | 2018-04-24 17:10:05 +0100 | [diff] [blame] | 21 | |
Szabolcs Nagy | 1e0c802 | 2019-08-06 12:04:27 +0100 | [diff] [blame] | 22 | # Optimize the shared libraries on aarch64 assuming they fit in 1M. |
| 23 | #CFLAGS_SHARED = -fPIC -mcmodel=tiny |
| 24 | |
Szabolcs Nagy | 7889228 | 2018-04-24 17:10:05 +0100 | [diff] [blame] | 25 | # 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 Nagy | 1fd2aaa | 2019-11-20 18:05:06 +0000 | [diff] [blame] | 31 | |
| 32 | # Additional flags for subprojects. |
| 33 | math-cflags = |
| 34 | math-ldlibs = |
| 35 | math-ulpflags = |
| 36 | math-testflags = |
| 37 | string-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. |
| 44 | math-cflags += -frounding-math -fexcess-precision=standard -fno-stack-protector |
| 45 | math-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 |