xref: /aosp_15_r20/external/rnnoise/Makefile.am (revision 1295d6828459cc82c3c29cc5d7d297215250a74b)
1ACLOCAL_AMFLAGS = -I m4
2
3AM_CFLAGS = -I$(top_srcdir)/include $(DEPS_CFLAGS)
4
5dist_doc_DATA = COPYING AUTHORS README
6
7include_HEADERS = include/rnnoise.h
8
9lib_LTLIBRARIES = librnnoise.la
10noinst_HEADERS = src/arch.h  \
11		 src/celt_lpc.h  \
12		 src/common.h  \
13		 src/_kiss_fft_guts.h  \
14		 src/kiss_fft.h  \
15		 src/opus_types.h  \
16		 src/pitch.h  \
17		 src/rnn_data.h  \
18		 src/rnn.h  \
19		 src/tansig_table.h
20
21librnnoise_la_SOURCES = \
22	src/denoise.c \
23	src/rnn.c \
24	src/rnn_data.c \
25	src/rnn_reader.c \
26	src/pitch.c \
27	src/kiss_fft.c \
28	src/celt_lpc.c
29
30librnnoise_la_LIBADD = $(DEPS_LIBS) $(lrintf_lib) $(LIBM)
31librnnoise_la_LDFLAGS = -no-undefined \
32 -version-info @OP_LT_CURRENT@:@OP_LT_REVISION@:@OP_LT_AGE@
33
34if OP_ENABLE_EXAMPLES
35noinst_PROGRAMS = examples/rnnoise_demo
36endif
37
38examples_rnnoise_demo_SOURCES = examples/rnnoise_demo.c
39examples_rnnoise_demo_LDADD = librnnoise.la
40
41pkgconfigdir = $(libdir)/pkgconfig
42pkgconfig_DATA = rnnoise.pc
43
44debug:
45	$(MAKE) CFLAGS="${CFLAGS} -O0 -ggdb -DOP_ENABLE_ASSERTIONS" all
46
47EXTRA_DIST = \
48 rnnoise.pc.in \
49 rnnoise-uninstalled.pc.in \
50 doc/Doxyfile.in \
51 doc/Makefile
52
53# Targets to build and install just the library without the docs
54librnnoise install-librnnoise: NO_DOXYGEN = 1
55
56rnnoise: all
57install-rnnoise: install
58
59# Or just the docs
60docs: doc/doxygen-build.stamp
61
62install-docs:
63	@if [ -z "$(NO_DOXYGEN)" ]; then \
64	  ( cd doc && \
65	    echo "Installing documentation in $(DESTDIR)$(docdir)"; \
66	    $(INSTALL) -d $(DESTDIR)$(docdir)/html/search; \
67	    for f in `find html -type f \! -name "installdox"` ; do \
68	      $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$f;     \
69	    done ) \
70	fi
71
72doc/doxygen-build.stamp: doc/Doxyfile \
73                         $(top_srcdir)/include/*.h
74	@[ -n "$(NO_DOXYGEN)" ] || ( cd doc && doxygen && touch $(@F) )
75
76
77if HAVE_DOXYGEN
78
79# Or everything (by default)
80all-local: docs
81
82install-data-local: install-docs
83
84clean-local:
85	$(RM) -r doc/html
86	$(RM) -r doc/latex
87	$(RM) doc/doxygen-build.stamp
88
89uninstall-local:
90	$(RM) -r $(DESTDIR)$(docdir)/html
91
92endif
93
94# We check this every time make is run, with configure.ac being touched to
95# trigger an update of the build system files if update_version changes the
96# current PACKAGE_VERSION (or if package_version was modified manually by a
97# user with either AUTO_UPDATE=no or no update_version script present - the
98# latter being the normal case for tarball releases).
99#
100# We can't just add the package_version file to CONFIGURE_DEPENDENCIES since
101# simply running autoconf will not actually regenerate configure for us when
102# the content of that file changes (due to autoconf dependency checking not
103# knowing about that without us creating yet another file for it to include).
104#
105# The MAKECMDGOALS check is a gnu-make'ism, but will degrade 'gracefully' for
106# makes that don't support it.  The only loss of functionality is not forcing
107# an update of package_version for `make dist` if AUTO_UPDATE=no, but that is
108# unlikely to be a real problem for any real user.
109$(top_srcdir)/configure.ac: force
110	@case "$(MAKECMDGOALS)" in \
111	    dist-hook)                             exit 0       ;; \
112	    dist-* | dist | distcheck | distclean) _arg=release ;; \
113	esac; \
114	if ! $(top_srcdir)/update_version $$_arg 2> /dev/null; then \
115	    if [ ! -e $(top_srcdir)/package_version ]; then \
116		echo 'PACKAGE_VERSION="unknown"' > $(top_srcdir)/package_version; \
117	    fi; \
118	    . $(top_srcdir)/package_version || exit 1; \
119	    [ "$(PACKAGE_VERSION)" != "$$PACKAGE_VERSION" ] || exit 0; \
120	fi; \
121	touch $@
122
123force:
124
125# Create a minimal package_version file when make dist is run.
126dist-hook:
127	echo 'PACKAGE_VERSION="$(PACKAGE_VERSION)"' > $(top_distdir)/package_version
128
129
130.PHONY: rnnoise install-rnnoise docs install-docs
131