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