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 2023 Oxide Computer Company
15#
16
17include $(SRC)/Makefile.master
18
19ROOTOPTPKG = $(ROOT)/opt/util-tests
20TESTDIR = $(ROOTOPTPKG)/tests/
21
22PROGS = libjedec_test libjedec_temp libjedec_spd
23
24LINTS = $(PROGS:%=%.ln)
25
26include $(SRC)/cmd/Makefile.cmd
27include $(SRC)/test/Makefile.com
28
29CMDS = $(PROGS:%=$(TESTDIR)/%)
30$(CMDS) := FILEMODE = 0555
31
32LDLIBS += -ljedec
33libjedec_spd	:= LDLIBS += -lnvpair
34CSTD = $(GNU_C99)
35
36all: $(PROGS)
37
38install: all $(CMDS) $(OUTFILES)
39
40lint:
41
42clobber: clean
43	-$(RM) $(PROGS) $(LINTS)
44
45clean:
46
47$(CMDS): $(TESTDIR) $(PROG)
48
49$(TESTDIR):
50	$(INS.dir)
51
52$(TESTDIR)/%: %
53	$(INS.file)
54
55%: %.c
56	$(LINK.c) -o $@ $< $(LDLIBS)
57	$(POST_PROCESS)
58