Files
s390-tools/zpcimon/Makefile
Niklas Schnelle e8550a4f8d opticsmon: zpcimon: Rename opticsmon to zpcimon
The opticsmon tool started out as a tool for monitoring the health of
optical modules in directly attached PCI NICs. In the future however it
will also monitor the health of other PCI devices. In particular in
a first step it will monitor the health of directly attached NVMe
devices.

To reflect this broadening of its scope rename opticsmon to zpcimon. Add
zpcimon.service and install it both under the new name and symlinked as
opticsmon.service for backwards compatibility. Since users are expected
to mostly just enable the service this keeps old instructions just
working.

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>
2026-07-24 18:21:50 +02:00

91 lines
2.1 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
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
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)
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
endif
ALL_CPPFLAGS += $(LIB_CFLAGS)
LDLIBS += $(LIB_LFLAGS)
BUILDTARGET += zpcimon
all: ${BUILDTARGET}
zpcimon: zpcimon.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