xref: /illumos-gate/usr/src/cmd/nvmeadm/Makefile (revision 6446bd46ed1b4e9f69da153665f82181ccaedad5)
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 2015 Nexenta Systems, Inc.
14# Copyright (c) 2018, Joyent, Inc.
15# Copyright 2021 Oxide Computer Company
16#
17
18
19PROG= nvmeadm
20
21OBJS= nvmeadm.o nvmeadm_dev.o nvmeadm_ofmt.o nvmeadm_print.o
22SRCS= $(OBJS:%.o=%.c)
23
24include ../Makefile.cmd
25include ../Makefile.ctf
26
27.KEEP_STATE:
28
29CFLAGS +=	$(CCVERBOSE) -I$(SRC)/uts/common/io/nvme
30LDLIBS +=	-ldevinfo -lofmt
31CSTD=	$(CSTD_GNU99)
32
33#
34# nvme_print_uint128() uses VLAs which understandably confuses smatch.
35# It should probably be rewritten so we can smatch the file.
36#
37nvmeadm_print.o := SMATCH=off
38
39all: $(PROG)
40
41$(PROG): $(OBJS)
42	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
43	$(POST_PROCESS)
44
45%.o: %.c
46	$(COMPILE.c) $<
47	$(POST_PROCESS_O)
48
49install: all $(ROOTUSRSBINPROG)
50
51clean:
52	$(RM) $(OBJS) $(PROG)
53
54lint:	lint_SRCS
55
56include ../Makefile.targ
57