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