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
64 # Libraries that we need to build
66 LIBS = libv3_user_host_dev.a libv3_user_keyed_stream.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)
87 # Most tools compile in a straightforward way
90 $(CC) $(CFLAGS) $< -o $@
94 # Console support requires curses
97 CURSES_CFLAGS = -DNCURSES_STATIC
101 $(CC) $(CFLAGS) $(CURSES_CFLAGS) $< -lcurses -o $@
103 v3_cons_sc: v3_cons_sc.c
104 $(CC) $(CFLAGS) $(CURSES_CFLAGS) $< -lcurses -o $@
109 # User host devices include a library and some examples
111 libv3_user_host_dev.a : v3_user_host_dev.c v3_user_host_dev.h v3_ctrl.h
112 $(CC) $(CFLAGS) -I../linux_module -c v3_user_host_dev.c
113 $(AR) ruv libv3_user_host_dev.a v3_user_host_dev.o
114 rm -f v3_user_host_dev.o
116 v3_user_host_dev_example : v3_user_host_dev_example.c libv3_user_host_dev.a
117 $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_host_dev -o $@
119 v3_os_debug : v3_os_debug.c libv3_user_host_dev.a
120 $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_host_dev -o $@
124 # User keyed stream support includes a library and examples
127 libv3_user_keyed_stream.a :: v3_user_keyed_stream.c v3_user_keyed_stream.h v3_ctrl.h
128 $(CC) $(CFLAGS) -I../linux_module -c v3_user_keyed_stream.c
129 $(AR) ruv libv3_user_keyed_stream.a v3_user_keyed_stream.o
130 rm -f v3_user_keyed_stream.o
133 v3_user_keyed_stream_example : v3_user_keyed_stream_example.c libv3_user_keyed_stream.a
134 $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_keyed_stream -o $@
136 v3_user_keyed_stream_file : v3_user_keyed_stream_file.c libv3_user_keyed_stream.a
137 $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_keyed_stream -o $@
142 # VNC support is compiled separately
144 v3_x0vncserver : x0vncserver
145 cp x0vncserver v3_x0vncserver
149 # Cleanup and dependency builds are automated
152 rm -f $(BUILD_EXECS) $(BUILD_LIBS) $(COPIED_EXECS)
155 $(CC) -MM $(CFILES) -I../linux_module > .dependencies