+# SPDX-License-Identifier: LGPL-2.1-only
+
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = libust tests libmallocwrap ustd ustctl libinterfork include
-EXTRA_DIST = doc libust.ldscript.in libust-initializer.c
-dist_bin_SCRIPTS = usttrace
+SUBDIRS = . include snprintf libringbuffer liblttng-ust-comm \
+ libcounter \
+ libmsgpack \
+ liblttng-ust \
+ liblttng-ust-ctl \
+ liblttng-ust-fd \
+ liblttng-ust-fork \
+ liblttng-ust-libc-wrapper \
+ liblttng-ust-cyg-profile \
+ tools
+
+if HAVE_DLINFO
+SUBDIRS += liblttng-ust-dl
+endif
+
+if BUILD_JNI_INTERFACE
+SUBDIRS += liblttng-ust-java
+endif
+
+if BUILD_JAVA_AGENT
+SUBDIRS += liblttng-ust-java-agent
+endif
+
+if BUILD_PYTHON_AGENT
+SUBDIRS += python-lttngust \
+ liblttng-ust-python-agent
+endif
+
+SUBDIRS += tests doc
+
+#temporarily disabled
+# liblttng-ust-malloc
-ldscriptsdir = $(libdir)
-ldscripts_DATA = libust.so libust-initializer.o
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = lttng-ust.pc lttng-ust-ctl.pc
-CLEANFILES = $(ldscripts_DATA)
+dist_doc_DATA = \
+ ChangeLog \
+ LICENSE \
+ README.md
-libust_FORMAT := $(shell case $(shell uname -m) in (i*86) echo elf32-i386 ;; (x86_64) echo elf64-x86-64 ;; (ppc) echo elf32-powerpc ;; (ppc64) echo elf64-powerpc ;; (s390) echo elf32-s390 ;; (s390x) echo elf64-s390 ;; esac)
-libust.so: libust.ldscript.in
- $(SED) -e "s@\@FORMAT\@@${libust_FORMAT}@" -e "s@\@PATH\@@${libdir}@g" < $< > $@
+dist_noinst_DATA = \
+ CodingStyle \
+ CONTRIBUTING.md \
+ LICENSES/BSD-2-Clause \
+ LICENSES/BSD-3-Clause \
+ LICENSES/GPL-2.0 \
+ LICENSES/GPL-3.0 \
+ LICENSES/LGPL-2.1 \
+ LICENSES/MIT
-libust-initializer.o: libust-initializer.c
- $(CC) $(CFLAGS) -c -I$(top_builddir)/include -o $@ $<
+check-loop:
+ cd tests && $(MAKE) $(AM_MAKEFLAGS) check-loop
+.PHONY: check-loop