[Sound-open-firmware] [PATCH] build: add library build support for host platform

Ranjani Sridharan ranjani.sridharan at linux.intel.com
Fri Jan 12 19:56:14 CET 2018


This patch provides library build support for host platform architecture.
It enables creating separate libraries for each SOF audio component.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan at linux.intel.com>
---
 README                                   |    7 +
 build-all.sh                             |    6 +
 configure.ac                             |    3 +
 src/Makefile.am                          |   11 +
 src/arch/host/include/Makefile.am        |    1 +
 src/arch/host/include/arch/Makefile.am   |    8 +
 src/audio/Makefile.am                    | 1005 +++++++++++++++++++++++++++++-
 src/include/reef/Makefile.am             |    4 +-
 src/include/reef/audio/Makefile.am       |    8 +-
 src/include/uapi/Makefile.am             |    2 +-
 src/ipc/Makefile.am                      |   28 +-
 src/library/include/platform/Makefile.am |   12 +
 src/math/Makefile.am                     |   22 +-
 13 files changed, 1096 insertions(+), 21 deletions(-)
 create mode 100644 src/arch/host/include/Makefile.am
 create mode 100644 src/arch/host/include/arch/Makefile.am
 create mode 100644 src/library/include/platform/Makefile.am

diff --git a/README b/README
index 9ca5b12..463fc42 100644
--- a/README
+++ b/README
@@ -13,6 +13,13 @@ Cherrytrail :-
 
 ./configure --with-arch=xtensa --with-platform=cherrytrail --with-root-dir=$PWD/../xtensa-root/xtensa-byt-elf --host=xtensa-byt-elf
 
+Library for Host Platform :-
+If building library for host platform, run the following configure. Please modify
+the --prefix option to choose the directory for installing the library files and
+headers
+
+./configure --with-arch=host --enable-library=yes --host=x86_64-unknown-linux-gnu --prefix=$pwd/../host-root/
+
 3) make
 
 4) make bin
