xref: /illumos-gate/usr/src/test/bhyve-tests/tests/vmm/Makefile (revision ca783257c986cddcc674ae22916a6766b98a2d36)
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	fpu_getset
21
22COMMON_OBJS =	common.o
23CLEAN_OBJS =	$(PROG:%=%.o)
24
25ROOTOPTPKG = $(ROOT)/opt/bhyve-tests
26TESTDIR = $(ROOTOPTPKG)/tests/vmm
27
28CMDS = $(PROG:%=$(TESTDIR)/%)
29$(CMDS) := FILEMODE = 0555
30
31CSTD=		$(CSTD_GNU99)
32CPPFLAGS =	-I$(COMPAT)/bhyve -I$(CONTRIB)/bhyve \
33		-I$(COMPAT)/bhyve/amd64 -I$(CONTRIB)/bhyve/amd64 \
34		$(CPPFLAGS.master) \
35		-I$(SRC)/uts/i86pc/io/vmm \
36		-I$(SRC)/uts/i86pc
37$(PROG) :=	LDLIBS += -lvmmapi
38
39all: $(PROG)
40
41install: all $(CMDS)
42
43clean:
44	-$(RM) $(CLEAN_OBJS) $(COMMON_OBJS)
45clobber: clean
46	-$(RM) $(PROG)
47
48$(PROG): $(COMMON_OBJS)
49
50$(CMDS): $(TESTDIR) $(PROG)
51
52$(TESTDIR):
53	$(INS.dir)
54
55$(TESTDIR)/%: %
56	$(INS.file)
57
58%: %.o
59	$(LINK.c) -o $@ $< $(COMMON_OBJS) $(LDLIBS)
60	$(POST_PROCESS)
61