xref: /illumos-gate/usr/src/cmd/nvmeadm/Makefile (revision 564eeb7d65973f1d64a5390ff477b689707e9daf)
1#
2# This file and its contents are supplied under the terms of the
3# Common Development and Distribution License ("CDDL"), version 1.0.
4# You may only use this file in accordance with the terms of version
5# 1.0 of the CDDL.
6#
7# A full copy of the text of the CDDL should have accompanied this
8# source.  A copy of the CDDL is also available via the Internet at
9# http://www.illumos.org/license/CDDL.
10#
11
12#
13# Copyright (c) 2018, Joyent, Inc.
14# Copyright 2026 Oxide Computer Company
15# Copyright 2022 Tintri by DDN, Inc. All rights reserved.
16#
17
18
19PROG= nvmeadm
20
21OBJS=	nvme_version.o	\
22	nvmeadm.o	\
23	nvmeadm_extsmart.o \
24	nvmeadm_field.o \
25	nvmeadm_field_suplog.o \
26	nvmeadm_inject.o \
27	nvmeadm_micron.o \
28	nvmeadm_nsmgmt.o \
29	nvmeadm_ocp.o \
30	nvmeadm_ofmt.o	\
31	nvmeadm_phyeye.o \
32	nvmeadm_print.o	\
33	nvmeadm_sandisk.o \
34	nvmeadm_solidigm.o \
35	nvmeadm_telemetry.o \
36	nvmeadm_vuc.o \
37	nvmeadm_wdc.o	\
38	bitext.o \
39	$(HEXDUMP_OBJS)
40
41include ../Makefile.cmd
42include ../Makefile.cmd.64
43include ../Makefile.ctf
44include $(SRC)/common/hexdump/Makefile.com
45
46.KEEP_STATE:
47
48CPPFLAGS +=	-I$(SRC)/uts/common/io/nvme -I$(SRC)/common/nvme
49LDLIBS +=	-ldevinfo -lofmt -lcmdutils -lnvme
50LDLIBS +=	-L$(ROOT)/usr/lib/fm/64 -R/usr/lib/fm/64 -ltopo
51CSTD=	$(CSTD_GNU99)
52CTF_MODE= link
53
54#
55# nvme_print_uint128() uses VLAs which understandably confuses smatch.
56# It should probably be rewritten so we can smatch the file.
57#
58nvmeadm_print.o := SMATCH=off
59
60all: $(PROG)
61
62$(PROG): $(OBJS)
63	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
64	$(POST_PROCESS)
65
66%.o: %.c
67	$(COMPILE.c) $<
68	$(POST_PROCESS_O)
69
70%.o: $(SRC)/common/nvme/%.c
71	$(COMPILE.c) $<
72	$(POST_PROCESS_O)
73
74%.o: $(SRC)/common/bitext/%.c
75	$(COMPILE.c) $<
76	$(POST_PROCESS_O)
77
78install: all $(ROOTUSRSBINPROG)
79
80clean:
81	$(RM) $(OBJS) $(PROG)
82
83lint:	lint_SRCS
84
85include $(SRC)/common/hexdump/Makefile.targ
86include ../Makefile.targ
87