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 | 1dfd7b8 | 2020-02-12 15:10:29 +0000 | [diff] [blame] | 9 | # Target architecture: aarch64, arm or x86_64 |
| 10 | ARCH = aarch64 |
Szabolcs Nagy | a202746 | 2018-07-27 11:14:11 +0100 | [diff] [blame] | 11 | |
Szabolcs Nagy | 1dfd7b8 | 2020-02-12 15:10:29 +0000 | [diff] [blame] | 12 | # Compiler for the target |
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 | |
Szabolcs Nagy | 1dfd7b8 | 2020-02-12 15:10:29 +0000 | [diff] [blame] | 18 | # Used for test case generator that is executed on the host |
| 19 | HOST_CC = gcc |
| 20 | HOST_CFLAGS = -std=c99 -O2 |
| 21 | HOST_CFLAGS += -Wall -Wno-unused-function |
| 22 | |
Szabolcs Nagy | a202746 | 2018-07-27 11:14:11 +0100 | [diff] [blame] | 23 | # Enable debug info. |
| 24 | HOST_CFLAGS += -g |
| 25 | CFLAGS += -g |
Szabolcs Nagy | 7889228 | 2018-04-24 17:10:05 +0100 | [diff] [blame] | 26 | |
Szabolcs Nagy | 1e0c802 | 2019-08-06 12:04:27 +0100 | [diff] [blame] | 27 | # Optimize the shared libraries on aarch64 assuming they fit in 1M. |
| 28 | #CFLAGS_SHARED = -fPIC -mcmodel=tiny |
| 29 | |
Szabolcs Nagy | 7889228 | 2018-04-24 17:10:05 +0100 | [diff] [blame] | 30 | # 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 Nagy | 1fd2aaa | 2019-11-20 18:05:06 +0000 | [diff] [blame] | 36 | |
| 37 | # Additional flags for subprojects. |
| 38 | math-cflags = |
| 39 | math-ldlibs = |
| 40 | math-ulpflags = |
| 41 | math-testflags = |
| 42 | string-cflags = |
| 43 | |
| 44 | # Use if mpfr is available on the target for ulp error checking. |
| 45 | #math-ldlibs += -lmpfr -lgmp |
| 46 | #math-cflags += -DUSE_MPFR |
| 47 | |
| 48 | # Use with gcc. |
| 49 | math-cflags += -frounding-math -fexcess-precision=standard -fno-stack-protector |
| 50 | math-cflags += -ffp-contract=fast -fno-math-errno |
| 51 | |
| 52 | # Use with clang. |
| 53 | #math-cflags += -ffp-contract=fast |
| 54 | |
| 55 | # Disable vector math code |
| 56 | #math-cflags += -DWANT_VMATH=0 |
| 57 | |
| 58 | # Disable fenv checks |
| 59 | #math-ulpflags = -q -f |
| 60 | #math-testflags = -nostatus |