forked from LibreDWG/libredwg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
265 lines (246 loc) · 9.08 KB
/
Makefile.am
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
## Makefile.am
##
## Copyright (C) 2010-2021 Free Software Foundation, Inc.
##
## This file is part of LibreDWG.
##
## LibreDWG is free software: you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## LibreDWG is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty
## of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
## See the GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src programs examples test
if HAVE_SWIG_PYTHON
if !DISABLE_BINDINGS
SUBDIRS += bindings
endif
endif
if HAVE_MAKEINFO
SUBDIRS += doc
endif
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-release
if DISABLE_BINDINGS
AM_DISTCHECK_CONFIGURE_FLAGS += --disable-bindings
endif
include_HEADERS = \
include/dwg.h \
include/dwg_api.h
pcdatadir = $(libdir)/pkgconfig
pcdata_DATA = libredwg.pc
BUILT_SOURCES = $(top_srcdir)/.version
LTEXEC = @LTEXEC@
VALGRIND_SUPPRESSIONS = @VALGRIND_SUPPRESSIONS@
VALGRIND_SUPPRESSIONS_FILE = @VALGRIND_SUPPRESSIONS_FILE@
VALGRIND_OPTS = --leak-check=full --show-reachable=no --num-callers=30
JSON_DIST = jsmn/jsmn.h jsmn/LICENSE jsmn/README.md
doc_DIST = README HACKING NEWS TODO
EXTRA_DIST = $(top_srcdir)/.version libredwg.spec Dockerfile \
dwg.in dxf.in dxf-allcvt.lsp dxf-allcvt.sh test-dxf.sh dxf-check dxfb-check json-check \
log.in svg.in rw.in logs-all-parallel.sh.in logs-all-serial.sh.in unknown.sh \
cmp-objs.pl \
build-aux/swig_python.patch \
$(JSON_DIST) \
$(VALGRIND_SUPPRESSIONS_FILE)
.PHONY: check-dwg check-dxf check-json check-dwg-valgrind \
regen-man man manual refman scan-build gcov \
unknown regen-unknown full-regen-unknown regen-gperf regen-dynapi
dist-hook:
echo dist-hook distdir="$(distdir)"
echo $(VERSION) > $(distdir)/.tarball-version
# automake bug, GH #211 (howto enable skip_mode_fix? tried now info-in-builddir)
#distcheck-hook:
# echo distcheck-hook distdir="$(distdir)"
# chmod u+w "$(distdir)/doc"
# chmod u+w "$(distdir)/doc/LibreDWG.info"
UNKNOWN_LOG = unknown-`git describe --long --tags --dirty --always`.log
UNKNOWN_SKIP = examples/alldwg.skip
TIMEOUT_30 = @TIMEOUT_30@
unknown:
-mv examples/alldwg.skip examples/alldwg.skip~
$(MAKE) -C src bits.lo && \
$(MAKE) -C examples unknown$(EXEEXT) bd$(EXEEXT) bits$(EXEEXT) && \
$(LTEXEC) examples/unknown$(EXEEXT) >$(UNKNOWN_LOG) 2>$(UNKNOWN_SKIP)
if test -s examples/alldwg.skip; then true; \
else mv examples/alldwg.skip~ examples/alldwg.skip; fi
if HAVE_PICAT
if HAVE_PARALLEL
-rm examples/*.pi.tmplog 2>/dev/null
echo $(PARALLEL) $(TIMEOUT_30) $(PICAT) "{} \\>{}.tmplog ::: examples/[A-Z]*.pi"
-$(PARALLEL) $(TIMEOUT_30) $(PICAT) {} \>{}.tmplog ::: examples/[A-Z]*.pi
-for f in examples/*.pi.tmplog; do \
if test -n "`grep 'Most probable result:' $$f`"; then \
mv $$f examples/`basename $$f .tmplog`.log; fi; done
-rm examples/*.pi.tmplog 2>/dev/null
else
-for f in examples/[A-Z]*.pi; do \
echo $(TIMEOUT_30) picat $$f; \
$(TIMEOUT_30) $(PICAT) $$f >$$f.tmplog; \
if test -n "`grep 'Most probable result:' $$f.tmplog`"; then \
mv $$f.tmplog $$f.log; fi; done
-rm examples/[A-Z]*.pi.tmplog 2>/dev/null
endif
endif
regen-dynapi: $(srcdir)/src/gen-dynapi.pl $(srcdir)/include/dwg.h
-$(PERL) $(srcdir)/src/gen-dynapi.pl
# $(MAKE) -C src $(abs_top_srcdir)/src/dxfclasses.c
regen-gperf:
-$(GPERF) --output-file src/dxfclasses.c src/dxfclasses.in
regen-unknown:
$(MAKE) -C examples $@
full-regen-unknown:
$(MAKE) -C examples $@
regen-man:
$(MAKE) -C programs $@
man:
$(MAKE) -C programs $@
manual:
$(MAKE) -C doc $@
refman:
$(MAKE) -C doc $@
regen-swig-patch:
$(MAKE) -C bindings/python
-difforig bindings/python/swig_python.c >xxxx
if test -s xxxx; then mv xxxx build-aux/swig_python.patch; fi
WEB_DIR = $(srcdir)/../libredwg-web
release-web: manual refman
if test -d $(WEB_DIR)/manual; then \
rsync -avzC $(srcdir)/doc/manual/* $(WEB_DIR)/manual/; \
rsync -avzC doc/refman/* $(WEB_DIR)/refman/; \
fi
-cd $(WEB_DIR) && \
cvs add -m"new with $(VERSION)" manual/index.html manual/LibreDWG.* manual/html_node/*.html \
refman/*.{html,js,png} refman/search/*.{html,js}; cd -
-cd $(WEB_DIR); cvs commit -m"update to $(VERSION)"; cd -
TESTS =
if HAVE_SHELLCHECK
# fragile, serial-tests only. SPEC_LOG_COMPILER does not work there,
# and parallel cannot do srcdir TESTS
TESTS += log dwg dxf json svg rw logs-all.sh dynapi_test_all.sh unit_testing_all.sh \
$(srcdir)/json-check $(srcdir)/dxf-check $(srcdir)/dxfb-check \
$(srcdir)/dxf-allcvt.sh $(srcdir)/test-dxf.sh $(srcdir)/unknown.sh \
programs/dwgfilter \
programs/alive.test programs/dxf.test programs/json.test programs/svg.test
TESTS_ENVIRONMENT = $(SHELLCHECK)
# TEST_EXTENSIONS = .sh
# SPEC_LOG_COMPILER = $(SHELLCHECK)
else
if HAVE_RPMLINT
# serial-tests only, see above. only with parallel-tests we can do both
TESTS += $(srcdir)/libredwg.spec
TESTS_ENVIRONMENT = $(RPMLINT)
# TEST_EXTENSIONS = .spec
# SPEC_LOG_COMPILER = $(RPMLINT)
endif
endif
check-dwg: all
-mv check-dwg.log check-dwg.log~ 2>/dev/null
for d in `find $(srcdir)/test/test-data -iname \*.dwg -size -40M`; do \
echo programs/dwgread -v3 $$d | tee -a check-dwg.log; \
$(LTEXEC) programs/dwgread -v3 $$d >> check-dwg.log 2>&1; \
done
check-dwg-valgrind: all
-mv check-dwg-valgrind.log check-dwg-valgrind.log~ 2>/dev/null
for d in `find $(srcdir)/test/test-data -iname \*.dwg -size -10M`; do \
echo $(VALGRIND) $(VALGRIND_OPTS) $(VALGRIND_SUPPRESSIONS) programs/dwgread $$d | tee -a check-dwg-valgrind.log; \
$(VALGRIND) $(VALGRIND_OPTS) $(VALGRIND_SUPPRESSIONS) $(LTEXEC) programs/dwgread $$d >> check-dwg-valgrind.log 2>&1; \
done
check-dxf: all
-for f in $(srcdir)/test/test-data/Drawing_*.dwg \
$(srcdir)/test/test-data/sample_*.dwg \
$(srcdir)/test/test-data/example_*.dwg; \
do \
env MAKEFLAGS= $(srcdir)/dxf-check $$f; \
done
-for d in r14 2000 2004 2007 2010 2013 2018; do \
for f in $(srcdir)/test/test-data/$$d/*.dwg; do \
env MAKEFLAGS= $(srcdir)/dxf-check $$f; \
done; \
done
check-dxfb: all
-for f in $(srcdir)/test/test-data/Drawing_*.dwg \
$(srcdir)/test/test-data/sample_*.dwg \
$(srcdir)/test/test-data/example_*.dwg; \
do \
env MAKEFLAGS= $(srcdir)/dxfb-check $$f; \
done
-for d in r14 2000 2004 2007 2010 2013 2018; do \
for f in $(srcdir)/test/test-data/$$d/*.dwg; do \
env MAKEFLAGS= $(srcdir)/dxfb-check $$f; \
done; \
done
check-json: all
-for f in $(srcdir)/test/test-data/Drawing_*.dwg \
$(srcdir)/test/test-data/sample_*.dwg \
$(srcdir)/test/test-data/example_*.dwg; \
do \
env MAKEFLAGS= $(srcdir)/json-check $$f; \
done
-for d in r14 2000 2004 2007 2010 2013 2018; do \
for f in $(srcdir)/test/test-data/$$d/*.dwg; do \
env MAKEFLAGS= $(srcdir)/json-check $$f; \
done; \
done
check-svg: all
-for f in $(srcdir)/test/test-data/Drawing_*.dwg \
$(srcdir)/test/test-data/sample_*.dwg \
$(srcdir)/test/test-data/example_*.dwg; \
do env MAKEFLAGS= ./svg $$f; done
-for d in r14 2000 2004 2007 2010 2013 2018; do \
for f in $(srcdir)/test/test-data/$$d/*.dwg; \
do env MAKEFLAGS= ./svg $$f; done; \
done
check-docker: dist
docker build --build-arg distdir="$(distdir)" --rm -t $(distdir) \
-f $(srcdir)/Dockerfile-dist .
# clang-analyzer.llvm.org, debian: clang-tools-{6.0,7}, redhat: clang-analyzer
SCAN_BUILD = scan-build
scan-build: clean
$(SCAN_BUILD) -V -o $(srcdir)/.analysis $(MAKE) -j4 &
if ENABLE_GCOV
gcov: check
$(MAKE) -C test gcov
$(MAKE) -C src gcov
$(MAKE) -C programs gcov
$(MAKE) -C examples gcov
cover: gcov
gcov2perl test/*/*.gcov src/*.gcov programs/*.gcov examples/*.gcov
cover -no-gcov
codecov: check
build-aux/codecov_io.sh -X test -X bindings
coveralls: gcov
coveralls -e test -e bindings
endif
$(BUILT_SOURCES):
echo $(VERSION) > $@-t && mv $@-t $@
CLEANFILES = check-dwg.log check-dwg-valgrind.log check-dxf.log \
check-dwg.log~ check-dwg-valgrind.log~ check-dxf.log~ \
*_20*.dxf *_r1*.dxf example_*.dxf.log
if ENABLE_GCOV
CLEANFILES += codecov_io.sh *.gcov
endif
DISTCLEANFILES = logs-all.sh dynapi_test_all.sh unit_testing_all.sh log json dwg dxf svg rw libredwg.pc
MAINTAINERCLEANFILES = *~ *.log *.dxf *.json *.dwg cover_db .analysis
maintainer-clean-local:
-rm -rf cover_db
LIBTOOL_DISTCLEAN_FILES = \
m4/libtool.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4 \
build-aux/compile \
build-aux/config.guess \
build-aux/config.sub \
build-aux/depcomp \
build-aux/install-sh \
build-aux/ltmain.sh \
build-aux/missing \
build-aux/py-compile \
build-aux/textinfo.tex
# cannot uninstall the generated perllocal.pod and share/info/dir
distuninstallcheck:
@: