-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmaintMakefile.in
171 lines (160 loc) · 6.61 KB
/
maintMakefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#=============================================================================
#
# Maintainer stuff, you don't want to mess with this.
#
# In order to use this as-is, you'll need the following utilities:
#
# GNU make
# GNU which-2.x
# GNU date
# awk
# rcs2log
# cut
# grep
# test
# sed
#
# This maintainer Makefile provides the following functionality:
#
# Targets
# -------
#
# - debian
# Create a debian package.
#
# - full-check
# Iterate over multiple configurations and compiler versions,
# running the test suite for every combination.
#
# - documentation
# Does a `make' in doc/.
#
# The remaining targets can be used to test a part of the distribution process,
# but are not really useful on their own otherwise.
#
# - test-values
# Print debugging info about variables used in this file.
#
BUILT_SOURCES =
test-values:
@echo "srcdir = \"$(srcdir)\""
@echo "PACKAGE = \"@PACKAGE@\""
@echo "VERSION = \"@VERSION@\""
@echo "tarball target = \"@PACKAGE@-@VERSION@.tar.gz\""
## Make sure the ChangeLog is up to date in maintainer mode
.PHONY: ChangeLog documentation debian @PACKAGE@-@VERSION@.tar.gz
@PACKAGE@-@VERSION@.tar.gz:
RESULT=ok; \
for f in $$(tar tzf @PACKAGE@-@VERSION@.tar.gz | sed -e 's%^[^/]*/%%'); do \
test -e ../libcwd/$$f && test ../libcwd/$$f -nt @PACKAGE@-@VERSION@.tar.gz && echo 'WARNING: '$$f' is newer than @PACKAGE@-@VERSION@.tar.gz!' && RESULT=error; \
done; \
if test "$$RESULT" != "ok"; then \
echo "You must run: $(MAKE) dist"; \
exit -1; \
fi
debian: @PACKAGE@-@VERSION@.tar.gz
VER="$$(dpkg-parsechangelog -l$(srcdir)/debian/changelog | sed -n -e 's/-.*//;s/^Version: //p')"; \
if test "$$VER" != "@VERSION@"; then \
echo "The version in debian/changelog ($$VER) does not match @VERSION@." \
echo "Run (cd $(srcdir) && dch -v @VERSION@-1 && dch -r) and rebuild the tar ball!"; \
exit 1; \
fi
rm -rf debian-build
mkdir debian-build
cd debian-build; \
tar xzf ../@PACKAGE@-@VERSION@.tar.gz; \
tar czf @PACKAGE@_@VERSION@.orig.tar.gz --exclude debian @PACKAGE@-@VERSION@; \
cd @PACKAGE@-@VERSION@; \
dpkg-buildpackage -us -uc; \
cd ..; \
lintian @PACKAGE@_@VERSION@-1_amd64.changes
CCVERGIT=6.2.0
CCVERALL=$(CCVERGIT),5.4.0,4.9.4,4.8.5,4.8.0,4.7.4
CCVERMOST=$(CCVERGIT),5.4.0,4.9.4,4.8.0,4.7.4
# '--enable-maintainer-mode --with-redzone=1024 --compilers=$(CCVERGIT)' \
# '--enable-maintainer-mode --compilers=$(CCVERALL)' \
# '--enable-maintainer-mode --enable-debugt --enable-debugm --enable-debug --disable-debug-output --compilers=$(CCVERMOST)' \
# '--enable-maintainer-mode --enable-debugt --enable-debug --disable-debug-output --compilers=$(CCVERMOST)' \
# '--enable-maintainer-mode --enable-debugm --enable-debug --disable-debug-output --compilers=$(CCVERMOST)' \
# '--enable-maintainer-mode --enable-debug --disable-debug-output --compilers=$(CCVERMOST)' \
# '--enable-maintainer-mode --enable-debugm --compilers=$(CCVERMOST)' \
# '--enable-maintainer-mode --enable-debugt --enable-debugm --enable-debug --compilers=$(CCVERMOST)' \
# '--enable-maintainer-mode --enable-debugm --enable-debug --compilers=$(CCVERMOST)' \
full-check: Makefile
@( \
for c in \
'--enable-maintainer-mode --with-redzone=1024 --compilers=$(CCVERGIT)' \
'--enable-maintainer-mode --compilers=$(CCVERALL)' \
'--enable-maintainer-mode --enable-debugt --enable-debugm --enable-debug --disable-debug-output --compilers=$(CCVERMOST)' \
'--enable-maintainer-mode --enable-debugt --enable-debug --disable-debug-output --compilers=$(CCVERMOST)' \
'--enable-maintainer-mode --enable-debugm --enable-debug --disable-debug-output --compilers=$(CCVERMOST)' \
'--enable-maintainer-mode --enable-debug --disable-debug-output --compilers=$(CCVERMOST)' \
'--enable-maintainer-mode --enable-debugm --compilers=$(CCVERMOST)' \
'--enable-maintainer-mode --enable-debugt --enable-debugm --enable-debug --compilers=$(CCVERMOST)' \
'--enable-maintainer-mode --enable-debugm --enable-debug --compilers=$(CCVERMOST)' \
; do \
config=`echo $$c | sed -e 's/ --compilers=.*$$//'`; \
case "$$c" in \
*--disable-debug-output*) check=check ;; \
*--enable-debug\ *) check=run ;; \
*) check=check ;; \
esac; \
compilers=`echo $$c | sed -e 's/.* --compilers=//' -e 's/,/ /g'`; \
test -z "$$COMPILERS" || compilers="$$COMPILERS"; \
echo "*** CONFIGURATION OPTIONS: \"$$config\" (with compilers \"$$compilers\")"; \
for v in `echo $$compilers`; do \
case "$$v" in \
3*) cf="$$config --disable-threading" ;; \
*) cf="$$config" ;; \
esac; \
echo "*** COMPILER VERSION: \"$$v\""; \
echo -n "Configuring... "; \
if eval "CC=\"gcc-$$v\" CXX=\"g++-$$v\" $(srcdir)/configure $$cf >/dev/null"; then \
echo "done"; \
else \
echo "failed" && exit -1; \
fi; \
echo -n "Compiling... "; \
if make -j 4 >/dev/null; then \
echo "done"; \
else \
echo "failed" && exit -1; \
fi; \
cd testsuite >/dev/null; \
make clean >/dev/null; \
echo -n "Running \`/usr/bin/make RUNTESTFLAGS=\"\" $$check' in $(shell pwd)... "; \
if if /usr/bin/make -j1 RUNTESTFLAGS="" $$check 2>/dev/null; then \
echo "done"; \
else \
echo "*** FAILURE FOR \"$$cf\" USING g++-$$v" && exit -1; \
fi | grep -E '(FAIL|ERROR)'; then exit -1; else echo "ok"; fi; \
cd .. >/dev/null; \
done; \
done; \
)
documentation:
$(MAKE) -C doc
syncwww: documentation
@( \
if test -n "$(OUTPUT_DIRECTORY)" -a "$(OUTPUT_DIRECTORY)" != "."; then \
echo "Copying documentation to $(OUTPUT_DIRECTORY)"; \
rsync -rlptz -e /usr/bin/ssh --delete --exclude-from=$(srcdir)/doc/www/exclude --delete-excluded \
`pwd`/doc/ "$(OUTPUT_DIRECTORY)/libcwd"; \
fi \
)
@echo "Synchronizing with http://carlowood.github.io..."
@( \
cd $(OUTPUT_DIRECTORY); \
git add libcwd; \
git commit -m 'Update of documentation of libcwd.'; \
git push \
)
git-clean:
$(MAKE) -C doc maintainer-clean
(test -f example-project/Makefile && $(MAKE) -C example-project maintainer-clean) || true
$(MAKE) maintainer-clean
for d in doc/tutorial/examples5 doc/tutorial/examples7 doc/tutorial \
doc/styles doc/external doc \
example-project testsuite tests cutee utils include/libcwd include; do \
test ! -d $$d || rmdir --ignore-fail-on-non-empty $$d; \
done