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.


setting up framework for 64 bit shadow paging
[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 KITTEN_TOP_DIR := $(PROJECT_ROOT)/kitten
44 GEEKOS_BUILD_DIR := $(PROJECT_ROOT)/geekos/build
45 GUEST_ISO_DIR := /opt/vmm-tools/isos
46
47 # List of targets to build by default.
48 # These targets encompass everything needed to boot
49 # and run GeekOS.
50 ALL_TARGETS := palacios geekos
51
52 QEMU := /usr/local/qemu/bin/qemu-system-x86_64
53
54
55
56 #when -DNDEBUG is set the kassert functions are disabled
57 #JRLDEBUG=-DNDEBUG
58
59 # DEBUG=1 means VMM_DEBUG, VMM_INFO, and VMM_TRACE are enabled
60 # as are SERIAL_PRINT_DEBUG
61
62 DEBUG_SECTIONS := DEBUG=1
63
64 ifeq ($(DEBUG_ALL),1)
65   DEBUG_SECTIONS:= $(DEBUG_SECTIONS) DEBUG_ALL=1
66 endif
67
68 ifeq ($(DEBUG_SHADOW_PAGING),1)
69 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_SHADOW_PAGING=1
70 else 
71 ifeq ($(DEBUG_SHADOW_PAGING),0) 
72 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_SHADOW_PAGING=0
73 endif
74 endif
75
76 ifeq ($(DEBUG_CTRL_REGS),1)
77 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_CTRL_REGS=1
78 else 
79 ifeq ($(DEBUG_CTRL_REGS),0) 
80 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_CTRL_REGS=0
81 endif
82 endif
83
84 ifeq ($(DEBUG_INTERRUPTS),1)
85 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_INTERRUPTS=1
86 else 
87 ifeq ($(DEBUG_INTERRUPTS),0) 
88 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_INTERRUPTS=0
89 endif
90 endif
91
92 ifeq ($(DEBUG_IO),1)
93 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_IO=1
94 else 
95 ifeq ($(DEBUG_IO),0) 
96 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_IO=0
97 endif
98 endif
99
100 ifeq ($(DEBUG_KEYBOARD),1)
101 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_KEYBOARD=1
102 else 
103 ifeq ($(DEBUG_KEYBOARD),0) 
104 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_KEYBOARD=0
105 endif
106 endif
107
108 ifeq ($(DEBUG_PIC),1)
109 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_PIC=1
110 else 
111 ifeq ($(DEBUG_PIC),0) 
112 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_PIC=0
113 endif
114 endif
115
116 ifeq ($(DEBUG_PIT),1)
117 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_PIT=1
118 else 
119 ifeq ($(DEBUG_PIT),0) 
120 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_PIT=0
121 endif
122 endif
123
124 ifeq ($(DEBUG_NVRAM),1)
125 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_NVRAM=1
126 else 
127 ifeq ($(DEBUG_NVRAM),0) 
128 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_NVRAM=0
129 endif
130 endif
131
132 ifeq ($(DEBUG_GENERIC),1)
133 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_GENERIC=1
134 else 
135 ifeq ($(DEBUG_GENERIC),0) 
136 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_GENERIC=0
137 endif
138 endif
139
140 ifeq ($(DEBUG_EMULATOR),1)
141 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_EMULATOR=1
142 else 
143 ifeq ($(DEBUG_EMULATOR),0) 
144 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_EMULATOR=0
145 endif
146 endif
147
148 ifeq ($(DEBUG_RAMDISK),1)
149 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_RAMDISK=1
150 else 
151 ifeq ($(DEBUG_RAMDISK),0) 
152 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_RAMDISK=0
153 endif
154 endif
155
156 ifeq ($(DEBUG_XED),1)
157 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_XED=1
158 else 
159 ifeq ($(DEBUG_XED),0) 
160 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_XED=0
161 endif
162 endif
163
164 ifeq ($(DEBUG_HALT),1)
165 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_HALT=1
166 else 
167 ifeq ($(DEBUG_HALT),0) 
168 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_HALT=0
169 endif
170 endif
171
172 ifeq ($(DEBUG_DEV_MGR),1)
173 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_DEV_MGR=1
174 else 
175 ifeq ($(DEBUG_DEV_MGR),0) 
176 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_DEV_MGR=0
177 endif
178 endif
179
180
181 # ----------------------------------------------------------------------
182 # Targets -
183 #   Specifies files to be built
184 # ----------------------------------------------------------------------
185
186 # Default target - see definition of ALL_TARGETS in Configuration section
187 all : $(ALL_TARGETS)
188
189
190 palacios64:
191         (cd $(PALACIOS_BUILD_DIR) && make ARCH=64 $(DEBUG_SECTIONS))
192
193 palacios32:
194         (cd $(PALACIOS_BUILD_DIR) && make $(DEBUG_SECTIONS))
195
196
197 palacios-full32:
198         (cd $(PALACIOS_BUILD_DIR) && make $(DEBUG_SECTIONS) world)
199
200 palacios-full64:
201         (cd $(PALACIOS_BUILD_DIR) && make ARCH=64 $(DEBUG_SECTIONS) world)      
202
203 palacios-lean:
204         (cd $(PALACIOS_BUILD_DIR) && make LEAN_AND_MEAN=1 world)
205
206 kitten: palacios64
207         cp $(PALACIOS_BUILD_DIR)/libv3vee.a $(KITTEN_TOP_DIR)/palacios/
208         cp $(PALACIOS_BUILD_DIR)/../lib/xed/libxed32e.a $(KITTEN_TOP_DIR)/palacios/
209         cp $(PALACIOS_BUILD_DIR)/vm_kernel $(KITTEN_TOP_DIR)/palacios/
210         (cd $(KITTEN_TOP_DIR) && make)
211
212 kitten-full: palacios-full64
213         (cd $(KITTEN_TOP_DIR) && make clean)
214         cp $(PALACIOS_BUILD_DIR)/libv3vee.a $(KITTEN_TOP_DIR)/palacios/
215         cp $(PALACIOS_BUILD_DIR)/../lib/xed/libxed32e.a $(KITTEN_TOP_DIR)/palacios/
216         cp $(PALACIOS_BUILD_DIR)/vm_kernel $(KITTEN_TOP_DIR)/palacios/
217         (cd $(KITTEN_TOP_DIR) && make)
218
219
220 geekos: palacios32
221         cp $(PALACIOS_BUILD_DIR)/libv3vee.a $(GEEKOS_BUILD_DIR)/palacios/
222         cp $(PALACIOS_BUILD_DIR)/../lib/xed/libxed.a $(GEEKOS_BUILD_DIR)/palacios/
223         cp $(PALACIOS_BUILD_DIR)/vm_kernel $(GEEKOS_BUILD_DIR)/palacios/
224         (cd $(GEEKOS_BUILD_DIR) && make)
225
226
227 geekos-full: palacios-full32
228         cp $(PALACIOS_BUILD_DIR)/libv3vee.a $(GEEKOS_BUILD_DIR)/palacios/
229         cp $(PALACIOS_BUILD_DIR)/../lib/xed/libxed.a $(GEEKOS_BUILD_DIR)/palacios/
230         cp $(PALACIOS_BUILD_DIR)/vm_kernel $(GEEKOS_BUILD_DIR)/palacios/
231         (cd $(GEEKOS_BUILD_DIR) && make clean && make)
232
233
234 world: geekos-full kitten-full
235
236 lean-and-mean: palacios-lean geekos-full
237
238
239
240 # make ready to boot over PXE
241 geekos-pxe: 
242         cp $(GEEKOS_BUILD_DIR)/vmm.img /tftpboot/vmm.img
243
244 geekos-run: 
245         $(QEMU) -m 1024 -serial file:serial.out -cdrom $(GUEST_ISO_DIR)/puppy.iso -fda $(GEEKOS_BUILD_DIR)/vmm.img 
246
247 geekos-iso: 
248         cp $(GEEKOS_BUILD_DIR)/vmm.img iso/vmm.img
249         mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o test.iso iso
250
251
252
253 force:
254
255
256
257
258 # Clean build directories of generated files
259 clean :
260         for d in $(GEEKOS_BUILD_DIR) $(PALACIOS_BUILD_DIR); do \
261                 (cd $$d && make clean); \
262         done
263
264