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
38 EXAMPLE_EXECS = v3_user_host_dev_example \
40 v3_user_keyed_stream_example \
41 v3_user_keyed_stream_file
44 # Currently experimental things
46 EXPERIMENTAL_EXECS = v3_simulate \
47 v3_inject_ecc_scrubber_mce \
56 # Things that have been built elsewhere - just for reference here
58 PRECOMPILED_EXECS = x0vncserver
60 COPIED_EXECS = v3_x0vncserver
63 # Libraries that we need to build
65 LIBS = libv3_user_host_dev.a libv3_user_keyed_stream.a libv3_ctrl.a
67 BUILD_EXECS = $(BASE_EXECS) $(EXAMPLE_EXECS) $(EXPERIMENTAL_EXECS)
71 CFILES = $(BUILD_EXECS:%=%.c) $(BUILD_LIBS:lib%.a=%.c)
77 CFLAGS += -I../linux_module
82 all: $(BUILD_EXECS) $(BUILD_LIBS) $(COPIED_EXECS)
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
91 # Most tools compile in a straightforward way
93 % :: %.c v3_ctrl.h libv3_ctrl.a
94 $(CC) $(CFLAGS) $< -lv3_ctrl -L. -o $@
98 # Console support requires curses
101 CURSES_CFLAGS = -DNCURSES_STATIC
102 CURSES_LIBS = -ltermcap
106 $(CC) $(CFLAGS) $(CURSES_CFLAGS) $< -lcurses $(CURSES_LIBS) -o $@
108 v3_cons_sc: v3_cons_sc.c
109 $(CC) $(CFLAGS) $(CURSES_CFLAGS) $< -lcurses $(CURSES_LIBS) -o $@
111 v3_create: v3_create.c ezxml.c libv3_ctrl.a
112 $(CC) $(CFLAGS) $^ -lv3_ctrl -L. -o $@
117 # User host devices include a library and some examples
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
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 $@
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 $@
132 # User keyed stream support includes a library and examples
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
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 $@
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 $@
150 # VNC support is compiled separately
152 v3_x0vncserver : x0vncserver
153 cp x0vncserver v3_x0vncserver
157 # Cleanup and dependency builds are automated
160 rm -f $(BUILD_EXECS) $(BUILD_LIBS) $(COPIED_EXECS)
163 $(CC) -MM $(CFILES) -I../linux_module > .dependencies