# Northwestern University
# (c) 2008, Jack Lange <jarusl@cs.northwestern.edu>
# (c) 2008, Peter Dinda <pdinda@northwestern.edu>
-# (c) 2008, Lei Xia <xiaxlei@gmail.com>
+# (c) 2008, Lei Xia <lxia@northwestern.edu>
# (c) 2008, The V3VEE Project <http://www.v3vee.org>
#
# Based on GeekOS Makefile:
#
ifeq ($(LEAN_AND_MEAN),1)
-DEBUG=0
-DEBUG_SECTIONS=
+DEBUG := 0
+DEBUG_SECTIONS :=
else
-DEBUG=1
-DEBUG_SECTIONS=
+DEBUG := 1
+DEBUG_SECTIONS :=
endif
ifeq ($(DEBUG_ALL),1)
- DEBUG_SECTIONS:= $(DEBUG_SECTIONS) -DDEBUG_SHADOW_PAGING -DDEBUG_CTRL_REGS -DDEBUG_INTERRUPTS -DDEBUG_IO -DDEBUG_KEYBOARD -DDEBUG_PIC -DDEBUG_PIT -DDEBUG_NVRAM -DDEBUG_EMULATOR -DDEBUG_GENERIC -DDEBUG_RAMDISK -DDEBUG_XED -DDEBUG_HALT -DDEBUG_DEV_MGR
+ DEBUG_SECTIONS:= $(DEBUG_SECTIONS) -DDEBUG_SHADOW_PAGING -DDEBUG_CTRL_REGS -DDEBUG_INTERRUPTS -DDEBUG_KEYBOARD -DDEBUG_PIC -DDEBUG_PIT -DDEBUG_NVRAM -DDEBUG_EMULATOR -DDEBUG_XED -DDEBUG_HALT -DDEBUG_DEV_MGR
+# -DDEBUG_IO -DDEBUG_GENERIC -DDEBUG_RAMDISK
endif
+
ifeq ($(DEBUG_SHADOW_PAGING),1)
DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DDEBUG_SHADOW_PAGING
else
endif
endif
+ifeq ($(DEBUG_APIC),1)
+DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DDEBUG_APIC
+else
+ifeq ($(DEBUG_APIC),0)
+DEBUG_SECTIONS := $(DEBUG_SECTIONS) -UDEBUG_APIC
+endif
+endif
+
+ifeq ($(DEBUG_PCI),1)
+DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DDEBUG_PCI
+else
+ifeq ($(DEBUG_PCI),0)
+DEBUG_SECTIONS := $(DEBUG_SECTIONS) -UDEBUG_PCI
+endif
+endif
+
ifeq ($(DEBUG_DEV_MGR),1)
DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DDEBUG_DEV_MGR
else
+ifeq ($(INSTRUMENT_VMM),1)
+ EXTRA_C_OPTS:= -DINSTRUMENT_VMM
+ INSTRUMENT_OPT := -finstrument-functions
+ OBJ_FILES := palacios/vmm_instrument.o
+else
+ INSTRUMENT_OPT :=
+endif
+
+
# ----------------------------------------------------------------------
# Configuration -
# List of targets to build by default.
# These targets encompass everything needed to boot
# and run GeekOS.
-ALL_TARGETS := vmm vm_kernel
+ALL_TARGETS := vmm force_payload
VMM_OBJS := \
palacios/svm_lowlevel.o \
palacios/vmm_msr.o \
palacios/svm_msr.o \
+ palacios/vmm_socket.o \
+ palacios/vmm_xed.o \
+ palacios/vmm_rbtree.o \
+ palacios/vmm_profiler.o \
+ palacios/vmm_direct_paging.o \
+ palacios/vmm_ringbuffer.o \
+ palacios/vmm_hypercall.o \
+ $(OBJ_FILES)
# vmx.c vmcs_gen.c vmcs.c
xed/v3-xed-compat.o \
xed/v3-udiv-compat.o \
-$(XED_OBJS) :: EXTRA_CFLAGS =
-
+$(XED_OBJS) :: EXTRA_CFLAGS = \
+ $(JRLDEBUG) \
DEVICES_OBJS := \
devices/generic.o \
devices/ramdisk.o \
devices/cdrom.o \
devices/bochs_debug.o \
+ devices/os_debug.o \
+ devices/apic.o \
+ devices/io_apic.o \
+ devices/pci.o \
+ devices/para_net.o \
-$(DEVICES_OBJS) :: EXTRA_CFLAGS =
-
-#
-# DECODER is the decoder that will be used
-# currently we only support xed
-#
-DECODER=XED
+# devices/vnic.o \
-ifeq ($(DECODER),XED)
-VMM_OBJS += palacios/vmm_xed.o
-else
-# This is an error
-endif
+$(DEVICES_OBJS) :: EXTRA_CFLAGS = \
+ $(JRLDEBUG) \
endif
+ifeq ($(CRAY_XT),1)
+EXTRA_C_OPTS := $(EXTRA_C_OPTS) -DCRAY_XT
+endif
+
+
# Uncomment if cross compiling
#TARGET_CC_PREFIX := $(PROJECT_ROOT)/../devtools/i386/bin/i386-elf-
#TARGET_CC_PREFIX := i386-elf-
$(EXTRA_C_OPTS) \
$(VMM_FLAGS) \
-I$(PROJECT_ROOT)/include \
- -fPIC \
-Werror \
+ -fPIC \
+ -mno-red-zone \
-Wp,-MD,$(@D)/.$(@F).d \
-Wp,-MT,$@ \
+#-fPIC \
#-fvisibility=hidden
-
# Flags passed to objcopy program (strip unnecessary sections from kernel.exe)
OBJCOPY_FLAGS := -R .dynamic -R .note -R .comment
-c \
$< \
-o $@ \
+ $(INSTRUMENT_OPT) \
)
AS_COMPILE = \
-c \
$< \
-o $@ \
+ $(INSTRUMENT_OPT) \
)