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