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.


Rebuild v3_create by default
[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
44 #
45 # Currently experimental things
46 #
47 EXPERIMENTAL_EXECS =    v3_simulate  \
48                         v3_inject_ecc_scrubber_mce  \
49                         v3_top_inject \
50                         v3_env_inject \
51                         v3_syscall
52
53
54
55
56 #
57 # Things that have been built elsewhere - just for reference here
58 #
59 PRECOMPILED_EXECS = x0vncserver
60
61 COPIED_EXECS = v3_x0vncserver
62
63 #
64 # Libraries that we need to build
65 #
66 LIBS = libv3_user_host_dev.a libv3_user_keyed_stream.a libv3_ctrl.a
67
68 BUILD_EXECS = $(BASE_EXECS) $(EXAMPLE_EXECS) $(EXPERIMENTAL_EXECS) 
69 BUILD_LIBS = $(LIBS)
70
71
72 CFILES = $(BUILD_EXECS:%=%.c) $(BUILD_LIBS:lib%.a=%.c) 
73
74 ifeq ($(STATIC),1)
75   CFLAGS += -static 
76 endif
77
78 CFLAGS += -I../linux_module
79
80 CC = gcc
81 AR = ar
82
83 all: $(BUILD_EXECS) $(BUILD_LIBS) $(COPIED_EXECS)
84
85
86 libv3_ctrl.a : v3_ctrl.c v3_ctrl.h
87         $(CC) $(CFLAGS) -I../linux_module -c v3_ctrl.c
88         $(AR) ruv libv3_ctrl.a v3_ctrl.o
89         rm -rf v3_ctrl.o 
90
91 #
92 # Most tools compile in a straightforward way
93 #
94 % :: %.c v3_ctrl.h libv3_ctrl.a
95         $(CC) $(CFLAGS) $< -lv3_ctrl -L. -o $@
96
97
98 #
99 # Console support requires curses
100 #
101 ifeq ($(STATIC),1)
102   CURSES_CFLAGS = -DNCURSES_STATIC
103   CURSES_LIBS = -ltermcap
104 endif
105
106 v3_cons: v3_cons.c
107         $(CC) $(CFLAGS) $(CURSES_CFLAGS) $< -lcurses $(CURSES_LIBS) -o $@
108
109 v3_cons_sc: v3_cons_sc.c
110         $(CC) $(CFLAGS) $(CURSES_CFLAGS) $< -lcurses $(CURSES_LIBS) -o $@
111
112 v3_create: v3_create.c ezxml.c libv3_ctrl.a 
113         $(CC) $(CFLAGS) $^ -lv3_ctrl -L. -o $@
114
115
116
117 #
118 # User host devices include a library and some examples
119 #
120 libv3_user_host_dev.a : v3_user_host_dev.c v3_user_host_dev.h v3_ctrl.h
121         $(CC) $(CFLAGS) -I../linux_module -c v3_user_host_dev.c 
122         $(AR) ruv libv3_user_host_dev.a v3_user_host_dev.o
123         rm -f v3_user_host_dev.o
124
125 v3_user_host_dev_example : v3_user_host_dev_example.c libv3_user_host_dev.a
126         $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_host_dev -o $@
127
128 v3_os_debug : v3_os_debug.c libv3_user_host_dev.a
129         $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_host_dev -o $@
130
131
132 #
133 # User keyed stream support includes a library and examples
134 #
135 #
136 libv3_user_keyed_stream.a :: v3_user_keyed_stream.c v3_user_keyed_stream.h v3_ctrl.h
137         $(CC) $(CFLAGS) -I../linux_module -c v3_user_keyed_stream.c 
138         $(AR) ruv libv3_user_keyed_stream.a v3_user_keyed_stream.o
139         rm -f v3_user_keyed_stream.o
140
141
142 v3_user_keyed_stream_example : v3_user_keyed_stream_example.c libv3_user_keyed_stream.a
143         $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_keyed_stream -o $@
144
145 v3_user_keyed_stream_file : v3_user_keyed_stream_file.c libv3_user_keyed_stream.a
146         $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_keyed_stream -o $@
147
148
149
150 #
151 # VNC support is compiled separately
152 #
153 v3_x0vncserver : x0vncserver
154         cp x0vncserver v3_x0vncserver
155
156
157 #
158 # Cleanup and dependency builds are automated
159 #
160 clean:
161         rm -f $(BUILD_EXECS) $(BUILD_LIBS) $(COPIED_EXECS)
162
163 depend:
164         $(CC) -MM $(CFILES) -I../linux_module > .dependencies
165