Lines of
Makefile
from check-in a101629cc6
that are changed by the sequence of edits moving toward
check-in a4f7828c1d:
1: CPPFLAGS := -I. -DUSE_TCL_STUBS=1 -DXVFS_DEBUG $(XVFS_ADD_CPPFLAGS)
2: CFLAGS := -fPIC -g3 -ggdb3 -Wall $(XVFS_ADD_CFLAGS)
3: LDFLAGS := $(XVFS_ADD_LDFLAGS)
4: LIBS := -ltclstub8.6
5: TCLSH := tclsh
6:
a101629cc6 2019-09-17 7: all: example.so example-client.so example-server.so
8:
9: example.c: $(shell find example -type f) $(shell find lib -type f) xvfs.c.rvt xvfs-create Makefile
10: ./xvfs-create --directory example --name example > example.c.new
11: mv example.c.new example.c
12:
13: example.o: example.c xvfs-core.h xvfs-core.c Makefile
14: $(CC) $(CPPFLAGS) -DXVFS_MODE_FLEXIBLE $(CFLAGS) -o example.o -c example.c
15:
16: example.so: example.o Makefile
17: $(CC) $(CFLAGS) $(LDFLAGS) -shared -o example.so example.o $(LIBS)
18:
19: example-client.o: example.c xvfs-core.h Makefile
20: $(CC) $(CPPFLAGS) -DXVFS_MODE_FLEXIBLE $(CFLAGS) -o example-client.o -c example.c
21:
22: example-client.so: example-client.o Makefile
23: $(CC) $(CFLAGS) $(LDFLAGS) -shared -o example-client.so example-client.o $(LIBS)
24:
a101629cc6 2019-09-17 25: example-server.o: xvfs-core.h xvfs-core.c Makefile
a101629cc6 2019-09-17 26: $(CC) $(CPPFLAGS) -DXVFS_MODE_SERVER $(CFLAGS) -o example-server.o -c xvfs-core.c
27:
a101629cc6 2019-09-17 28: example-server.so: example-server.o Makefile
a101629cc6 2019-09-17 29: $(CC) $(CFLAGS) $(LDFLAGS) -shared -o example-server.so example-server.o $(LIBS)
30:
31: # xvfs-create-standalone is a standalone (i.e., no external dependencies
32: # like lib/minirivet, xvfs-core.c, etc) version of "xvfs-create"
33: xvfs-create-standalone: $(shell find lib -type f) xvfs-create xvfs-core.c xvfs-core.h xvfs.c.rvt Makefile
34: rm -f xvfs-create-standalone.new xvfs-create-standalone
35: ./xvfs-create --dump-tcl --remove-debug > xvfs-create-standalone.new
36: chmod +x xvfs-create-standalone.new
37: mv xvfs-create-standalone.new xvfs-create-standalone
38:
a101629cc6 2019-09-17 39: test: example.so example-server.so example-client.so Makefile
40: rm -f __test__.tcl
41: echo 'if {[catch { load ./example.so Xvfs_example; source //xvfs:/example/main.tcl }]} { puts stderr $$::errorInfo; exit 1 }; exit 0' > __test__.tcl
42: $(GDB) $(TCLSH) __test__.tcl $(TCL_TEST_ARGS)
43: rm -f __test__.tcl
a101629cc6 2019-09-17 44: echo 'if {[catch { load ./example-server.so Xvfs; load ./example-client.so Xvfs_example; source //xvfs:/example/main.tcl }]} { puts stderr $$::errorInfo; exit 1 }; exit 0' > __test__.tcl
45: $(GDB) $(TCLSH) __test__.tcl $(TCL_TEST_ARGS)
46: rm -f __test__.tcl
47:
48: coverage:
49: $(MAKE) clean
50: $(MAKE) example.so XVFS_ADD_CFLAGS=-coverage XVFS_ADD_LDFLAGS=-coverage
51: $(MAKE) test XVFS_TEST_EXIT_ON_FAILURE=0
52: rm -f xvfs-test-coverage.info
53: lcov --capture --directory . --output-file xvfs-test-coverage.info
54: rm -rf xvfs-test-coverage
55: mkdir xvfs-test-coverage
56: genhtml xvfs-test-coverage.info --output-directory xvfs-test-coverage
57: rm -f xvfs-test-coverage.info
58:
59: clean:
60: rm -f xvfs-create-standalone.new xvfs-create-standalone
61: rm -f example.c example.c.new
62: rm -f example.so example.o
a101629cc6 2019-09-17 63: rm -f example-client.o example-server.o
a101629cc6 2019-09-17 64: rm -f example-client.so example-server.so
65: rm -f example.gcda example.gcno
66: rm -f __test__.tcl
67: rm -f xvfs-test-coverage.info
68: rm -rf xvfs-test-coverage
69:
70: distclean: clean
71:
72: .PHONY: all clean distclean test coverage