aboutsummaryrefslogtreecommitdiff
path: root/string/Dir.mk
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2020-02-12 15:10:29 +0000
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2020-02-18 15:37:48 +0000
commit1dfd7b85de70c8fa8c26316b2b67a6d6b3f638fd (patch)
tree64a11a74ddff023e70cf55a51fc4d11b29a5fdda /string/Dir.mk
parent4c175c8b8e124961beb22b8f034fe16e8d3798d0 (diff)
downloadarm-optimized-routines-1dfd7b85de70c8fa8c26316b2b67a6d6b3f638fd.tar.gz
string: change build system to avoid fragile includes
Including multiple asm source files into a single top level file can cause problems, this can be fixed by having one top level file per target specific source file, but for maintenance and clarity it's better to use the sub directory structure for selecting which files to build. This requires a new ARCH make variable setting in config.mk which must be consistent with the target of CC. Note: the __ARM_FEATURE_SVE checks are moved into the SVE asm code. This is not entirely right: the feature test macro is for ACLE, not asm support, but this patch is not supposed to change the produced binaries and some toolchains (e.g. older clang) does not support SVE instructions. The intention is to remove these checks eventually and always build all asm code and only support new toolchains (the test code will only test the SVE variants if there is target support for it though).
Diffstat (limited to 'string/Dir.mk')
-rw-r--r--string/Dir.mk9
1 files changed, 8 insertions, 1 deletions
diff --git a/string/Dir.mk b/string/Dir.mk
index 470917a..e22d847 100644
--- a/string/Dir.mk
+++ b/string/Dir.mk
@@ -6,7 +6,13 @@
S := $(srcdir)/string
B := build/string
-string-lib-srcs := $(wildcard $(S)/*.[cS])
+ifeq ($(ARCH),)
+all-string check-string install-string clean-string:
+ @echo "*** Please set ARCH in config.mk. ***"
+ @exit 1
+else
+
+string-lib-srcs := $(wildcard $(S)/$(ARCH)/*.[cS])
string-test-srcs := $(wildcard $(S)/test/*.c)
string-includes := $(patsubst $(S)/%,build/%,$(wildcard $(S)/include/*.h))
@@ -87,5 +93,6 @@ install-string: \
clean-string:
rm -f $(string-files)
+endif
.PHONY: all-string check-string install-string clean-string