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