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.


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