xref: /freebsd/sys/contrib/openzfs/lib/Makefile.am (revision cc68614da8232d8baaca0ae0d0dd8f890f06623e)
1#
2# Shown below is a simplified dependency graph of the OpenZFS provided
3# libraries.  Administrative commands (`zfs`, `zpool`, etc) interface with
4# the kernel modules using the `libzfs.so` and `libzfs_core.so` libraries.
5# These libraries provide a stable ABI across OpenZFS point releases.
6#
7# The `libzpool.so` library is a user space build of the DMU and SPA layers
8# used to implement debugging tools (zdb) and code validation tools (ztest).
9# These library interfaces are subject to change at any time.
10#
11#
12# CMDS:   zhack/ztest/zdb/            zfs/zpool/zed/
13#        raidz_{test,bench}          zinject/zstream
14#                |                          |
15# LIBS:          |                          |              libzfsbootenv*
16#                |                          |                    |
17#                |                          |                    |
18#             libzpool                   libzfs* ----------------+
19#             | | |  \                  / | | |
20#    libicp --/ | |   \                /  | | \------- libshare
21#               | |    \              /   | |
22#    libzstd ---/ |     \            /    | \--------- libuutil
23#                 |      \          /     \              | |
24#    libunicode --/       \        /       \             | |
25#                          \      /         \            | |
26#                          libzutil        libzfs_core*  | |
27#                          | | | | \          |     |    | |
28#                          | | | | |          |     |    | |
29#                          | | | | |          |     |    | |
30#    libtpool -------------/ | | | \---- libnvpair* |    | |
31#                            | | |                  |    | |
32#    libefi -----------------/ | \------ libavl* --------/ |
33#                              |                    |      |
34#                              \-------- libspl ----+------/
35#
36# * - A stable ABI is provided for these libraries
37#
38#
39# NB: GNU Automake Manual, Chapter 8.3.5: Libtool Convenience Libraries
40# These nine libraries are intermediary build components.
41#
42SUBDIRS = libavl libicp libshare libspl libtpool libzstd
43CPPCHECKDIRS  = libavl libicp libnvpair libshare libspl libtpool libunicode
44CPPCHECKDIRS += libuutil libzfs libzfs_core libzfsbootenv libzpool libzutil
45
46if BUILD_LINUX
47SUBDIRS += libefi
48CPPCHECKDIRS += libefi
49endif
50
51# libnvpair is installed as part of the final build product
52# libzutil depends on it, so it must be compiled before libzutil
53SUBDIRS += libnvpair
54
55# libzutil depends on libefi if present
56SUBDIRS += libzutil libunicode
57
58# These five libraries, which are installed as the final build product,
59# incorporate the eight convenience libraries given above.
60DISTLIBS = libuutil libzfs_core libzfs libzpool libzfsbootenv
61SUBDIRS += $(DISTLIBS)
62DISTLIBS += libnvpair
63
64# An ABI is stored for each of these libraries.  Note that libzpool.so
65# is only linked against by ztest and zdb and no stable ABI is provided.
66ABILIBS = libnvpair libuutil libzfs_core libzfs libzfsbootenv
67
68PHONY = checkabi storeabi cppcheck
69checkabi: $(ABILIBS)
70	set -e ; for dir in $(ABILIBS) ; do \
71		$(MAKE) -C $$dir checkabi ; \
72	done
73
74storeabi: $(ABILIBS)
75	set -e ; for dir in $(ABILIBS) ; do \
76		$(MAKE) -C $$dir storeabi ; \
77	done
78
79cppcheck: $(CPPCHECKDIRS)
80	set -e ; for dir in $(CPPCHECKDIRS) ; do \
81		$(MAKE) -C $$dir cppcheck ; \
82	done
83