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