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.


27d9909887521d13bcc3df07bc67cd5a187d604c
[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 := geekos-full
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 ifeq ($(DEBUG_XED),1)
156 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_XED=1
157 else 
158 ifeq ($(DEBUG_XED),0) 
159 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_XED=0
160 endif
161 endif
162
163 ifeq ($(DEBUG_HALT),1)
164 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_HALT=1
165 else 
166 ifeq ($(DEBUG_HALT),0) 
167 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_HALT=0
168 endif
169 endif
170
171 ifeq ($(DEBUG_DEV_MGR),1)
172 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_DEV_MGR=1
173 else 
174 ifeq ($(DEBUG_DEV_MGR),0) 
175 DEBUG_SECTIONS := $(DEBUG_SECTIONS) DEBUG_DEV_MGR=0
176 endif
177 endif
178
179
180 # ----------------------------------------------------------------------
181 # Targets -
182 #   Specifies files to be built
183 # ----------------------------------------------------------------------
184
185 # Default target - see definition of ALL_TARGETS in Configuration section
186 all : $(ALL_TARGETS)
187
188
189 palacios64:
190         (cd $(PALACIOS_BUILD_DIR) && make ARCH=64 $(DEBUG_SECTIONS))
191
192 palacios32:
193         (cd $(PALACIOS_BUILD_DIR) && make $(DEBUG_SECTIONS))
194
195
196 palacios-full32:
197         (cd $(PALACIOS_BUILD_DIR) && make $(DEBUG_SECTIONS) world)
198
199 palacios-full64:
200         (cd $(PALACIOS_BUILD_DIR) && make ARCH=64 $(DEBUG_SECTIONS) world)      
201
202 palacios-lean:
203         (cd $(PALACIOS_BUILD_DIR) && make LEAN_AND_MEAN=1 world)
204
205
206
207 geekos: palacios32
208         cp $(PALACIOS_BUILD_DIR)/libv3vee.a $(GEEKOS_BUILD_DIR)/palacios/
209         cp $(PALACIOS_BUILD_DIR)/../lib/xed/libxed.a $(GEEKOS_BUILD_DIR)/palacios/
210         cp $(PALACIOS_BUILD_DIR)/vm_kernel $(GEEKOS_BUILD_DIR)/palacios/
211         (cd $(GEEKOS_BUILD_DIR) && make)
212
213
214 geekos-full: palacios-full32
215         cp $(PALACIOS_BUILD_DIR)/libv3vee.a $(GEEKOS_BUILD_DIR)/palacios/
216         cp $(PALACIOS_BUILD_DIR)/../lib/xed/libxed.a $(GEEKOS_BUILD_DIR)/palacios/
217         cp $(PALACIOS_BUILD_DIR)/vm_kernel $(GEEKOS_BUILD_DIR)/palacios/
218         (cd $(GEEKOS_BUILD_DIR) && make clean && make)
219
220
221 world: geekos-full palacios-full64
222
223 lean-and-mean: palacios-lean geekos-full
224
225
226
227 # make ready to boot over PXE
228 geekos-pxe: 
229         cp $(GEEKOS_BUILD_DIR)/vmm.img /tftpboot/vmm.img
230
231 geekos-run: 
232         $(QEMU) -m 1024 -serial file:serial.out -cdrom $(GUEST_ISO_DIR)/puppy.iso -fda $(GEEKOS_BUILD_DIR)/vmm.img 
233
234 geekos-iso: 
235         cp $(GEEKOS_BUILD_DIR)/vmm.img iso/vmm.img
236         mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o test.iso iso
237
238
239
240 force:
241
242
243
244
245 # Clean build directories of generated files
246 clean :
247         for d in $(GEEKOS_BUILD_DIR) $(PALACIOS_BUILD_DIR); do \
248                 (cd $$d && make clean); \
249         done
250
251