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
35 EXAMPLE_EXECS = v3_user_host_dev_example \
37 v3_user_keyed_stream_example \
38 v3_user_keyed_stream_file
41 # Currently experimental things
43 EXPERIMENTAL_EXECS = v3_simulate \
44 v3_inject_ecc_scrubber_mce \
53 # Things that have been built elsewhere - just for reference here
55 PRECOMPILED_EXECS = x0vncserver
57 COPIED_EXECS = v3_x0vncserver
60 # Libraries that we need to build
62 LIBS = libv3_user_host_dev.a libv3_user_keyed_stream.a
64 BUILD_EXECS = $(BASE_EXECS) $(EXAMPLE_EXECS) $(EXPERIMENTAL_EXECS)
68 CFILES = $(BUILD_EXECS:%=%.c) $(BUILD_LIBS:lib%.a=%.c)
74 CFLAGS += -I../linux_module
79 all: $(BUILD_EXECS) $(BUILD_LIBS) $(COPIED_EXECS)
83 # Most tools compile in a straightforward way
86 $(CC) $(CFLAGS) $< -o $@
90 # Console support requires curses
93 CURSES_CFLAGS = -DNCURSES_STATIC
97 $(CC) $(CFLAGS) $(CURSES_CFLAGS) $< -lcurses -o $@
99 v3_cons_sc: v3_cons_sc.c
100 $(CC) $(CFLAGS) $(CURSES_CFLAGS) $< -lcurses -o $@
105 # User host devices include a library and some examples
107 libv3_user_host_dev.a : v3_user_host_dev.c v3_user_host_dev.h v3_ctrl.h
108 $(CC) $(CFLAGS) -I../linux_module -c v3_user_host_dev.c
109 $(AR) ruv libv3_user_host_dev.a v3_user_host_dev.o
110 rm -f v3_user_host_dev.o
112 v3_user_host_dev_example : v3_user_host_dev_example.c libv3_user_host_dev.a
113 $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_host_dev -o $@
115 v3_os_debug : v3_os_debug.c libv3_user_host_dev.a
116 $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_host_dev -o $@
120 # User keyed stream support includes a library and examples
123 libv3_user_keyed_stream.a :: v3_user_keyed_stream.c v3_user_keyed_stream.h v3_ctrl.h
124 $(CC) $(CFLAGS) -I../linux_module -c v3_user_keyed_stream.c
125 $(AR) ruv libv3_user_keyed_stream.a v3_user_keyed_stream.o
126 rm -f v3_user_keyed_stream.o
129 v3_user_keyed_stream_example : v3_user_keyed_stream_example.c libv3_user_keyed_stream.a
130 $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_keyed_stream -o $@
132 v3_user_keyed_stream_file : v3_user_keyed_stream_file.c libv3_user_keyed_stream.a
133 $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_keyed_stream -o $@
138 # VNC support is compiled separately
140 v3_x0vncserver : x0vncserver
141 cp x0vncserver v3_x0vncserver
145 # Cleanup and dependency builds are automated
148 rm -f $(BUILD_EXECS) $(BUILD_LIBS) $(COPIED_EXECS)
151 $(CC) -MM $(CFILES) -I../linux_module > .dependencies