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 2025 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_nsmgmt.o \ 24 nvmeadm_ofmt.o \ 25 nvmeadm_print.o \ 26 nvmeadm_telemetry.o \ 27 nvmeadm_wdc.o \ 28 $(HEXDUMP_OBJS) 29 30include ../Makefile.cmd 31include ../Makefile.cmd.64 32include ../Makefile.ctf 33include $(SRC)/common/hexdump/Makefile.com 34 35.KEEP_STATE: 36 37CPPFLAGS += -I$(SRC)/uts/common/io/nvme -I$(SRC)/common/nvme 38LDLIBS += -ldevinfo -lofmt -lcmdutils -lnvme 39CSTD= $(CSTD_GNU99) 40CTF_MODE= link 41 42# 43# nvme_print_uint128() uses VLAs which understandably confuses smatch. 44# It should probably be rewritten so we can smatch the file. 45# 46nvmeadm_print.o := SMATCH=off 47 48all: $(PROG) 49 50$(PROG): $(OBJS) 51 $(LINK.c) -o $@ $(OBJS) $(LDLIBS) 52 $(POST_PROCESS) 53 54%.o: %.c 55 $(COMPILE.c) $< 56 $(POST_PROCESS_O) 57 58%.o: $(SRC)/common/nvme/%.c 59 $(COMPILE.c) $< 60 $(POST_PROCESS_O) 61 62install: all $(ROOTUSRSBINPROG) 63 64clean: 65 $(RM) $(OBJS) $(PROG) 66 67lint: lint_SRCS 68 69include $(SRC)/common/hexdump/Makefile.targ 70include ../Makefile.targ 71