Lines of
Makefile
from check-in 7225016a7e
that are changed by the sequence of edits moving toward
check-in 2139fe19a8:
1: TCL_CONFIG_SH := /usr/lib64/tclConfig.sh
7225016a7e 2019-09-17 2: CPPFLAGS := -I. -DUSE_TCL_STUBS=1 -DXVFS_DEBUG $(shell . "${TCL_CONFIG_SH}" && echo "$${TCL_INCLUDE_SPEC}") $(XVFS_ADD_CPPFLAGS)
3: CFLAGS := -fPIC -g3 -ggdb3 -Wall $(XVFS_ADD_CFLAGS)
4: LDFLAGS := $(XVFS_ADD_LDFLAGS)
5: LIBS := $(shell . "${TCL_CONFIG_SH}" && echo "$${TCL_STUB_LIB_SPEC}")
6: TCLSH := tclsh
7: LIB_SUFFIX := $(shell . "${TCL_CONFIG_SH}"; echo "$${TCL_SHLIB_SUFFIX:-.so}")
8:
9: all: example-standalone$(LIB_SUFFIX) example-client$(LIB_SUFFIX) example-flexible$(LIB_SUFFIX) xvfs$(LIB_SUFFIX)
10:
11: example.c: $(shell find example -type f) $(shell find lib -type f) xvfs.c.rvt xvfs-create Makefile
12: ./xvfs-create --directory example --name example > example.c.new
13: mv example.c.new example.c
14:
15: example-standalone.o: example.c xvfs-core.h xvfs-core.c Makefile
16: $(CC) $(CPPFLAGS) -DXVFS_MODE_STANDALONE $(CFLAGS) -o example-standalone.o -c example.c
17:
18: example-standalone$(LIB_SUFFIX): example-standalone.o Makefile
19: $(CC) $(CFLAGS) $(LDFLAGS) -shared -o example-standalone$(LIB_SUFFIX) example-standalone.o $(LIBS)
20:
21: example-client.o: example.c xvfs-core.h Makefile
22: $(CC) $(CPPFLAGS) -DXVFS_MODE_CLIENT $(CFLAGS) -o example-client.o -c example.c
23:
24: example-client$(LIB_SUFFIX): example-client.o Makefile
25: $(CC) $(CFLAGS) $(LDFLAGS) -shared -o example-client$(LIB_SUFFIX) example-client.o $(LIBS)
26:
27: example-flexible.o: example.c xvfs-core.h Makefile
28: $(CC) $(CPPFLAGS) -DXVFS_MODE_FLEXIBLE $(CFLAGS) -o example-flexible.o -c example.c
29:
30: example-flexible$(LIB_SUFFIX): example-flexible.o Makefile
31: $(CC) $(CFLAGS) $(LDFLAGS) -shared -o example-flexible$(LIB_SUFFIX) example-flexible.o $(LIBS)
32:
33: xvfs.o: xvfs-core.h xvfs-core.c Makefile
34: $(CC) $(CPPFLAGS) -DXVFS_MODE_SERVER $(CFLAGS) -o xvfs.o -c xvfs-core.c
35:
36: xvfs$(LIB_SUFFIX): xvfs.o Makefile
37: $(CC) $(CFLAGS) $(LDFLAGS) -shared -o xvfs$(LIB_SUFFIX) xvfs.o $(LIBS)
38:
39: # xvfs-create-standalone is a standalone (i.e., no external dependencies
40: # like lib/minirivet, xvfs-core.c, etc) version of "xvfs-create"
41: xvfs-create-standalone: $(shell find lib -type f) xvfs-create xvfs-core.c xvfs-core.h xvfs.c.rvt Makefile
42: rm -f xvfs-create-standalone.new xvfs-create-standalone
43: ./xvfs-create --dump-tcl --remove-debug > xvfs-create-standalone.new
44: chmod +x xvfs-create-standalone.new
45: mv xvfs-create-standalone.new xvfs-create-standalone
46:
47: benchmark:
48: $(MAKE) clean all XVFS_ADD_CPPFLAGS="-UXVFS_DEBUG" XVFS_ADD_CFLAGS="-g0 -ggdb0 -s -O3"
49: ./benchmark.tcl
50:
51: test: example-standalone$(LIB_SUFFIX) xvfs$(LIB_SUFFIX) example-client$(LIB_SUFFIX) example-flexible$(LIB_SUFFIX) Makefile
52: rm -f __test__.tcl
7225016a7e 2019-09-17 53: echo 'if {[catch { eval $$::env(XVFS_TEST_LOAD_COMMANDS); source //xvfs:/example/main.tcl }]} { puts stderr $$::errorInfo; exit 1 }; exit 0' > __test__.tcl
7225016a7e 2019-09-17 54: @export XVFS_TEST_LOAD_COMMANDS; for XVFS_TEST_LOAD_COMMANDS in \
55: 'load ./example-standalone$(LIB_SUFFIX) Xvfs_example' \
56: 'load -global ./xvfs$(LIB_SUFFIX); load ./example-client$(LIB_SUFFIX) Xvfs_example' \
57: 'load ./xvfs$(LIB_SUFFIX); load ./example-flexible$(LIB_SUFFIX) Xvfs_example' \
58: 'load ./example-flexible$(LIB_SUFFIX) Xvfs_example'; do \
59: echo "[$${XVFS_TEST_LOAD_COMMANDS}] $(GDB) $(TCLSH) __test__.tcl $(TCL_TEST_ARGS)"; \
60: $(GDB) $(TCLSH) __test__.tcl $(TCL_TEST_ARGS) || exit 1; \
61: done
62: rm -f __test__.tcl
63:
64: coverage:
65: $(MAKE) clean
66: $(MAKE) XVFS_ADD_CFLAGS=-coverage XVFS_ADD_LDFLAGS=-coverage
67: $(MAKE) test XVFS_TEST_EXIT_ON_FAILURE=0
68: rm -f xvfs-test-coverage.info
69: lcov --capture --directory . --output-file xvfs-test-coverage.info
70: rm -rf xvfs-test-coverage
71: mkdir xvfs-test-coverage
72: genhtml xvfs-test-coverage.info --output-directory xvfs-test-coverage
73: rm -f xvfs-test-coverage.info
74:
75: clean:
76: rm -f xvfs-create-standalone.new xvfs-create-standalone
77: rm -f example.c example.c.new
78: rm -f example-standalone$(LIB_SUFFIX) example-standalone.o
79: rm -f example-client.o example-client$(LIB_SUFFIX)
80: rm -f example-flexible.o example-flexible$(LIB_SUFFIX)
81: rm -f xvfs.o xvfs$(LIB_SUFFIX)
82: rm -f example-standalone.gcda example-standalone.gcno
83: rm -f example-client.gcda example-client.gcno
84: rm -f example-flexible.gcda example-flexible.gcno
85: rm -f xvfs.gcda xvfs.gcno
86: rm -f __test__.tcl
87: rm -f xvfs-test-coverage.info
88: rm -rf xvfs-test-coverage
89:
90: distclean: clean
91:
92: .PHONY: all clean distclean test coverage benchmark