doc update
[platform/upstream/libtasn1.git] / cfg.mk
1 # Copyright (C) 2006-2014 Free Software Foundation, Inc.
2 # Author: Simon Josefsson
3 #
4 # This file is part of LIBTASN1.
5 #
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19 WFLAGS ?= --enable-gcc-warnings
20 ADDFLAGS ?=
21 CFGFLAGS ?= --enable-gtk-doc --enable-gtk-doc-pdf $(ADDFLAGS) $(WFLAGS)
22
23 INDENT_SOURCES = `find . -name \*.[ch]|grep -v -e ^./gl -e ^./lib/gl -e ^./build-aux/ -e ^./lib/ASN1.c -e ^./tests/Test_tree_asn1_tab.c`
24
25 ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile)
26 .DEFAULT_GOAL := bootstrap
27 endif
28
29 local-checks-to-skip = sc_prohibit_strcmp sc_prohibit_have_config_h     \
30         sc_require_config_h sc_require_config_h_first                   \
31         sc_immutable_NEWS sc_prohibit_magic_number_exit                 \
32         sc_bindtextdomain
33 VC_LIST_ALWAYS_EXCLUDE_REGEX = ^(maint.mk|gtk-doc.make|build-aux/.*|gl/.*|lib/gllib/.*|lib/glm4/.*|lib/ASN1\.c|m4/pkg.m4|doc/gdoc|windows/.*|doc/fdl-1.3.texi)$$
34 update-copyright-env = UPDATE_COPYRIGHT_USE_INTERVALS=1
35
36 # Explicit syntax-check exceptions.
37 exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^tests/TestIndef.p12$$
38 exclude_file_name_regexp--sc_GPL_version = ^lib/libtasn1.h$$
39 exclude_file_name_regexp--sc_program_name = ^tests/|examples/
40 exclude_file_name_regexp--sc_prohibit_atoi_atof = ^src/asn1Coding.c|src/asn1Decoding.c$$
41 exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^tests/crlf.cer|tests/TestIndef.p12$$
42 exclude_file_name_regexp--sc_error_message_uppercase = ^tests/Test_tree.c$$
43 exclude_file_name_regexp--sc_unmarked_diagnostics = ^tests/Test_tree.c$$
44
45 bootstrap-tools := autoconf,automake,libtool,bison
46 gpg_key_ID = b565716f
47
48 autoreconf:
49         touch ChangeLog
50         test -f ./configure || autoreconf --install
51
52 bootstrap: autoreconf
53         ./configure $(CFGFLAGS)
54
55 review-diff:
56         git diff `git describe --abbrev=0`.. \
57         | grep -v -e ^index -e '^diff --git' \
58         | filterdiff -p 1 -x 'gl/*' -x 'build-aux/*' -x 'lib/gl*' -x 'po/*' -x 'maint.mk' -x '.gitignore' -x '.x-sc*' -x ChangeLog -x GNUmakefile -x 'lib/ASN1.c' \
59         | less
60
61 # Release
62
63 htmldir = ../www-$(PACKAGE)
64
65 coverage-copy:
66         rm -fv `find $(htmldir)/coverage -type f | grep -v CVS`
67         mkdir -p $(htmldir)/coverage/
68         cp -rv $(COVERAGE_OUT)/* $(htmldir)/coverage/
69
70 coverage-upload:
71         cd $(htmldir) && \
72         find coverage -type d -! -name CVS -! -name '.' \
73                 -exec cvs add {} \; && \
74         find coverage -type d -! -name CVS -! -name '.' \
75                 -exec sh -c "cvs add -kb {}/*.png" \; && \
76         find coverage -type d -! -name CVS -! -name '.' \
77                 -exec sh -c "cvs add {}/*.html" \; && \
78         cvs add coverage/libtasn1.info coverage/gcov.css || true && \
79         cvs commit -m "Update." coverage
80
81 clang:
82         make clean
83         scan-build ./configure
84         rm -rf scan.tmp
85         scan-build -o scan.tmp make
86
87 clang-copy:
88         rm -fv `find $(htmldir)/clang-analyzer -type f | grep -v CVS`
89         mkdir -p $(htmldir)/clang-analyzer/
90         cp -rv scan.tmp/*/* $(htmldir)/clang-analyzer/
91
92 clang-upload:
93         cd $(htmldir) && \
94                 cvs add clang-analyzer || true && \
95                 cvs add clang-analyzer/*.css clang-analyzer/*.js \
96                         clang-analyzer/*.html || true && \
97                 cvs commit -m "Update." clang-analyzer
98
99 cyclo-copy:
100         cp -v doc/cyclo/cyclo-$(PACKAGE).html $(htmldir)/cyclo/index.html
101
102 cyclo-upload:
103         cd $(htmldir) && cvs commit -m "Update." cyclo/index.html
104
105 gendoc-copy:
106         cd doc && $(SHELL) ../build-aux/gendocs.sh \
107                 --html "--css-include=texinfo.css" \
108                 -o ../$(htmldir)/manual/ $(PACKAGE) "$(PACKAGE_NAME)"
109
110 gendoc-upload:
111         cd $(htmldir) && \
112                 cvs add manual || true && \
113                 cvs add manual/html_node || true && \
114                 cvs add -kb manual/*.gz manual/*.pdf || true && \
115                 cvs add manual/*.txt manual/*.html \
116                         manual/html_node/*.html || true && \
117                 cvs commit -m "Update." manual/
118
119 gtkdoc-copy:
120         mkdir -p $(htmldir)/reference/
121         cp -v doc/reference/$(PACKAGE).pdf \
122                 doc/reference/html/*.html \
123                 doc/reference/html/*.png \
124                 doc/reference/html/*.devhelp2 \
125                 doc/reference/html/*.css \
126                 $(htmldir)/reference/
127
128 gtkdoc-upload:
129         cd $(htmldir) && \
130                 cvs add reference || true && \
131                 cvs add -kb reference/*.png reference/*.pdf || true && \
132                 cvs add reference/*.html reference/*.css \
133                         reference/*.devhelp2 || true && \
134                 cvs commit -m "Update." reference/
135
136 ChangeLog:
137         git2cl > ChangeLog
138         cat .clcopying >> ChangeLog
139
140 tag = $(PACKAGE)_`echo $(VERSION) | sed 's/\./_/g'`
141
142 tarball:
143         ! git tag -l $(tag) | grep $(PACKAGE) > /dev/null
144         rm -f ChangeLog
145         $(MAKE) ChangeLog distcheck
146
147 libtasn14win:
148         cd windows && make -f libtasn14win.mk libtasn14win VERSION=$(VERSION)
149
150 libtasn14win-upload:
151         cd windows && make -f libtasn14win.mk upload VERSION=$(VERSION)
152
153 source:
154         git tag -u b565716f -m $(VERSION) $(tag)
155
156 release-check: syntax-check tarball libtasn14win gendoc-copy gtkdoc-copy coverage coverage-copy clang clang-copy
157
158 release-upload-www: gendoc-upload gtkdoc-upload coverage-upload clang-upload
159
160 release-upload-ftp:
161         build-aux/gnupload --to ftp.gnu.org:$(PACKAGE) $(distdir).tar.gz
162         cp $(distdir).tar.gz $(distdir).tar.gz.sig ../releases/$(PACKAGE)/
163         git push
164         git push --tags
165
166 release: release-check release-upload-www source release-upload-ftp libtasn14win-upload