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) 2012 by Delphix. All rights reserved.
14# Copyright 2017 Gordon W. Ross
15# Copyright (c) 2018, Joyent, Inc.
16# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
17# Copyright 2020 Tintri by DDN, Inc. All rights reserved.
18#
19
20include $(SRC)/cmd/Makefile.cmd
21include $(SRC)/test/Makefile.com
22
23PROG =	ksid.32 ksid.64
24
25LDLIBS += -lfakekernel
26LDLIBS64 += -lfakekernel
27
28CSTD = $(CSTD_GNU99)
29CPPFLAGS.first += -I$(SRC)/lib/libfakekernel/common -D_FAKE_KERNEL
30
31ROOTOPTPKG = $(ROOT)/opt/os-tests
32TESTDIR = $(ROOTOPTPKG)/tests/ksid
33
34CMDS = $(PROG:%=$(TESTDIR)/%)
35$(CMDS) := FILEMODE = 0555
36
37all: $(PROG)
38
39install: $(CMDS)
40
41clobber: clean
42	-$(RM) $(PROG)
43
44clean:
45
46$(CMDS): $(TESTDIR) $(PROG)
47
48$(TESTDIR):
49	$(INS.dir)
50
51$(TESTDIR)/%: %
52	$(INS.file)
53
54%.64: %.c
55	$(LINK64.c) -o $@ $< $(LDLIBS64)
56	$(POST_PROCESS)
57
58%.32: %.c
59	$(LINK.c) -o $@ $< $(LDLIBS)
60	$(POST_PROCESS)
61