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.


tried to reduce compiler warnings, and cut down on debugging output
[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 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
172 # ----------------------------------------------------------------------
173 # Targets -
174 #   Specifies files to be built
175 # ----------------------------------------------------------------------
176
177 # Default target - see definition of ALL_TARGETS in Configuration section
178 all : $(ALL_TARGETS)
179
180
181
182 palacios:
183         (cd $(PALACIOS_BUILD_DIR) && make $(DEBUG_SECTIONS))
184
185
186 palacios-full:
187         (cd $(PALACIOS_BUILD_DIR) && make $(DEBUG_SECTIONS) world)
188
189
190 geekos: 
191         cp $(PALACIOS_BUILD_DIR)/libv3vee.a $(GEEKOS_BUILD_DIR)/palacios/
192         cp $(PALACIOS_BUILD_DIR)/../lib/xed/libxed.a $(GEEKOS_BUILD_DIR)/palacios/
193         cp $(PALACIOS_BUILD_DIR)/vm_kernel $(GEEKOS_BUILD_DIR)/palacios/
194         (cd $(GEEKOS_BUILD_DIR) && make)
195
196
197 geekos-full: 
198         cp $(PALACIOS_BUILD_DIR)/libv3vee.a $(GEEKOS_BUILD_DIR)/palacios/
199         cp $(PALACIOS_BUILD_DIR)/../lib/xed/libxed.a $(GEEKOS_BUILD_DIR)/palacios/
200         cp $(PALACIOS_BUILD_DIR)/vm_kernel $(GEEKOS_BUILD_DIR)/palacios/
201         (cd $(GEEKOS_BUILD_DIR) && make clean && make)
202
203
204 world: palacios-full geekos-full
205
206
207
208 # make ready to boot over PXE
209 geekos-pxe: 
210         cp $(GEEKOS_BUILD_DIR)/vmm.img /tftpboot/vmm.img
211
212 geekos-run: 
213         $(QEMU) -m 1024 -serial file:serial.out -cdrom $(GUEST_ISO_DIR)/puppy.iso -fda $(GEEKOS_BUILD_DIR)/vmm.img 
214
215 geekos-iso: 
216         cp $(GEEKOS_BUILD_DIR)/vmm.img iso/vmm.img
217         mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o test.iso iso
218
219
220
221 force:
222
223
224
225
226 # Clean build directories of generated files
227 clean :
228         for d in $(GEEKOS_BUILD_DIR) $(PALACIOS_BUILD_DIR); do \
229                 (cd $$d && make clean); \
230         done
231
232