xref: /illumos-gate/usr/src/test/bhyve-tests/tests/vmm/Makefile (revision 549ab26f262a63e8892b99d530a98fea6423ad63)
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	pause_resume
32
33COMMON_OBJS =	common.o
34CLEAN_OBJS =	$(PROG:%=%.o)
35
36ROOTOPTPKG = $(ROOT)/opt/bhyve-tests
37TESTDIR = $(ROOTOPTPKG)/tests/vmm
38
39CMDS = $(PROG:%=$(TESTDIR)/%)
40$(CMDS) := FILEMODE = 0555
41
42CSTD=		$(CSTD_GNU99)
43CPPFLAGS =	-I$(COMPAT)/bhyve -I$(CONTRIB)/bhyve \
44		-I$(COMPAT)/bhyve/amd64 -I$(CONTRIB)/bhyve/amd64 \
45		$(CPPFLAGS.master) \
46		-I$(SRC)/uts/intel/io/vmm \
47		-I$(SRC)/uts/intel
48$(PROG) :=	LDLIBS += -lvmmapi
49
50all: $(PROG)
51
52install: all $(CMDS)
53
54clean:
55	-$(RM) $(CLEAN_OBJS) $(COMMON_OBJS)
56clobber: clean
57	-$(RM) $(PROG)
58
59$(PROG): $(COMMON_OBJS)
60
61$(CMDS): $(TESTDIR) $(PROG)
62
63$(TESTDIR):
64	$(INS.dir)
65
66$(TESTDIR)/%: %
67	$(INS.file)
68
69%: %.o
70	$(LINK.c) -o $@ $< $(COMMON_OBJS) $(LDLIBS)
71	$(POST_PROCESS)
72