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