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.


User space library and example tool for accessing guest physical memory from host...
[palacios.git] / linux_usr / Makefile
1 #
2 # Build Static or Dynamic versions of the control utilities
3 #
4 #
5
6 # define this at the command-line or here
7 # to get dynamically linked versions
8 STATIC = 0
9
10 #
11 # Executables that implement core functionality
12 #
13 BASE_EXECS =    v3_mem \
14                 v3_mem_free \
15                 v3_create \
16                 v3_create_bind \
17                 v3_free  \
18                 v3_launch \
19                 v3_stop   \
20                 v3_pause  \
21                 v3_continue \
22                 v3_core_move \
23                 v3_load \
24                 v3_save \
25                 v3_cons \
26                 v3_cons_sc \
27                 v3_stream \
28                 v3_monitor \
29                 v3_hypercall \
30                 v3_debug \
31                 v3_send \
32                 v3_receive \
33                 v3_pci
34
35
36 #
37 # Examples
38 #
39 EXAMPLE_EXECS = v3_user_host_dev_example \
40                 v3_os_debug \
41                 v3_user_keyed_stream_example \
42                 v3_user_keyed_stream_file \
43                 v3_guest_mem_example
44
45 #
46 # Currently experimental things
47 #
48 EXPERIMENTAL_EXECS =    v3_simulate  \
49                         v3_inject_ecc_scrubber_mce  \
50                         v3_top_inject \
51                         v3_env_inject \
52                         v3_syscall
53
54
55
56
57 #
58 # Things that have been built elsewhere - just for reference here
59 #
60 PRECOMPILED_EXECS = x0vncserver
61
62 COPIED_EXECS = v3_x0vncserver v3_x0gui
63
64 #
65 # Libraries that we need to build
66 #
67 LIBS = libv3_user_host_dev.a libv3_user_keyed_stream.a libv3_ctrl.a libv3_guest_mem.a
68
69 BUILD_EXECS = $(BASE_EXECS) $(EXAMPLE_EXECS) $(EXPERIMENTAL_EXECS) 
70 BUILD_LIBS = $(LIBS)
71
72
73 CFILES = $(BUILD_EXECS:%=%.c) $(BUILD_LIBS:lib%.a=%.c) 
74
75 ifeq ($(STATIC),1)
76   CFLAGS += -static 
77 endif
78
79 CFLAGS += -I../linux_module
80
81 CC = gcc
82 AR = ar
83
84 all: $(BUILD_EXECS) $(BUILD_LIBS) $(COPIED_EXECS)
85
86
87 libv3_ctrl.a : v3_ctrl.c v3_ctrl.h
88         $(CC) $(CFLAGS) -I../linux_module -c v3_ctrl.c
89         $(AR) ruv libv3_ctrl.a v3_ctrl.o
90         rm -rf v3_ctrl.o 
91
92 #
93 # Most tools compile in a straightforward way
94 #
95 % :: %.c v3_ctrl.h libv3_ctrl.a
96         $(CC) $(CFLAGS) $< -lv3_ctrl -L. -o $@
97
98
99 #
100 # Console support requires curses
101 #
102 ifeq ($(STATIC),1)
103   CURSES_CFLAGS = -DNCURSES_STATIC
104   CURSES_LIBS = -lcurses                           
105 else
106   CURSES_CFLAGS = 
107   CURSES_LIBS = -lcurses 
108 endif
109
110 v3_cons: v3_cons.c
111         $(CC) $(CFLAGS) $(CURSES_CFLAGS) $< $(CURSES_LIBS) -o $@
112
113 v3_cons_sc: v3_cons_sc.c
114         $(CC) $(CFLAGS) $(CURSES_CFLAGS) $< $(CURSES_LIBS) -o $@
115
116 v3_create: v3_create.c ezxml.c libv3_ctrl.a 
117         $(CC) $(CFLAGS) $^ -lv3_ctrl -L. -o $@
118
119
120
121 #
122 # User host devices include a library and some examples
123 #
124 libv3_user_host_dev.a : v3_user_host_dev.c v3_user_host_dev.h v3_ctrl.h
125         $(CC) $(CFLAGS) -I../linux_module -c v3_user_host_dev.c 
126         $(AR) ruv libv3_user_host_dev.a v3_user_host_dev.o
127         rm -f v3_user_host_dev.o
128
129 v3_user_host_dev_example : v3_user_host_dev_example.c libv3_user_host_dev.a
130         $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_host_dev -o $@
131
132 v3_os_debug : v3_os_debug.c libv3_user_host_dev.a
133         $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_host_dev -o $@
134
135
136 #
137 # User keyed stream support includes a library and examples
138 #
139 #
140 libv3_user_keyed_stream.a :: v3_user_keyed_stream.c v3_user_keyed_stream.h v3_ctrl.h
141         $(CC) $(CFLAGS) -I../linux_module -c v3_user_keyed_stream.c 
142         $(AR) ruv libv3_user_keyed_stream.a v3_user_keyed_stream.o
143         rm -f v3_user_keyed_stream.o
144
145
146 v3_user_keyed_stream_example : v3_user_keyed_stream_example.c libv3_user_keyed_stream.a
147         $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_keyed_stream -o $@
148
149 v3_user_keyed_stream_file : v3_user_keyed_stream_file.c libv3_user_keyed_stream.a
150         $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_keyed_stream -o $@
151
152
153 # guest memory access by mmap and example
154 #
155 libv3_guest_mem.a : v3_guest_mem.c v3_guest_mem.h v3_ctrl.h
156         $(CC) $(CFLAGS) -c v3_guest_mem.c 
157         $(AR) ruv libv3_guest_mem.a v3_guest_mem.o
158         rm -f v3_guest_mem.o
159
160 v3_guest_mem_example : v3_guest_mem_example.c libv3_guest_mem.a
161         $(CC) $(CFLAGS) $< -L. -lv3_guest_mem -o $@
162
163
164
165 #
166 # VNC support is compiled separately
167 #
168 v3_x0vncserver : 
169         @if [ -a x0vncserver ] ; \
170         then \
171                 cp x0vncserver v3_x0vncserver ; \
172         else \
173                 echo "In order to use v3_vncclient/server you must have" ; \
174                 echo "previously built or received palacios/linux_usr/x0vncserver" ; \
175         fi;
176
177 #
178 # GUI is compiled separately
179 #
180 v3_x0gui : 
181         @if [ -a gui/Palacios ] ; \
182         then \
183                 cp gui/Palacios v3_x0gui ; \
184         else \
185                 echo "In order to use v3_gui (the graphical interface)" ;\
186                 echo "you must first cd to palacios/linux_usr/gui" ;\
187                 echo "and compile it according to the README given there";\
188         fi;
189
190 #
191 # Cleanup and dependency builds are automated
192 #
193 clean:
194         rm -f $(BUILD_EXECS) $(BUILD_LIBS) $(COPIED_EXECS)
195
196 depend:
197         $(CC) -MM $(CFILES) -I../linux_module > .dependencies
198