mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
Add a new monitor which uses libnvme to collect SMART data from NVMes. This monitor only implements the .collect_adapter_data operation since it carries no state across data collections. Nevertheless for future symmetry and possible future expansion also add an empty struct nvmemon_ctx. Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
111 lines
2.5 KiB
Makefile
111 lines
2.5 KiB
Makefile
include ../common.mak
|
|
|
|
TESTS := tests/
|
|
|
|
zsh-completions = _zpcimon
|
|
bash-completions = zpcimon.bash
|
|
|
|
include ../common_autocomp.mak
|
|
|
|
libs =$(rootdir)/libzpci/libzpci.a $(rootdir)/libutil/libutil.a
|
|
|
|
ifneq (${HAVE_OPENSSL},0)
|
|
check_dep_openssl:
|
|
$(call check_dep, \
|
|
"zpcimon", \
|
|
"openssl/evp.h", \
|
|
"openssl-devel", \
|
|
"HAVE_OPENSSL=0")
|
|
BUILDTARGET += check_dep_openssl
|
|
endif # HAVE_OPENSSL
|
|
|
|
ifneq (${HAVE_LIBNL3},0)
|
|
check_dep_libnl3:
|
|
$(call check_dep, \
|
|
"zpcimon", \
|
|
"netlink/socket.h", \
|
|
"libnl3-devel", \
|
|
"HAVE_LIBNL3=0")
|
|
BUILDTARGET += check_dep_libnl3
|
|
endif # HAVE_LIBNL3
|
|
|
|
ifneq (${HAVE_LIBNVME},0)
|
|
check_dep_libnvme:
|
|
$(call check_dep, \
|
|
"zpcimon", \
|
|
"libnvme.h", \
|
|
"libnvme-devel", \
|
|
"HAVE_LIBNVME=0")
|
|
BUILDTARGET += check_dep_libnvme
|
|
endif # HAVE_LIBNVME
|
|
|
|
ifeq (${HAVE_OPENSSL},0)
|
|
|
|
all:
|
|
$(SKIP) HAVE_OPENSSL=0
|
|
|
|
install:
|
|
$(SKIP) HAVE_OPENSSL=0
|
|
|
|
else ifeq (${HAVE_LIBNL3},0)
|
|
all:
|
|
$(SKIP) HAVE_LIBNL3=0
|
|
|
|
install:
|
|
$(SKIP) HAVE_LIBNL3=0
|
|
|
|
else ifeq (${HAVE_LIBNVME},0)
|
|
all:
|
|
$(SKIP) HAVE_LIBNVME=0
|
|
|
|
install:
|
|
$(SKIP) HAVE_LIBNVME=0
|
|
|
|
else
|
|
|
|
ifneq ($(shell sh -c 'command -v pkg-config'),)
|
|
LIB_CFLAGS += $(shell $(PKG_CONFIG) --silence-errors --cflags libnl-3.0)
|
|
LIB_CFLAGS += $(shell $(PKG_CONFIG) --silence-errors --cflags libnl-genl-3.0)
|
|
LIB_CFLAGS += $(shell $(PKG_CONFIG) --silence-errors --cflags libnl-route-3.0)
|
|
|
|
LIB_CFLAGS += $(shell $(PKG_CONFIG) --silence-errors --cflags libcrypto)
|
|
|
|
LIB_LFLAGS += $(shell $(PKG_CONFIG) --silence-errors --libs libnl-3.0)
|
|
LIB_LFLAGS += $(shell $(PKG_CONFIG) --silence-errors --libs libnl-genl-3.0)
|
|
LIB_LFLAGS += $(shell $(PKG_CONFIG) --silence-errors --libs libnl-route-3.0)
|
|
|
|
LIB_LFLAGS += $(shell $(PKG_CONFIG) --silence-errors --libs libcrypto)
|
|
LIB_LFLAGS += $(shell $(PKG_CONFIG) --silence-errors --libs libnvme)
|
|
else
|
|
LIB_CFLAGS += -I /usr/include/libnl3/
|
|
LIB_LFLAGS += -lnl-route-3 -lnl-genl-3 -lnl-3
|
|
|
|
LIB_CFLAGS += -I /usr/include/openssl/
|
|
LIB_LFLAGS += -lcrypto
|
|
|
|
LIB_LFLAGS += -lnvme
|
|
endif
|
|
|
|
ALL_CPPFLAGS += $(LIB_CFLAGS)
|
|
LDLIBS += $(LIB_LFLAGS)
|
|
|
|
BUILDTARGET += zpcimon
|
|
|
|
all: ${BUILDTARGET}
|
|
|
|
zpcimon: zpcimon.o nvmemon.o opticsmon.o optics_info.o optics_sclp.o ethtool.o link_mon.o $(libs)
|
|
|
|
install: all
|
|
$(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man8
|
|
$(INSTALL) -g $(GROUP) -o $(OWNER) -m 755 zpcimon $(DESTDIR)$(BINDIR)
|
|
$(INSTALL) -g $(GROUP) -o $(OWNER) -m 644 zpcimon.8 \
|
|
$(DESTDIR)$(MANDIR)/man8
|
|
ln -sf zpcimon $(DESTDIR)$(BINDIR)/opticsmon
|
|
ln -sf zpcimon.8 $(DESTDIR)$(MANDIR)/man8/opticsmon.8
|
|
endif # HAVE_OPENSSL3=0 or HAVE_LIBNL3=0
|
|
|
|
clean:
|
|
rm -f *.o *~ zpcimon core
|
|
|
|
.PHONY: all install clean
|