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.


added a configuration structure for the binary inputs to the vmm (ramdisk, bios)
[palacios.git] / build / Makefile
1 # Makefile for GeekOS kernel, userspace, and tools
2 #
3 #  Northwestern University 
4 # (c) 2008, Jack Lange <jarusl@cs.northwestern.edu>
5 # (c) 2008, Peter Dinda <pdinda@northwestern.edu> 
6 # (c) 2008, Lei Xia <xiaxlei@gmail.com>
7 # (c) 2008, The V3VEE Project <http://www.v3vee.org> 
8 #
9 # Based on GeekOS Makefile:
10 # Copyright (c) 2004,2005 David H. Hovemeyer <daveho@cs.umd.edu>
11 # $Revision: 1.71 $
12
13
14 # This is free software.  You are permitted to use,
15 # redistribute, and modify it as specified in the file "COPYING".
16
17 # Required software to build GeekOS:
18 # - GNU Make (http://www.gnu.org/software/make)
19 # - gcc 2.95.2 generating code for target (i386/ELF) and host platforms
20 # - nasm (http://nasm.sourceforge.net)
21 # - Perl5, AWK (any version), egrep
22 #
23 # Cygwin (http://cygwin.com) may be used to build GeekOS.
24 # Make sure that gcc, binutils, nasm, and perl are installed.
25
26 # NOTES:
27 # - This makefile has been written carefully to work correctly
28 #   with the -j (parallel make) option.  I regularly use "make -j 2"
29 #   to speed the build process on 2 processor systems.
30
31
32
33
34 # ----------------------------------------------------------------------
35 # Configuration -
36 #   Various options specifying how GeekOS should be built,
37 #   what source files to build, which user programs to build,
38 #   etc.  This is generally the only section of the makefile
39 #   that will need to be modified.
40 # ----------------------------------------------------------------------
41 PROJECT_ROOT := ..
42 PALACIOS_BUILD_DIR := $(PROJECT_ROOT)/palacios/build
43 GEEKOS_BUILD_DIR := $(PROJECT_ROOT)/geekos/build
44 GUEST_ISO_DIR := /opt/vmm-tools/isos
45
46 # List of targets to build by default.
47 # These targets encompass everything needed to boot
48 # and run GeekOS.
49 ALL_TARGETS := palacios geekos
50
51 QEMU := /usr/local/qemu/bin/qemu-system-x86_64
52
53
54
55 #when -DNDEBUG is set the kassert functions are disabled
56 #JRLDEBUG=-DNDEBUG
57
58 # DEBUG=1 means VMM_DEBUG, VMM_INFO, and VMM_TRACE are enabled
59 # as are SERIAL_PRINT_DEBUG
60
61 DEBUG_SECTIONS := DEBUG=1
62
63 ifeq ($(DEBUG_ALL),1)
64   DEBUG_SECTIONS:= $(DEBUG_SECTIONS) DEBUG_ALL=1
65 endif
66
67 ifeq ($(DEBUG_SHADOW_PAGING),1)
68 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_SHADOW_PAGING=1
69 else 
70 ifeq ($(DEBUG_SHADOW_PAGING),0) 
71 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_SHADOW_PAGING=0
72 endif
73 endif
74
75 ifeq ($(DEBUG_CTRL_REGS),1)
76 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_CTRL_REGS=1
77 else 
78 ifeq ($(DEBUG_CTRL_REGS),0) 
79 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_CTRL_REGS=0
80 endif
81 endif
82
83 ifeq ($(DEBUG_INTERRUPTS),1)
84 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_INTERRUPTS=1
85 else 
86 ifeq ($(DEBUG_INTERRUPTS),0) 
87 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_INTERRUPTS=0
88 endif
89 endif
90
91 ifeq ($(DEBUG_IO),1)
92 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_IO=1
93 else 
94 ifeq ($(DEBUG_IO),0) 
95 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_IO=0
96 endif
97 endif
98
99 ifeq ($(DEBUG_KEYBOARD),1)
100 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_KEYBOARD=1
101 else 
102 ifeq ($(DEBUG_KEYBOARD),0) 
103 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_KEYBOARD=0
104 endif
105 endif
106
107 ifeq ($(DEBUG_PIC),1)
108 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_PIC=1
109 else 
110 ifeq ($(DEBUG_PIC),0) 
111 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_PIC=0
112 endif
113 endif
114
115 ifeq ($(DEBUG_PIT),1)
116 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_PIT=1
117 else 
118 ifeq ($(DEBUG_PIT),0) 
119 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_PIT=0
120 endif
121 endif
122
123 ifeq ($(DEBUG_NVRAM),1)
124 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_NVRAM=1
125 else 
126 ifeq ($(DEBUG_NVRAM),0) 
127 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_NVRAM=0
128 endif
129 endif
130
131 ifeq ($(DEBUG_GENERIC),1)
132 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_GENERIC=1
133 else 
134 ifeq ($(DEBUG_GENERIC),0) 
135 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_GENERIC=0
136 endif
137 endif
138
139 ifeq ($(DEBUG_EMULATOR),1)
140 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_EMULATOR=1
141 else 
142 ifeq ($(DEBUG_EMULATOR),0) 
143 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_EMULATOR=0
144 endif
145 endif
146
147 ifeq ($(DEBUG_RAMDISK),1)
148 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_RAMDISK=1
149 else 
150 ifeq ($(DEBUG_RAMDISK),0) 
151 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_RAMDISK=0
152 endif
153 endif
154
155
156 # ----------------------------------------------------------------------
157 # Targets -
158 #   Specifies files to be built
159 # ----------------------------------------------------------------------
160
161 # Default target - see definition of ALL_TARGETS in Configuration section
162 all : $(ALL_TARGETS)
163
164
165
166 palacios:
167         (cd $(PALACIOS_BUILD_DIR) && make $(DEBUG_SECTIONS))
168
169
170 palacios-full:
171         (cd $(PALACIOS_BUILD_DIR) && make $(DEBUG_SECTIONS) world)
172
173
174 geekos: 
175         cp $(PALACIOS_BUILD_DIR)/libv3vee.a $(GEEKOS_BUILD_DIR)/palacios/
176         cp $(PALACIOS_BUILD_DIR)/../lib/xed/libxed.a $(GEEKOS_BUILD_DIR)/palacios/
177         cp $(PALACIOS_BUILD_DIR)/vm_kernel $(GEEKOS_BUILD_DIR)/palacios/
178         (cd $(GEEKOS_BUILD_DIR) && make)
179
180
181 geekos-full: 
182         cp $(PALACIOS_BUILD_DIR)/libv3vee.a $(GEEKOS_BUILD_DIR)/palacios/
183         cp $(PALACIOS_BUILD_DIR)/../lib/xed/libxed.a $(GEEKOS_BUILD_DIR)/palacios/
184         cp $(PALACIOS_BUILD_DIR)/vm_kernel $(GEEKOS_BUILD_DIR)/palacios/
185         (cd $(GEEKOS_BUILD_DIR) && make clean && make)
186
187
188 world: palacios-full geekos-full
189
190
191
192 # make ready to boot over PXE
193 geekos-pxe: 
194         cp $(GEEKOS_BUILD_DIR)/vmm.img /tftpboot/vmm.img
195
196 geekos-run: 
197         $(QEMU) -m 1024 -serial file:serial.out -cdrom $(GUEST_ISO_DIR)/puppy.iso -fda $(GEEKOS_BUILD_DIR)/vmm.img 
198
199 geekos-iso: 
200         cp $(GEEKOS_BUILD_DIR)/vmm.img iso/vmm.img
201         mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o test.iso iso
202
203
204
205 force:
206
207
208
209
210 # Clean build directories of generated files
211 clean :
212         for d in $(GEEKOS_BUILD_DIR) $(PALACIOS_BUILD_DIR); do \
213                 (cd $$d && make clean); \
214         done
215
216