2 # Copyright (C) 2003 Christophe Varoqui, <christophe.varoqui@opensvc.com>
14 ifneq ($(ENABLE_LIBDMMP),0)
19 BUILDDIRS := $(LIB_BUILDDIRS) \
20 libmultipath/prioritizers \
21 libmultipath/checkers \
22 libmultipath/foreign \
29 BUILDDIRS.clean := $(BUILDDIRS:=.clean) tests.clean
35 config.mk libmultipath/autoconfig.h:
36 @$(MAKE) -f create-config.mk
38 @echo ==== config.mk ====
40 @echo ==== autoconfig.h ====
41 @cat libmultipath/autoconfig.h
44 $(BUILDDIRS): config.mk
47 $(LIB_BUILDDIRS:=.abi): $(LIB_BUILDDIRS)
48 @$(MAKE) -C ${@:.abi=} abi
50 # Create formal representation of the ABI
51 # Useful for verifying ABI compatibility
52 # Requires abidw from the abigail suite (https://sourceware.org/libabigail/)
54 abi: $(LIB_BUILDDIRS:=.abi)
57 $(Q)ln -ft $@ $(LIB_BUILDDIRS:=/*.abi)
62 # Check the ABI against a reference.
63 # This requires the ABI from a previous run to be present
64 # in the directory "reference-abi"
65 # Requires abidiff from the abigail suite
66 abi-test: abi reference-abi $(wildcard abi/*.abi)
68 for lib in abi/*.abi; do \
69 diff=$$(abidiff --redundant "reference-$$lib" "$$lib") || { \
71 echo "==== ABI differences in for $$lib ===="; \
75 if [ $$err -eq 0 ]; then \
76 echo "*** OK, ABI unchanged ***"; \
78 echo "*** WARNING: ABI has changed, see file $@ ***"; \
82 # Create compile_commands.json, useful for using clangd with an IDE
83 # Requires bear (https://github.com/rizsotto/Bear)
84 compile_commands.json: Makefile Makefile.inc $(BUILDDIRS:=/Makefile)
88 libmpathutil libdmmp: libmpathcmd
89 libmultipath: libmpathutil
90 libmpathpersist libmpathvalid multipath multipathd: libmultipath
91 libmultipath/prioritizers libmultipath/checkers libmultipath/foreign: libmultipath
92 mpathpersist multipathd: libmpathpersist
94 libmultipath/checkers.install \
95 libmultipath/prioritizers.install \
96 libmultipath/foreign.install: libmultipath.install
99 @$(MAKE) -C ${@:.clean=} clean
102 @$(MAKE) -C ${@:.install=} install
104 $(BUILDDIRS:=.uninstall):
105 @$(MAKE) -C ${@:.uninstall=} uninstall
107 # If config.mk is missing, "make clean" in subdir either fails, or tries to
108 # build it. Both is undesirable. Avoid it by creating config.mk temporarily.
111 $(Q)$(MAKE) $(BUILDDIRS:=.clean) tests.clean || true
112 $(Q)$(RM) -r abi abi.tar.gz abi-test compile_commands.json config.mk
114 install: $(BUILDDIRS:=.install)
115 uninstall: $(BUILDDIRS:=.uninstall)
118 @$(MAKE) -C tests progs
121 @$(MAKE) -C tests all
124 @$(MAKE) -C tests valgrind
128 @etags -a libmultipath/*.c
129 @etags -a libmultipath/*.h
130 @etags -a multipathd/*.c
131 @etags -a multipathd/*.h