summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile33
1 files changed, 25 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 9db121c..86eb7c6 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,7 @@ override CPPFLAGS += -D_GNU_SOURCE -D__CHECK_ENDIAN__
LIBUUID = $(shell $(LD) -o /dev/null -luuid >/dev/null 2>&1; echo $$?)
LIBHUGETLBFS = $(shell $(LD) -o /dev/null -lhugetlbfs >/dev/null 2>&1; echo $$?)
HAVE_SYSTEMD = $(shell pkg-config --exists libsystemd --atleast-version=242; echo $$?)
+LIBJSONC = $(shell $(LD) -o /dev/null -ljson-c >/dev/null 2>&1; echo $$?)
NVME = nvme
INSTALL ?= install
DESTDIR =
@@ -37,6 +38,11 @@ ifeq ($(HAVE_SYSTEMD),0)
override CFLAGS += -DHAVE_SYSTEMD
endif
+ifeq ($(LIBJSONC), 0)
+ override LDFLAGS += -ljson-c
+ override CFLAGS += -DLIBJSONC
+endif
+
RPMBUILD = rpmbuild
TAR = tar
RM = rm -f
@@ -58,14 +64,19 @@ override CFLAGS += -DNVME_VERSION='"$(NVME_VERSION)"'
NVME_DPKG_VERSION=1~`lsb_release -sc`
-OBJS := nvme-print.o nvme-ioctl.o \
+OBJS := nvme-print.o nvme-ioctl.o nvme-rpmb.o \
nvme-lightnvm.o fabrics.o nvme-models.o plugin.o \
nvme-status.o nvme-filters.o nvme-topology.o
-UTIL_OBJS := util/argconfig.o util/suffix.o util/json.o util/parser.o
+UTIL_OBJS := util/argconfig.o util/suffix.o util/parser.o \
+ util/cleanup.o util/log.o
+ifneq ($(LIBJSONC), 0)
+override UTIL_OBJS += util/json.o
+endif
PLUGIN_OBJS := \
plugins/intel/intel-nvme.o \
+ plugins/amzn/amzn-nvme.o \
plugins/lnvm/lnvm-nvme.o \
plugins/memblaze/memblaze-nvme.o \
plugins/wdc/wdc-nvme.o \
@@ -77,15 +88,18 @@ PLUGIN_OBJS := \
plugins/seagate/seagate-nvme.o \
plugins/virtium/virtium-nvme.o \
plugins/shannon/shannon-nvme.o \
- plugins/dera/dera-nvme.o \
- plugins/scaleflux/sfx-nvme.o \
- plugins/transcend/transcend-nvme.o
+ plugins/dera/dera-nvme.o \
+ plugins/scaleflux/sfx-nvme.o \
+ plugins/transcend/transcend-nvme.o \
+ plugins/zns/zns.o \
+ plugins/nvidia/nvidia-nvme.o \
+ plugins/ymtc/ymtc-nvme.o
nvme: nvme.c nvme.h $(OBJS) $(PLUGIN_OBJS) $(UTIL_OBJS) NVME-VERSION-FILE
$(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) $(INC) $< -o $(NVME) $(OBJS) $(PLUGIN_OBJS) $(UTIL_OBJS) $(LDFLAGS)
-verify-no-dep: nvme.c nvme.h $(OBJS) NVME-VERSION-FILE
- $(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) $< -o $@ $(OBJS) $(LDFLAGS)
+verify-no-dep: nvme.c nvme.h $(OBJS) $(UTIL_OBJS) NVME-VERSION-FILE
+ $(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) $(INC) $< -o $@ $(OBJS) $(UTIL_OBJS) $(LDFLAGS)
nvme.o: nvme.c nvme.h nvme-print.h nvme-ioctl.h util/argconfig.h util/suffix.h nvme-lightnvm.h fabrics.h
$(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) $(INC) -c $<
@@ -229,7 +243,10 @@ deb-light: $(NVME) pkg nvme.control.in
dpkg-deb --build nvme-$(NVME_VERSION)
rpm: dist
- $(RPMBUILD) --define '_libdir ${LIBDIR}' -ta nvme-$(NVME_VERSION).tar.gz
+ $(RPMBUILD) --define '_prefix $(DESTDIR)$(PREFIX)' \
+ --define '_libdir $(DESTDIR)${LIBDIR}' \
+ --define '_sysconfdir $(DESTDIR)$(SYSCONFDIR)' \
+ -ta nvme-$(NVME_VERSION).tar.gz
.PHONY: default doc all clean clobber install-man install-bin install
.PHONY: dist pkg dist-orig deb deb-light rpm FORCE test