xref: /illumos-gate/usr/src/test/bhyve-tests/tests/vmm/Makefile (revision 78a707fc31d439235af1e35322a24644770753e9)
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# Copyright 2022 Oxide Computer Company
13
14include $(SRC)/cmd/Makefile.cmd
15include $(SRC)/cmd/Makefile.cmd.64
16include $(SRC)/test/Makefile.com
17
18PROG =	mem_partial \
19	mem_seg_map \
20	mem_devmem \
21	fpu_getset \
22	interface_version \
23	check_iommu \
24	auto_destruct \
25	legacy_destruct \
26	self_destruct \
27	drv_hold \
28	cpuid_ioctl \
29	default_capabs \
30	datarw_constraints
31
32COMMON_OBJS =	common.o
33CLEAN_OBJS =	$(PROG:%=%.o)
34
35ROOTOPTPKG = $(ROOT)/opt/bhyve-tests
36TESTDIR = $(ROOTOPTPKG)/tests/vmm
37
38CMDS = $(PROG:%=$(TESTDIR)/%)
39$(CMDS) := FILEMODE = 0555
40
41CSTD=		$(CSTD_GNU99)
42CPPFLAGS =	-I$(COMPAT)/bhyve -I$(CONTRIB)/bhyve \
43		-I$(COMPAT)/bhyve/amd64 -I$(CONTRIB)/bhyve/amd64 \
44		$(CPPFLAGS.master) \
45		-I$(SRC)/uts/intel/io/vmm \
46		-I$(SRC)/uts/intel
47$(PROG) :=	LDLIBS += -lvmmapi
48
49all: $(PROG)
50
51install: all $(CMDS)
52
53clean:
54	-$(RM) $(CLEAN_OBJS) $(COMMON_OBJS)
55clobber: clean
56	-$(RM) $(PROG)
57
58$(PROG): $(COMMON_OBJS)
59
60$(CMDS): $(TESTDIR) $(PROG)
61
62$(TESTDIR):
63	$(INS.dir)
64
65$(TESTDIR)/%: %
66	$(INS.file)
67
68%: %.o
69	$(LINK.c) -o $@ $< $(COMMON_OBJS) $(LDLIBS)
70	$(POST_PROCESS)
71