xref: /titanic_52/usr/src/test/util-tests/tests/libsff/Makefile (revision 59596c01ca1b980a016d25670874f53e64c27ec0)
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) 2017, Joyent, Inc.
14#
15
16include $(SRC)/Makefile.master
17
18ROOTOPTPKG = $(ROOT)/opt/util-tests
19TESTDIR = $(ROOTOPTPKG)/tests/libsff
20
21DIFF_PROGS = \
22	libsff_8472 \
23	libsff_8636_diag \
24	libsff_8636_extspec \
25	libsff_8636_tech \
26	libsff_8636_temp \
27	libsff_br \
28	libsff_conn \
29	libsff_compliance \
30	libsff_enc \
31	libsff_ident \
32	libsff_lengths \
33	libsff_opts \
34	libsff_wave
35
36ERR_PROGS = \
37	libsff_efault \
38	libsff_einval
39
40PROGS = $(DIFF_PROGS) \
41	$(ERR_PROGS) \
42	libsff_strings
43
44SCRIPTS = libsff
45
46include $(SRC)/cmd/Makefile.cmd
47include $(SRC)/test/Makefile.com
48
49CMDS = $(PROGS:%=$(TESTDIR)/%) $(SCRIPTS:%=$(TESTDIR)/%)
50OUTFILES = $(DIFF_PROGS:%=$(TESTDIR)/%.out)
51$(CMDS) := FILEMODE = 0555
52$(OUTFILES) := FILEMODE = 0444
53
54CPPFLAGS += -I$(SRC)/lib/libsff/common
55
56#
57# Different tests require different sets of libraries. If we try and use
58# the same set, we'll get guidance errors from ld.
59#
60$(ERR_PROGS)	:= LDLIBS += -lsff
61$(DIFF_PROGS)	:= LDLIBS += -lsff -lnvpair
62libsff_strings	:= LDLIBS += -lsff -lnvpair
63
64all: $(PROGS)
65
66install: all $(CMDS) $(OUTFILES)
67
68lint: lint_SRCS
69
70clobber: clean
71	-$(RM) $(PROGS)
72
73clean:
74
75$(CMDS): $(TESTDIR) $(PROG)
76
77$(TESTDIR):
78	$(INS.dir)
79
80$(TESTDIR)/%: %
81	$(INS.file)
82
83$(TESTDIR)/%: %.ksh
84	$(INS.rename)
85
86%: %.c
87	$(LINK.c) -o $@ $< $(LDLIBS)
88	$(POST_PROCESS)
89