Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


fixed xed clean issue
[palacios-OLD.git] / palacios / build / Makefile
index 51d0096..cb557a3 100644 (file)
@@ -52,11 +52,18 @@ VPATH := $(PROJECT_ROOT)/src
 # DEBUG=1 means VMM_DEBUG, VMM_INFO, and VMM_TRACE are enabled
 # as are SERIAL_PRINT_DEBUG
 # 
+
+ifeq ($(LEAN_AND_MEAN),1) 
+DEBUG=0
+DEBUG_SECTIONS=
+else
 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
+  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
 endif
 
 ifeq ($(DEBUG_SHADOW_PAGING),1)
@@ -171,14 +178,20 @@ DEBUG_SECTIONS := $(DEBUG_SECTIONS) -UDEBUG_HALT
 endif
 endif
 
+ifeq ($(DEBUG_DEV_MGR),1)
+DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DDEBUG_DEV_MGR
+else 
+ifeq ($(DEBUG_DEV_MGR),0)
+DEBUG_SECTIONS := $(DEBUG_SECTIONS) -UDEBUG_DEV_MGR
+endif
+endif
 
 #DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DTEST_NE2K
 
 ifeq ($(DEBUG),1)
-  JRLDEBUG= -DSERIAL_PRINT_DEBUG=1 -DSERIAL_PRINT_DEBUG_LEVEL=10 -DSERIAL_PRINT=1 -DVMM_DEBUG=1 -DVMM_INFO=1 -DVMM_TRACE=1 $(DEBUG_SECTIONS)
-
+  JRLDEBUG=  -DVMM_DEBUG -DVMM_INFO -DVMM_TRACE $(DEBUG_SECTIONS)
 else
-  JRLDEBUG= -DSERIAL_PRINT_DEBUG=0 -DSERIAL_PRINT_DEBUG_LEVEL=999999 -DSERIAL_PRINT=0 -DVMM_DEBUG=0 -DVMM_INFO=0 -DVMM_TRACE=0
+
 endif
 
 
@@ -195,7 +208,11 @@ DECODER_LIBS=
 ifeq ($(DECODER),XED)
 DECODER_SRCS := vmm_xed.c
 DECODER_FLAGS :=  -L../lib/xed
+ifeq ($(ARCH),64)
+DECODER_LIBS := $(PROJECT_ROOT)/lib/xed/libxed32e.a
+else 
 DECODER_LIBS := $(PROJECT_ROOT)/lib/xed/libxed.a
+endif
 else
 # This is an error
 endif
@@ -241,11 +258,11 @@ ALL_TARGETS := vmm vm_kernel
 
 
 
-VMM_ASM_SRCS :=  svm_lowlevel.asm vmm_lowlevel.asm\
-#                      vmx_lowlevel.asm
-
+VMM_ASM_SRCS :=
 VMM_ASM_OBJS := $(VMM_ASM_SRCS:%.asm=palacios/%.o)
 
+VMM_GAS_SRCS := svm_lowlevel.s
+VMM_GAS_OBJS := $(VMM_GAS_SRCS:%.s=palacios/%.o)
 
 VMM_C_SRCS :=   vm_guest.c \
                svm.c svm_handler.c vmm.c vmm_util.c vmm_ctrl_regs.c \
@@ -262,23 +279,21 @@ VMM_C_SRCS :=   vm_guest.c \
 
 VMM_C_OBJS := $(VMM_C_SRCS:%.c=palacios/%.o)
 
-VMM_OBJS := $(VMM_C_OBJS) $(VMM_ASM_OBJS)
+VMM_OBJS := $(VMM_C_OBJS) $(VMM_ASM_OBJS) $(VMM_GAS_OBJS)
 
 
 
 XED_C_SRCS := v3-xed-compat.c
-
 XED_C_OBJS := $(XED_C_SRCS:%.c=xed/%.o)
 
 XED_GAS_SRCS := v3-udiv-compat.s
-
 XED_GAS_OBJS := $(XED_GAS_SRCS:%.s=xed/%.o)
 
 XED_OBJS := $(XED_C_OBJS) $(XED_GAS_OBJS)
 
 
 
-DEVICE_C_SRCS := generic.c keyboard.c nvram.c timer.c simple_pic.c 8259a.c 8254.c serial.c ramdisk.c cdrom.c
+DEVICE_C_SRCS := generic.c keyboard.c nvram.c timer.c simple_pic.c 8259a.c 8254.c serial.c ramdisk.c cdrom.c bochs_debug.c
 
 DEVICE_C_OBJS := $(DEVICE_C_SRCS:%.c=devices/%.o)
 
@@ -295,16 +310,23 @@ V3LIBS := $(DECODER_LIBS)
 #   This section defines programs that are used to build GeekOS.
 # ----------------------------------------------------------------------
 
-
+ifeq ($(ARCH),64)
+V3_ARCH := __V3_64BIT__
+else 
 V3_ARCH := __V3_32BIT__
-#V3_ARCH := __V3_64BIT__
+endif
+
 
 # Uncomment if cross compiling
 #TARGET_CC_PREFIX :=  $(PROJECT_ROOT)/../devtools/i386/bin/i386-elf-
 #TARGET_CC_PREFIX :=  i386-elf-
 
 # Target C compiler.  gcc 2.95.2 or later should work.
+ifeq ($(ARCH),64)
+TARGET_CC := $(TARGET_CC_PREFIX)gcc
+else 
 TARGET_CC := $(TARGET_CC_PREFIX)gcc -m32
+endif
 #TARGET_CC := $(TARGET_CC_PREFIX)gcc34 -m32
 
 
@@ -327,7 +349,15 @@ TARGET_OBJCOPY := $(TARGET_CC_PREFIX)objcopy
 NASM := $(PROJECT_ROOT)/../devtools/bin/nasm
 #NASM := /opt/vmm-tools/bin/nasm
 
+CPP := cpp
+
+
+ifeq ($(ARCH),64)
+AS = as
+else 
 AS = as --32
+endif
+
 
 # Tool to build PFAT filesystem images.
 BUILDFAT := tools/builtFat.exe
@@ -384,6 +414,11 @@ palacios/%.o : palacios/%.c
 palacios/%.o : palacios/%.asm
        $(NASM) $(NASM_VMM_OPTS) $< -o palacios/$*.o
 
+palacios/%.o : palacios/%.S
+       $(CPP) $(CC_VMM_OPTS) $< | $(AS) -o palacios/$*.o
+
+
+
 devices/%.o : devices/%.c
        $(TARGET_CC) -c $(CC_GENERAL_OPTS) $(CC_VMM_OPTS) $< -o devices/$*.o
 
@@ -470,7 +505,7 @@ force:
 
 # Clean build directories of generated files
 clean :
-       for d in palacios devices; do \
+       for d in palacios devices xed; do \
                (cd $$d && rm -f *); \
        done