xref: /illumos-gate/usr/src/test/bhyve-tests/tests/vmm/Makefile (revision 6e8a136ffaf56dd81447d589e81f22fc1a8cd773)
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_high \
21	mem_devmem \
22	fpu_getset \
23	interface_version \
24	check_iommu \
25	auto_destruct \
26	legacy_destruct \
27	self_destruct \
28	drv_hold \
29	cpuid_ioctl \
30	default_capabs \
31	datarw_constraints \
32	datarw_msrs \
33	datarw_vcpu \
34	pause_resume \
35	import_vlapic \
36	time_data \
37	maxcpu \
38	npt_ops
39
40COMMON_OBJS =	common.o
41CLEAN_OBJS =	$(PROG:%=%.o)
42
43ROOTOPTPKG = $(ROOT)/opt/bhyve-tests
44TESTDIR = $(ROOTOPTPKG)/tests/vmm
45
46CMDS = $(PROG:%=$(TESTDIR)/%)
47$(CMDS) := FILEMODE = 0555
48
49CSTD=		$(CSTD_GNU99)
50CPPFLAGS =	-I$(COMPAT)/bhyve -I$(CONTRIB)/bhyve \
51		-I$(COMPAT)/bhyve/amd64 -I$(CONTRIB)/bhyve/amd64 \
52		$(CPPFLAGS.master) \
53		-I$(SRC)/uts/intel/io/vmm \
54		-I$(SRC)/uts/intel \
55		-I../common
56$(PROG) :=	LDLIBS += -lvmmapi
57
58all: $(PROG)
59
60install: all $(CMDS)
61
62clean:
63	-$(RM) $(CLEAN_OBJS) $(COMMON_OBJS)
64clobber: clean
65	-$(RM) $(PROG)
66
67$(PROG): $(COMMON_OBJS)
68
69$(CMDS): $(TESTDIR) $(PROG)
70
71$(TESTDIR):
72	$(INS.dir)
73
74$(TESTDIR)/%: %
75	$(INS.file)
76
77%.o: ../common/%.c
78	$(COMPILE.c) -o $@ $^
79	$(POST_PROCESS)
80
81%: %.o
82	$(LINK.c) -o $@ $< $(COMMON_OBJS) $(LDLIBS)
83	$(POST_PROCESS)
84