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