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_micron.o \ 27 nvmeadm_nsmgmt.o \ 28 nvmeadm_ocp.o \ 29 nvmeadm_ofmt.o \ 30 nvmeadm_phyeye.o \ 31 nvmeadm_print.o \ 32 nvmeadm_sandisk.o \ 33 nvmeadm_solidigm.o \ 34 nvmeadm_telemetry.o \ 35 nvmeadm_vuc.o \ 36 nvmeadm_wdc.o \ 37 bitext.o \ 38 $(HEXDUMP_OBJS) 39 40include ../Makefile.cmd 41include ../Makefile.cmd.64 42include ../Makefile.ctf 43include $(SRC)/common/hexdump/Makefile.com 44 45.KEEP_STATE: 46 47CPPFLAGS += -I$(SRC)/uts/common/io/nvme -I$(SRC)/common/nvme 48LDLIBS += -ldevinfo -lofmt -lcmdutils -lnvme 49LDLIBS += -L$(ROOT)/usr/lib/fm/64 -R/usr/lib/fm/64 -ltopo 50CSTD= $(CSTD_GNU99) 51CTF_MODE= link 52 53# 54# nvme_print_uint128() uses VLAs which understandably confuses smatch. 55# It should probably be rewritten so we can smatch the file. 56# 57nvmeadm_print.o := SMATCH=off 58 59all: $(PROG) 60 61$(PROG): $(OBJS) 62 $(LINK.c) -o $@ $(OBJS) $(LDLIBS) 63 $(POST_PROCESS) 64 65%.o: %.c 66 $(COMPILE.c) $< 67 $(POST_PROCESS_O) 68 69%.o: $(SRC)/common/nvme/%.c 70 $(COMPILE.c) $< 71 $(POST_PROCESS_O) 72 73%.o: $(SRC)/common/bitext/%.c 74 $(COMPILE.c) $< 75 $(POST_PROCESS_O) 76 77install: all $(ROOTUSRSBINPROG) 78 79clean: 80 $(RM) $(OBJS) $(PROG) 81 82lint: lint_SRCS 83 84include $(SRC)/common/hexdump/Makefile.targ 85include ../Makefile.targ 86