xref: /illumos-gate/usr/src/test/bhyve-tests/tests/perf/Makefile (revision 1a2d662a91cee3bf82f41cd47c7ae6f3825d9db2)
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 =	entry_exit
19
20# C-based payloads need additional utils object
21CPAYLOADS =	entry_exit
22
23PAYLOADS = $(PROG)
24include ../Makefile.in_guest
25
26COMMON_OBJS =	in_guest.o common.o
27
28CLEANFILES =	$(COMMON_OBJS) $(PAYLOAD_CLEANFILES) payload_utils.o
29CLOBBERFILES =	$(PROG)
30
31ROOTOPTPKG = $(ROOT)/opt/bhyve-tests
32TESTDIR = $(ROOTOPTPKG)/tests/perf
33
34CMDS = $(PROG:%=$(TESTDIR)/%)
35$(CMDS) := FILEMODE = 0555
36
37CSTD=		$(CSTD_GNU99)
38CPPFLAGS =	-I$(COMPAT)/bhyve -I$(CONTRIB)/bhyve \
39		-I$(COMPAT)/bhyve/amd64 -I$(CONTRIB)/bhyve/amd64 \
40		$(CPPFLAGS.master) \
41		-I$(SRC)/uts/intel/io/vmm \
42		-I$(SRC)/uts/intel \
43		-I../common
44
45ASFLAGS +=	-D_ASM
46ASFLAGS64 +=	-D_ASM
47
48$(PROG) :=	LDLIBS += -lvmmapi
49
50all: $(PROG)
51
52install: all $(CMDS)
53
54clean:
55	-$(RM) $(CLEANFILES)
56clobber: clean
57	-$(RM) $(CLOBBERFILES)
58
59$(CMDS): $(TESTDIR) $(PROG)
60
61$(TESTDIR):
62	$(INS.dir)
63
64$(TESTDIR)/%: %
65	$(INS.file)
66
67%: %.c pobj_%.o $(COMMON_OBJS)
68	$(LINK.c) -o $@ $^ $(LDLIBS)
69	$(POST_PROCESS)
70
71%: %.o
72	$(LINK.c) -o $@ $^ $(LDLIBS)
73	$(POST_PROCESS)
74
75$(CPAYLOADS:%=payload_%): payload_utils.o
76