diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2019-09-11 15:59:00 +0100 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2019-10-08 17:32:08 +0100 |
commit | 0705df194da1ff12e10cdbd12d5e70a2c574707d (patch) | |
tree | e07458575657c1f29e88fb9797793f21108944fb | |
parent | 1e0c802338af8efd3c1d46174fffbbdba3774629 (diff) | |
download | arm-optimized-routines-0705df194da1ff12e10cdbd12d5e70a2c574707d.tar.gz |
Support separate CFLAGS per subproject
Users may want different CFLAGS for math and string subprojects, expose
a mechanism for this in config.mk.
-rw-r--r-- | config.mk.dist | 4 | ||||
-rw-r--r-- | math/Dir.mk | 8 | ||||
-rw-r--r-- | string/Dir.mk | 1 |
3 files changed, 10 insertions, 3 deletions
diff --git a/config.mk.dist b/config.mk.dist index 0cf4e5a..30cb348 100644 --- a/config.mk.dist +++ b/config.mk.dist @@ -29,6 +29,10 @@ CFLAGS += -ffp-contract=fast -fno-math-errno # Use with clang. #CFLAGS += -ffp-contract=fast +# Additional CFLAGS for subprojects. +#math-cflags = +#string-cflags = + # Use for cross compilation with gcc. #CROSS_COMPILE = aarch64-none-linux-gnu- diff --git a/math/Dir.mk b/math/Dir.mk index 131f82a..494d3f0 100644 --- a/math/Dir.mk +++ b/math/Dir.mk @@ -34,17 +34,19 @@ math-test-objs := $(math-test-base:$(srcdir)/%=build/%.o) math-test-host-base := $(basename $(math-test-host-srcs)) math-test-host-objs := $(math-test-host-base:$(srcdir)/%=build/%.o) -math-objs := \ +math-target-objs := \ $(math-lib-objs) \ $(math-test-objs) \ - $(math-test-host-objs) \ + +math-objs := $(math-target-objs) $(math-test-host-objs) all-math: $(math-libs) $(math-tools) $(math-includes) TESTS = $(wildcard $(srcdir)/math/test/testcases/directed/*.tst) RTESTS = $(wildcard $(srcdir)/math/test/testcases/random/*.tst) -$(math-objs) $(math-objs:%.o=%.os): $(math-includes) +$(math-target-objs) $(math-objs:%.o=%.os): $(math-includes) +$(math-target-objs) $(math-objs:%.o=%.os): CFLAGS_ALL += $(math-cflags) build/math/test/mathtest.o: CFLAGS_ALL += -fmath-errno $(math-test-host-objs): CC = $(HOST_CC) $(math-test-host-objs): CFLAGS_ALL = $(HOST_CFLAGS) diff --git a/string/Dir.mk b/string/Dir.mk index bd9979f..0aac3f9 100644 --- a/string/Dir.mk +++ b/string/Dir.mk @@ -39,6 +39,7 @@ string-objs := \ all-string: $(string-libs) $(string-tools) $(string-includes) $(string-objs) $(string-objs:%.o=%.os): $(string-includes) +$(string-objs) $(string-objs:%.o=%.os): CFLAGS_ALL += $(string-cflags) build/lib/libstringlib.so: $(string-lib-objs:%.o=%.os) $(CC) $(CFLAGS_ALL) $(LDFLAGS_ALL) -shared -o $@ $^ |