Add build system and infra for the pl directory
- pl/ is built from top-level Makefile by adding pl to SUBS
- PLSUBS lists all pl/ subdirectories that can be built,
it only contains math for now. Please modify this list in
the top-level config.mk.
- pl libraries and infrastructure is built in build/pl/
- As a result math/ and pl/math generate separate test and bench
binaries.
- Use infrastructure provided in math/test to test and profile
pl/math routines. The build system ensures the appropriate
header files are first copied to build/pl/include/test to define
wrappers and entries in ulp and mathbench.
- Copyied scalar erff from math/ to pl/math/ to show build
system is functional.
- pl mathlib libraries are built separately to the main/portable
mathlib libraries and installed alongside.
diff --git a/Makefile b/Makefile
index 187a729..22323af 100644
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,7 @@
# Configure these in config.mk, do not make changes in this file.
SUBS = math string networking
+PLSUBS = math
HOST_CC = cc
HOST_CFLAGS = -std=c99 -O2
HOST_LDFLAGS =
@@ -20,6 +21,7 @@
CFLAGS = -std=c99 -O2
CFLAGS_SHARED = -fPIC
CFLAGS_ALL = -Ibuild/include $(CPPFLAGS) $(CFLAGS)
+CFLAGS_PL = -Ibuild/pl/include $(CPPFLAGS) $(CFLAGS) -DPL
LDFLAGS =
LDLIBS =
AR = $(CROSS_COMPILE)ar
@@ -51,6 +53,7 @@
mkdir -p $@
$(filter %.os,$(ALL_FILES)): CFLAGS_ALL += $(CFLAGS_SHARED)
+$(filter %.os,$(ALL_FILES)): CFLAGS_PL += $(CFLAGS_SHARED)
build/%.o: $(srcdir)/%.S
$(CC) $(CFLAGS_ALL) -c -o $@ $<