2 # Build Static or Dynamic versions of the control utilities
6 # define this at the command-line or here
7 # to get dynamically linked versions
11 # Executables that implement core functionality
39 EXAMPLE_EXECS = v3_user_host_dev_example \
41 v3_user_keyed_stream_example \
42 v3_user_keyed_stream_file
45 # Currently experimental things
47 EXPERIMENTAL_EXECS = v3_simulate \
48 v3_inject_ecc_scrubber_mce \
57 # Things that have been built elsewhere - just for reference here
59 PRECOMPILED_EXECS = x0vncserver
61 COPIED_EXECS = v3_x0vncserver v3_x0gui
64 # Libraries that we need to build
66 LIBS = libv3_user_host_dev.a libv3_user_keyed_stream.a libv3_ctrl.a
68 BUILD_EXECS = $(BASE_EXECS) $(EXAMPLE_EXECS) $(EXPERIMENTAL_EXECS)
72 CFILES = $(BUILD_EXECS:%=%.c) $(BUILD_LIBS:lib%.a=%.c)
78 CFLAGS += -I../linux_module
83 all: $(BUILD_EXECS) $(BUILD_LIBS) $(COPIED_EXECS)
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
92 # Most tools compile in a straightforward way
94 % :: %.c v3_ctrl.h libv3_ctrl.a
95 $(CC) $(CFLAGS) $< -lv3_ctrl -L. -o $@
99 # Console support requires curses
102 CURSES_CFLAGS = -DNCURSES_STATIC
103 CURSES_LIBS = -lcurses
106 CURSES_LIBS = -lcurses
110 $(CC) $(CFLAGS) $(CURSES_CFLAGS) $< $(CURSES_LIBS) -o $@
112 v3_cons_sc: v3_cons_sc.c
113 $(CC) $(CFLAGS) $(CURSES_CFLAGS) $< $(CURSES_LIBS) -o $@
115 v3_create: v3_create.c ezxml.c libv3_ctrl.a
116 $(CC) $(CFLAGS) $^ -lv3_ctrl -L. -o $@
121 # User host devices include a library and some examples
123 libv3_user_host_dev.a : v3_user_host_dev.c v3_user_host_dev.h v3_ctrl.h
124 $(CC) $(CFLAGS) -I../linux_module -c v3_user_host_dev.c
125 $(AR) ruv libv3_user_host_dev.a v3_user_host_dev.o
126 rm -f v3_user_host_dev.o
128 v3_user_host_dev_example : v3_user_host_dev_example.c libv3_user_host_dev.a
129 $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_host_dev -o $@
131 v3_os_debug : v3_os_debug.c libv3_user_host_dev.a
132 $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_host_dev -o $@
136 # User keyed stream support includes a library and examples
139 libv3_user_keyed_stream.a :: v3_user_keyed_stream.c v3_user_keyed_stream.h v3_ctrl.h
140 $(CC) $(CFLAGS) -I../linux_module -c v3_user_keyed_stream.c
141 $(AR) ruv libv3_user_keyed_stream.a v3_user_keyed_stream.o
142 rm -f v3_user_keyed_stream.o
145 v3_user_keyed_stream_example : v3_user_keyed_stream_example.c libv3_user_keyed_stream.a
146 $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_keyed_stream -o $@
148 v3_user_keyed_stream_file : v3_user_keyed_stream_file.c libv3_user_keyed_stream.a
149 $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_keyed_stream -o $@
154 # VNC support is compiled separately
157 @if [ -a x0vncserver ] ; \
159 cp x0vncserver v3_x0vncserver ; \
161 echo "In order to use v3_vncclient/server you must have" ; \
162 echo "previously built or received palacios/linux_usr/x0vncserver" ; \
166 # GUI is compiled separately
169 @if [ -a gui/Palacios ] ; \
171 cp gui/Palacios v3_x0gui ; \
173 echo "In order to use v3_gui (the graphical interface)" ;\
174 echo "you must first cd to palacios/linux_usr/gui" ;\
175 echo "and compile it according to the README given there";\
179 # Cleanup and dependency builds are automated
182 rm -f $(BUILD_EXECS) $(BUILD_LIBS) $(COPIED_EXECS)
185 $(CC) -MM $(CFILES) -I../linux_module > .dependencies