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
31 EXAMPLE_EXECS = v3_user_host_dev_example \
33 v3_user_keyed_stream_example \
34 v3_user_keyed_stream_file \
37 # Currently experimental things
39 EXPERIMENTAL_EXECS = v3_simulate \
40 v3_inject_ecc_scrubber_mce
43 # Things that have been built elsewhere - just for reference here
45 PRECOMPILED_EXECS = x0vncserver
47 COPIED_EXECS = v3_vncserver
50 # Libraries that we need to build
52 LIBS = libv3_user_host_dev.a libv3_user_keyed_stream.a
54 BUILD_EXECS = $(BASE_EXECS) $(EXAMPLE_EXECS) $(EXPERIMENTAL_EXECS)
58 CFILES = $(BUILD_EXECS:%=%.c) $(BUILD_LIBS:lib%.a=%.c)
67 all: $(BUILD_EXECS) $(BUILD_LIBS) $(COPIED_EXECS)
71 # Most tools compile in a straightforward way
74 $(CC) $(CFLAGS) $< -o $@
78 # Console support requires curses
81 CURSES_CFLAGS = -DNCURSES_STATIC
85 $(CC) $(CFLAGS) $(CURSES_CFLAGS) $< -lcurses -o $@
87 v3_cons_sc: v3_cons_sc.c
88 $(CC) $(CFLAGS) $(CURSES_CFLAGS) $< -lcurses -o $@
93 # User host devices include a library and some examples
95 libv3_user_host_dev.a : v3_user_host_dev.c v3_user_host_dev.h v3_ctrl.h
96 $(CC) $(CFLAGS) -I../linux_module -c v3_user_host_dev.c
97 $(AR) ruv libv3_user_host_dev.a v3_user_host_dev.o
98 rm -f v3_user_host_dev.o
100 v3_user_host_dev_example : v3_user_host_dev_example.c libv3_user_host_dev.a
101 $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_host_dev -o $@
103 v3_os_debug : v3_os_debug.c libv3_user_host_dev.a
104 $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_host_dev -o $@
108 # User keyed stream support includes a library and examples
111 libv3_user_keyed_stream.a :: v3_user_keyed_stream.c v3_user_keyed_stream.h v3_ctrl.h
112 $(CC) $(CFLAGS) -I../linux_module -c v3_user_keyed_stream.c
113 $(AR) ruv libv3_user_keyed_stream.a v3_user_keyed_stream.o
114 rm -f v3_user_keyed_stream.o
117 v3_user_keyed_stream_example : v3_user_keyed_stream_example.c libv3_user_keyed_stream.a
118 $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_keyed_stream -o $@
120 v3_user_keyed_stream_file : v3_user_keyed_stream_file.c libv3_user_keyed_stream.a
121 $(CC) $(CFLAGS) $< -I../linux_module -L. -lv3_user_keyed_stream -o $@
126 # VNC support is compiled separately
128 v3_vncserver : x0vncserver
129 cp x0vncserver v3_vncserver
133 # Cleanup and dependency builds are automated
136 rm -f $(BUILD_EXECS) $(BUILD_LIBS) $(COPIED_EXECS)
139 $(CC) -MM $(CFILES) -I../linux_module > .dependencies
141 include .dependencies