Lines of
Makefile
from check-in d1ae68c7a1
that are changed by the sequence of edits moving toward
check-in 2f92a3a715:
1: TCL_CONFIG_SH := /usr/lib64/tclConfig.sh
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: test: example-standalone$(LIB_SUFFIX) xvfs$(LIB_SUFFIX) example-client$(LIB_SUFFIX) example-flexible$(LIB_SUFFIX) Makefile
48: rm -f __test__.tcl
49: echo 'if {[catch { eval $$::env(XVFS_TEST_LOAD_COMMANDS); source //xvfs:/example/main.tcl }]} { puts stderr $$::errorInfo; exit 1 }; exit 0' > __test__.tcl
50: @export XVFS_TEST_LOAD_COMMANDS; for XVFS_TEST_LOAD_COMMANDS in \
51: 'load ./example-standalone$(LIB_SUFFIX) Xvfs_example' \
52: 'load -global ./xvfs$(LIB_SUFFIX); load ./example-client$(LIB_SUFFIX) Xvfs_example' \
53: 'load ./xvfs$(LIB_SUFFIX); load ./example-flexible$(LIB_SUFFIX) Xvfs_example' \
54: 'load ./example-flexible$(LIB_SUFFIX) Xvfs_example'; do \
55: echo "[$${XVFS_TEST_LOAD_COMMANDS}] $(GDB) $(TCLSH) __test__.tcl $(TCL_TEST_ARGS)"; \
56: $(GDB) $(TCLSH) __test__.tcl $(TCL_TEST_ARGS) || exit 1; \
57: done
58: rm -f __test__.tcl
59:
60: coverage:
61: $(MAKE) clean
62: $(MAKE) XVFS_ADD_CFLAGS=-coverage XVFS_ADD_LDFLAGS=-coverage
63: $(MAKE) test XVFS_TEST_EXIT_ON_FAILURE=0
64: rm -f xvfs-test-coverage.info
65: lcov --capture --directory . --output-file xvfs-test-coverage.info
66: rm -rf xvfs-test-coverage
67: mkdir xvfs-test-coverage
68: genhtml xvfs-test-coverage.info --output-directory xvfs-test-coverage
69: rm -f xvfs-test-coverage.info
70:
71: clean:
72: rm -f xvfs-create-standalone.new xvfs-create-standalone
73: rm -f example.c example.c.new
74: rm -f example-standalone$(LIB_SUFFIX) example-standalone.o
75: rm -f example-client.o example-client$(LIB_SUFFIX)
76: rm -f example-flexible.o example-flexible$(LIB_SUFFIX)
77: rm -f xvfs.o xvfs$(LIB_SUFFIX)
d1ae68c7a1 2019-09-17 78: rm -f example.gcda example.gcno
79: rm -f __test__.tcl
80: rm -f xvfs-test-coverage.info
81: rm -rf xvfs-test-coverage
82:
83: distclean: clean
84:
85: .PHONY: all clean distclean test coverage