diff --git a/build-all.sh b/build-all.sh
index 2e015f6..a0ce575 100755
--- a/build-all.sh
+++ b/build-all.sh
@@ -9,6 +9,12 @@ pwd=`pwd`
 
 rm -fr src/arch/xtensa/*.ri
 
+# build library for host platform architecture
+./configure --with-arch=host --enable-library=yes
+--host=x86_64-unknown-linux-gnu --prefix=$pwd/../host-root/
+make
+make install
+
 # Build for Baytrail
 ./configure --with-arch=xtensa --with-platform=baytrail --with-root-dir=$pwd/../xtensa-root/xtensa-byt-elf --host=xtensa-byt-elf
 make clean
diff --git a/configure.ac b/configure.ac
index 00c377f..6c559fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -161,6 +161,9 @@ AC_CONFIG_FILES([
 	src/arch/xtensa/include/xtensa/config/Makefile
 	src/arch/xtensa/hal/Makefile
 	src/arch/xtensa/xtos/Makefile
+	src/arch/host/Makefile
+	src/arch/host/include/Makefile
+	src/arch/host/include/arch/Makefile
 	src/audio/Makefile
         src/math/Makefile
 	src/drivers/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index fb82330..8944a8d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1 +1,12 @@
 SUBDIRS = include init math audio platform tasks drivers ipc lib arch
+
+export COMMON_INCDIR = \
+	$(REEF_INCDIR) \
+	$(ARCH_INCDIR) \
+	$(PLATFORM_INCDIR)
+
+if BUILD_LIB
+SUBDIRS = ipc math audio arch include library
+else
+SUBDIRS = init math audio platform tasks drivers ipc lib arch include
+endif
diff --git a/src/arch/host/include/Makefile.am b/src/arch/host/include/Makefile.am
new file mode 100644
index 0000000..f0ac9b7
--- /dev/null
+++ b/src/arch/host/include/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = arch
diff --git a/src/arch/host/include/arch/Makefile.am b/src/arch/host/include/arch/Makefile.am
new file mode 100644
index 0000000..6dddb35
--- /dev/null
+++ b/src/arch/host/include/arch/Makefile.am
@@ -0,0 +1,8 @@
+includedir = $(prefix)/include/sof/arch
+
+include_HEADERS = \
+	cache.h \
+	interrupt.h \
+	reef.h \
+	spinlock.h \
+	timer.h
diff --git a/src/audio/Makefile.am b/src/audio/Makefile.am
index d19dff7..9441e7e 100644
--- a/src/audio/Makefile.am
+++ b/src/audio/Makefile.am
@@ -1,3 +1,1002 @@
+includedir = $(prefix)/include/sof/audio
+
+include_HEADERS = \
+	eq_iir.h \
+	eq_fir.h
+
+COMP_SRC = \
+	eq_iir.c \
+	iir.c \
+	eq_fir.c \
+	fir.c \
+	tone.c \
+	src.c \
+	src_core.c \
+	mixer.c \
+	mux.c \
+	volume.c \
+	switch.c \
+	dai.c \
+	host.c \
+	pipeline.c \
+	component.c \
+	buffer.c
+
+SOF_SRC = \
+	dai.c \
+	host.c \
+	pipeline.c \
+	component.c \
+	buffer.c
+
+SRC_SRC = \
+	src.c \
+	src_core.c
+
+EQ_FIR_SRC = \
+	eq_fir.c \
+	fir.c
+
+EQ_IIR_SRC = \
+	eq_iir.c \
+	iir.c
+
+if BUILD_LIB
+
+# only host builds shared libraries, the rest are static
+if BUILD_HOST
+
+# libsof
+lib_LTLIBRARIES  = libsof.la
+
+libsof_la_SOURCES = $(SOF_SRC)
+
+libsof_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_src
+lib_LTLIBRARIES  += libsof_src.la
+
+libsof_src_la_SOURCES = $(SRC_SRC)
+
+libsof_src_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_src_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_eq_fir
+lib_LTLIBRARIES  += libsof_eq_fir.la
+
+libsof_eq_fir_la_SOURCES = $(EQ_FIR_SRC)
+
+libsof_eq_fir_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_eq_fir_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_eq_iir
+lib_LTLIBRARIES  += libsof_eq_iir.la
+
+libsof_eq_iir_la_SOURCES = $(EQ_IIR_SRC)
+
+libsof_eq_iir_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_eq_iir_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_volume
+lib_LTLIBRARIES  += libsof_volume.la
+
+libsof_volume_la_SOURCES = volume.c
+
+libsof_volume_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_volume_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_mux
+lib_LTLIBRARIES  += libsof_mux.la
+
+libsof_mux_la_SOURCES = mux.c
+
+libsof_mux_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_mux_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_switch
+lib_LTLIBRARIES  += libsof_switch.la
+
+libsof_switch_la_SOURCES = switch.c
+
+libsof_switch_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_switch_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_mixer
+lib_LTLIBRARIES  += libsof_mixer.la
+
+libsof_mixer_la_SOURCES = mixer.c
+
+libsof_mixer_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_mixer_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_tone
+lib_LTLIBRARIES  += libsof_tone.la
+
+libsof_tone_la_SOURCES = tone.c
+
+libsof_tone_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_tone_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+if HAVE_SSE42
+# libsof
+lib_LTLIBRARIES  += libsof_sse42.la
+
+libsof_sse42_la_SOURCES = $(SOF_SRC)
+
+libsof_sse42_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_sse42_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_src
+lib_LTLIBRARIES  += libsof_src_sse42.la
+
+libsof_src_sse42_la_SOURCES = $(SRC_SRC)
+
+libsof_src_sse42_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_src_sse42_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_eq_fir
+lib_LTLIBRARIES  += libsof_eq_fir_sse42.la
+
+libsof_eq_fir_sse42_la_SOURCES = $(EQ_FIR_SRC)
+
+libsof_eq_fir_sse42_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_eq_fir_sse42_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_eq_iir
+lib_LTLIBRARIES  += libsof_eq_iir_sse42.la
+
+libsof_eq_iir_sse42_la_SOURCES = $(EQ_IIR_SRC)
+
+libsof_eq_iir_sse42_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_eq_iir_sse42_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_volume
+lib_LTLIBRARIES  += libsof_volume_sse42.la
+
+libsof_volume_sse42_la_SOURCES = volume.c
+
+libsof_volume_sse42_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_volume_sse42_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_mux
+lib_LTLIBRARIES  += libsof_mux_sse42.la
+
+libsof_mux_sse42_la_SOURCES = mux.c
+
+libsof_mux_sse42_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_mux_sse42_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_switch
+lib_LTLIBRARIES  += libsof_switch_sse42.la
+
+libsof_switch_sse42_la_SOURCES = switch.c
+
+libsof_switch_sse42_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_switch_sse42_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_mixer
+lib_LTLIBRARIES  += libsof_mixer_sse42.la
+
+libsof_mixer_sse42_la_SOURCES = mixer.c
+
+libsof_mixer_sse42_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_mixer_sse42_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_tone
+lib_LTLIBRARIES  += libsof_tone_sse42.la
+
+libsof_tone_sse42_la_SOURCES = tone.c
+
+libsof_tone_sse42_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_tone_sse42_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+endif
+
+if HAVE_AVX
+# libsof
+lib_LTLIBRARIES  += libsof_avx.la
+
+libsof_avx_la_SOURCES = $(SOF_SRC)
+
+libsof_avx_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(AVX_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_avx_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_src
+lib_LTLIBRARIES  += libsof_src_avx.la
+
+libsof_src_avx_la_SOURCES = $(SRC_SRC)
+
+libsof_src_avx_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(AVX_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_src_avx_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_eq_fir
+lib_LTLIBRARIES  += libsof_eq_fir_avx.la
+
+libsof_eq_fir_avx_la_SOURCES = $(EQ_FIR_SRC)
+
+libsof_eq_fir_avx_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(AVX_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_eq_fir_avx_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_eq_iir
+lib_LTLIBRARIES  += libsof_eq_iir_avx.la
+
+libsof_eq_iir_avx_la_SOURCES = $(EQ_IIR_SRC)
+
+libsof_eq_iir_avx_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(AVX_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_eq_iir_avx_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_volume
+lib_LTLIBRARIES  += libsof_volume_avx.la
+
+libsof_volume_avx_la_SOURCES = volume.c
+
+libsof_volume_avx_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(AVX_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_volume_avx_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_mux
+lib_LTLIBRARIES  += libsof_mux_avx.la
+
+libsof_mux_avx_la_SOURCES = mux.c
+
+libsof_mux_avx_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(AVX_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_mux_avx_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_switch
+lib_LTLIBRARIES  += libsof_switch_avx.la
+
+libsof_switch_avx_la_SOURCES = switch.c
+
+libsof_switch_avx_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(AVX_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_switch_avx_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_mixer
+lib_LTLIBRARIES  += libsof_mixer_avx.la
+
+libsof_mixer_avx_la_SOURCES = mixer.c
+
+libsof_mixer_avx_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(AVX_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_mixer_avx_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_tone
+lib_LTLIBRARIES  += libsof_tone_avx.la
+
+libsof_tone_avx_la_SOURCES = tone.c
+
+libsof_tone_avx_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(AVX_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_tone_avx_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+endif
+
+if HAVE_AVX2
+# libsof
+lib_LTLIBRARIES  += libsof_avx2.la
+
+libsof_avx2_la_SOURCES = $(SOF_SRC)
+
+libsof_avx2_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(AVX2_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_avx2_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_src
+lib_LTLIBRARIES  += libsof_src_avx2.la
+
+libsof_src_avx2_la_SOURCES = $(SRC_SRC)
+
+libsof_src_avx2_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(AVX2_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_src_avx2_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_eq_fir
+lib_LTLIBRARIES  += libsof_eq_fir_avx2.la
+
+libsof_eq_fir_avx2_la_SOURCES = $(EQ_FIR_SRC)
+
+libsof_eq_fir_avx2_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(AVX2_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_eq_fir_avx2_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_eq_iir
+lib_LTLIBRARIES  += libsof_eq_iir_avx2.la
+
+libsof_eq_iir_avx2_la_SOURCES = $(EQ_IIR_SRC)
+
+libsof_eq_iir_avx2_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(AVX2_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_eq_iir_avx2_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_volume
+lib_LTLIBRARIES  += libsof_volume_avx2.la
+
+libsof_volume_avx2_la_SOURCES = volume.c
+
+libsof_volume_avx2_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(AVX2_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_volume_avx2_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_mux
+lib_LTLIBRARIES  += libsof_mux_avx2.la
+
+libsof_mux_avx2_la_SOURCES = mux.c
+
+libsof_mux_avx2_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(AVX2_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_mux_avx2_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_switch
+lib_LTLIBRARIES  += libsof_switch_avx2.la
+
+libsof_switch_avx2_la_SOURCES = switch.c
+
+libsof_switch_avx2_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(AVX2_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_switch_avx2_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_mixer
+lib_LTLIBRARIES  += libsof_mixer_avx2.la
+
+libsof_mixer_avx2_la_SOURCES = mixer.c
+
+libsof_mixer_avx2_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(AVX2_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_mixer_avx2_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_tone
+lib_LTLIBRARIES  += libsof_tone_avx2.la
+
+libsof_tone_avx2_la_SOURCES = tone.c
+
+libsof_tone_avx2_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(AVX2_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_tone_avx2_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+endif
+
+if HAVE_FMA
+# libsof
+lib_LTLIBRARIES  += libsof_fma.la
+
+libsof_fma_la_SOURCES = $(SOF_SRC)
+
+libsof_fma_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(FMA_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_fma_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_src
+lib_LTLIBRARIES  += libsof_src_fma.la
+
+libsof_src_fma_la_SOURCES = $(SRC_SRC)
+
+libsof_src_fma_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(FMA_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_src_fma_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_eq_fir
+lib_LTLIBRARIES  += libsof_eq_fir_fma.la
+
+libsof_eq_fir_fma_la_SOURCES = $(EQ_FIR_SRC)
+
+libsof_eq_fir_fma_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(FMA_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_eq_fir_fma_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_eq_iir
+lib_LTLIBRARIES  += libsof_eq_iir_fma.la
+
+libsof_eq_iir_fma_la_SOURCES = $(EQ_IIR_SRC)
+
+libsof_eq_iir_fma_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(FMA_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_eq_iir_fma_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_volume
+lib_LTLIBRARIES  += libsof_volume_fma.la
+
+libsof_volume_fma_la_SOURCES = volume.c
+
+libsof_volume_fma_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(FMA_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_volume_fma_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_mux
+lib_LTLIBRARIES  += libsof_mux_fma.la
+
+libsof_mux_fma_la_SOURCES = mux.c
+
+libsof_mux_fma_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(FMA_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_mux_fma_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_switch
+lib_LTLIBRARIES  += libsof_switch_fma.la
+
+libsof_switch_fma_la_SOURCES = switch.c
+
+libsof_switch_fma_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(FMA_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_switch_fma_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_mixer
+lib_LTLIBRARIES  += libsof_mixer_fma.la
+
+libsof_mixer_fma_la_SOURCES = mixer.c
+
+libsof_mixer_fma_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(FMA_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_mixer_fma_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+# libsof_tone
+lib_LTLIBRARIES  += libsof_tone_fma.la
+
+libsof_tone_fma_la_SOURCES = tone.c
+
+libsof_tone_fma_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(FMA_CFLAGS) \
+	$(COMMON_INCDIR)
+
+libsof_tone_fma_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+endif
+
+else
+
+# Build for non host targets
+
+# libsof
+lib_LIBRARIES  = libsof.a
+
+libsof_a_SOURCES = $(SOF_SRC)
+
+libsof_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_src
+lib_LIBRARIES  += libsof_src.a
+
+libsof_src_a_SOURCES = $(SRC_SRC)
+
+libsof_src_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_eq_fir
+lib_LIBRARIES  += libsof_eq_fir.a
+
+libsof_eq_fir_a_SOURCES = $(EQ_FIR_SRC)
+
+libsof_eq_fir_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_eq_iir
+lib_LIBRARIES  += libsof_eq_iir.a
+
+libsof_eq_iir_a_SOURCES = $(EQ_IIR_SRC)
+
+libsof_eq_iir_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_volume
+lib_LIBRARIES  += libsof_volume.a
+
+libsof_volume_a_SOURCES = volume.c
+
+libsof_volume_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_mux
+lib_LIBRARIES  += libsof_mux.a
+
+libsof_mux_a_SOURCES = mux.c
+
+libsof_mux_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_switch
+lib_LIBRARIES  += libsof_switch.a
+
+libsof_switch_a_SOURCES = switch.c
+
+libsof_switch_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_mixer
+lib_LIBRARIES  += libsof_mixer.a
+
+libsof_mixer_a_SOURCES = mixer.c
+
+libsof_mixer_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_tone
+lib_LIBRARIES  += libsof_tone.a
+
+libsof_tone_a_SOURCES = tone.c
+
+libsof_tone_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+
+
+if HAVE_HIFI2EP
+# libsof
+lib_LIBRARIES  += libsof_hifi2ep.a
+
+libsof_hifi2ep_a_SOURCES = $(SOF_SRC)
+
+libsof_hifi2ep_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_src
+lib_LIBRARIES  += libsof_src_hifi2ep.a
+
+libsof_src_hifi2ep_a_SOURCES = $(SRC_SRC)
+
+libsof_src_hifi2ep_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_eq_fir
+lib_LIBRARIES  += libsof_eq_fir_hifi2ep.a
+
+libsof_eq_fir_hifi2ep_a_SOURCES = $(EQ_FIR_SRC)
+
+libsof_eq_fir_hifi2ep_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_eq_iir
+lib_LIBRARIES  += libsof_eq_iir_hifi2ep.a
+
+libsof_eq_iir_hifi2ep_a_SOURCES = $(EQ_IIR_SRC)
+
+libsof_eq_iir_hifi2ep_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_volume
+lib_LIBRARIES  += libsof_volume_hifi2ep.a
+
+libsof_volume_hifi2ep_a_SOURCES = volume.c
+
+libsof_volume_hifi2ep_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_mux
+lib_LIBRARIES  += libsof_mux_hifi2ep.a
+
+libsof_mux_hifi2ep_a_SOURCES = mux.c
+
+libsof_mux_hifi2ep_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_switch
+lib_LIBRARIES  += libsof_switch_hifi2ep.a
+
+libsof_switch_hifi2ep_a_SOURCES = switch.c
+
+libsof_switch_hifi2ep_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_mixer
+lib_LIBRARIES  += libsof_mixer_hifi2ep.a
+
+libsof_mixer_hifi2ep_a_SOURCES = mixer.c
+
+libsof_mixer_hifi2ep_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_tone
+lib_LIBRARIES  += libsof_tone_hifi2ep.a
+
+libsof_tone_hifi2ep_a_SOURCES = tone.c
+
+libsof_tone_hifi2ep_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+endif
+
+if HAVE_HIFI3
+# libsof
+lib_LIBRARIES  += libsof_hifi3.a
+
+libsof_hifi3_a_SOURCES = $(COMP_SRC)
+
+libsof_hifi3_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_src
+lib_LIBRARIES  += libsof_src_hifi3.a
+
+libsof_src_hifi3_a_SOURCES = $(SRC_SRC)
+
+libsof_src_hifi3_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_eq_fir
+lib_LIBRARIES  += libsof_eq_fir_hifi3.a
+
+libsof_eq_fir_hifi3_a_SOURCES = $(EQ_FIR_SRC)
+
+libsof_eq_fir_hifi3_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_eq_iir
+lib_LIBRARIES  += libsof_eq_iir_hifi3.a
+
+libsof_eq_iir_hifi3_a_SOURCES = $(EQ_IIR_SRC)
+
+libsof_eq_iir_hifi3_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_volume
+lib_LIBRARIES  += libsof_volume_hifi3.a
+
+libsof_volume_hifi3_a_SOURCES = volume.c
+
+libsof_volume_hifi3_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_mux
+lib_LIBRARIES  += libsof_mux_hifi3.a
+
+libsof_mux_hifi3_a_SOURCES = mux.c
+
+libsof_mux_hifi3_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_switch
+lib_LIBRARIES  += libsof_switch_hifi3.a
+
+libsof_switch_hifi3_a_SOURCES = switch.c
+
+libsof_switch_hifi3_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_mixer
+lib_LIBRARIES  += libsof_mixer_hifi3.a
+
+libsof_mixer_hifi3_a_SOURCES = mixer.c
+
+libsof_mixer_hifi3_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+
+# libsof_tone
+lib_LIBRARIES  += libsof_tone_hifi3.a
+
+libsof_tone_hifi3_a_SOURCES = tone.c
+
+libsof_tone_hifi3_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(SSE42_CFLAGS) \
+	$(COMMON_INCDIR)
+endif
+
+endif
+
+else
+
+# build for firmware image
+
 noinst_LIBRARIES = libaudio.a
 
 noinst_HEADERS = \
@@ -29,6 +1028,6 @@ libaudio_a_SOURCES = \
 
 libaudio_a_CFLAGS = \
 	$(ARCH_CFLAGS) \
-	$(REEF_INCDIR) \
-	$(ARCH_INCDIR) \
-	$(PLATFORM_INCDIR)
+	$(COMMON_INCDIR)
+
+endif
diff --git a/src/include/reef/Makefile.am b/src/include/reef/Makefile.am
index 3f90e90..31bd091 100644
--- a/src/include/reef/Makefile.am
+++ b/src/include/reef/Makefile.am
@@ -1,6 +1,8 @@
 SUBDIRS = audio math
 
-noinst_HEADERS = \
+includedir = $(prefix)/include/sof/reef
+
+include_HEADERS = \
 	alloc.h \
 	clock.h \
 	dai.h \
diff --git a/src/include/reef/audio/Makefile.am b/src/include/reef/audio/Makefile.am
index 60b7145..1d2b9cb 100644
--- a/src/include/reef/audio/Makefile.am
+++ b/src/include/reef/audio/Makefile.am
@@ -1,7 +1,9 @@
 SUBDIRS = coefficients
 
-noinst_HEADERS = \
+includedir = $(prefix)/include/sof/reef/audio
+
+include_HEADERS = \
 	component.h \
 	pipeline.h \
-	buffer.h \
-	format.h
+	format.h \
+	buffer.h
diff --git a/src/include/uapi/Makefile.am b/src/include/uapi/Makefile.am
index 103d692..f202eca 100644
--- a/src/include/uapi/Makefile.am
+++ b/src/include/uapi/Makefile.am
@@ -1,4 +1,4 @@
-includedir = $(prefix)/include/sof
+includedir = $(prefix)/include/sof/uapi
 
 include_HEADERS = \
 	ipc.h \
diff --git a/src/ipc/Makefile.am b/src/ipc/Makefile.am
index 7e63ca6..9878273 100644
--- a/src/ipc/Makefile.am
+++ b/src/ipc/Makefile.am
@@ -1,7 +1,22 @@
-noinst_LIBRARIES = libipc.a
+if BUILD_LIB
+lib_LTLIBRARIES  = libsof_ipc.la
+
+libsof_ipc_la_SOURCES = \
+	ipc.c
+
+libsof_ipc_la_LDFLAGS = \
+	-version-info $(VERSION) \
+	-no-undefined \
+	-export-dynamic
+
+libsof_ipc_la_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+else
+noinst_LIBRARIES = libsof_ipc.a
 
 if BUILD_BAYTRAIL
-libipc_a_SOURCES = \
+libsof_ipc_a_SOURCES = \
 	ipc.c \
 	intel-ipc.c \
 	byt-ipc.c \
@@ -10,7 +25,7 @@ libipc_a_SOURCES = \
 endif
 
 if BUILD_CHERRYTRAIL
-libipc_a_SOURCES = \
+libsof_ipc_a_SOURCES = \
 	ipc.c \
 	intel-ipc.c \
 	byt-ipc.c \
@@ -18,9 +33,8 @@ libipc_a_SOURCES = \
 	dma-copy.c
 endif
 
-libipc_a_CFLAGS = \
+libsof_ipc_a_CFLAGS = \
 	$(ARCH_CFLAGS) \
-	$(ARCH_INCDIR) \
-	$(REEF_INCDIR) \
-	$(PLATFORM_INCDIR)
+	$(COMMON_INCDIR)
+endif
 
diff --git a/src/library/include/platform/Makefile.am b/src/library/include/platform/Makefile.am
new file mode 100644
index 0000000..5a735ae
--- /dev/null
+++ b/src/library/include/platform/Makefile.am
@@ -0,0 +1,12 @@
+includedir = $(prefix)/include/sof/platform
+
+include_HEADERS = \
+	clk.h \
+	dma.h \
+	interrupt.h \
+	mailbox.h \
+	memory.h \
+	platform.h \
+	pmc.h \
+	shim.h \
+	timer.h
diff --git a/src/math/Makefile.am b/src/math/Makefile.am
index b795afa..6a48e29 100644
--- a/src/math/Makefile.am
+++ b/src/math/Makefile.am
@@ -1,11 +1,21 @@
-noinst_LIBRARIES = libmath.a
+if BUILD_LIB
+lib_LTLIBRARIES = libsof_math.la
 
-libmath_a_SOURCES = \
+libsof_math_la_SOURCES = \
 	trig.c \
 	numbers.c
 
-libmath_a_CFLAGS = \
+libsof_math_la_CFLAGS = \
 	$(ARCH_CFLAGS) \
-	$(REEF_INCDIR) \
-	$(ARCH_INCDIR) \
-	$(PLATFORM_INCDIR)
+	$(COMMON_INCDIR)
+else
+noinst_LIBRARIES = libsof_math.a
+
+libsof_math_a_SOURCES = \
+	trig.c \
+	numbers.c
+
+libsof_math_a_CFLAGS = \
+	$(ARCH_CFLAGS) \
+	$(COMMON_INCDIR)
+endif
-- 
2.11.0



More information about the Sound-open-firmware mailing list