xref: /illumos-gate/usr/src/uts/i86pc/vmm/Makefile (revision 90f7985f020eb82d06bd0d75396ff794105f7528)
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#
13# Copyright 2013 Pluribus Networks Inc.
14# Copyright 2019 Joyent, Inc.
15#
16
17#
18#	Path to the base of the uts directory tree (usually /usr/src/uts).
19#
20UTSBASE	= ../..
21
22#
23#	Define the module and object file sets.
24#
25MODULE		= vmm
26OBJECTS		= $(VMM_OBJS:%=$(OBJS_DIR)/%)
27ROOTMODULE	= $(USR_DRV_DIR)/$(MODULE)
28CONF_SRCDIR	= $(UTSBASE)/i86pc/io/vmm
29MAPFILE		= $(UTSBASE)/i86pc/io/vmm/vmm.mapfile
30
31#
32#	Include common rules.
33#
34include $(UTSBASE)/i86pc/Makefile.i86pc
35
36#
37#	Define targets
38#
39ALL_TARGET	= $(BINARY)
40INSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
41
42#
43#	Overrides and additions
44#
45
46
47# 3rd party code
48SMOFF += all_func_returns
49
50# needs work
51$(OBJS_DIR)/vmm_sol_dev.o := SMOFF += signed_integer_overflow_check
52
53ALL_BUILDS	= $(ALL_BUILDSONLY64)
54DEF_BUILDS	= $(DEF_BUILDSONLY64)
55PRE_INC_PATH	= -I$(COMPAT)/bhyve -I$(COMPAT)/bhyve/amd64 \
56	-I$(CONTRIB)/bhyve -I$(CONTRIB)/bhyve/amd64
57INC_PATH	+= -I$(UTSBASE)/i86pc/io/vmm -I$(UTSBASE)/i86pc/io/vmm/io
58AS_INC_PATH	+= -I$(UTSBASE)/i86pc/io/vmm -I$(OBJS_DIR)
59
60# enable collection of VMM statistics
61CFLAGS		+= -DVMM_KEEP_STATS
62
63LDFLAGS         += -N misc/acpica -N misc/pcie -N fs/dev
64LDFLAGS         += -z type=kmod -M $(MAPFILE)
65
66OFFSETS_VMX	= $(CONF_SRCDIR)/intel/offsets.in
67OFFSETS_SVM	= $(CONF_SRCDIR)/amd/offsets.in
68ASSYM_VMX	= $(OBJS_DIR)/vmx_assym.h
69ASSYM_SVM	= $(OBJS_DIR)/svm_assym.h
70ASSYM_H		= $(ASSYM_VMX) $(ASSYM_SVM)
71
72CLEANFILES	+= $(ASSYM_H)
73
74#
75#	Default build targets.
76#
77.KEEP_STATE:
78
79def:		$(DEF_DEPS)
80
81all:		$(ALL_DEPS)
82
83clean:		$(CLEAN_DEPS)
84
85clobber:	$(CLOBBER_DEPS)
86
87install:	$(INSTALL_DEPS)
88
89#
90#	Include common targets.
91#
92include $(UTSBASE)/i86pc/Makefile.targ
93
94$(ASSYM_VMX): $(OFFSETS_VMX) $(GENASSYM)
95	$(OFFSETS_CREATE) -I../../i86pc/io/vmm < $(OFFSETS_VMX) >$@
96$(ASSYM_SVM): $(OFFSETS_SVM) $(GENASSYM)
97	$(OFFSETS_CREATE) -I../../i86pc/io/vmm < $(OFFSETS_SVM) >$@
98
99$(OBJS_DIR)/vmx_support.o:  $(ASSYM_VMX)
100$(OBJS_DIR)/svm_support.o:  $(ASSYM_SVM)
101