Update copyright years.
[platform/upstream/libtasn1.git] / cfg.mk
1 # Copyright (C) 2006-2013 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
43 bootstrap-tools := autoconf,automake,libtool,bison
44 gpg_key_ID = b565716f
45
46 autoreconf:
47         touch ChangeLog
48         test -f ./configure || autoreconf --install
49
50 bootstrap: autoreconf
51         ./configure $(CFGFLAGS)
52
53 review-diff:
54         git diff `git describe --abbrev=0`.. \
55         | grep -v -e ^index -e '^diff --git' \
56         | 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' \
57         | less
58
59 # Release
60
61 htmldir = ../www-$(PACKAGE)
62
63 coverage-copy:
64         rm -fv `find $(htmldir)/coverage -type f | grep -v CVS`
65         mkdir -p $(htmldir)/coverage/
66         cp -rv $(COVERAGE_OUT)/* $(htmldir)/coverage/
67
68 coverage-upload:
69         cd $(htmldir) && \
70         find coverage -type d -! -name CVS -! -name '.' \
71                 -exec cvs add {} \; && \
72         find coverage -type d -! -name CVS -! -name '.' \
73                 -exec sh -c "cvs add -kb {}/*.png" \; && \
74         find coverage -type d -! -name CVS -! -name '.' \
75                 -exec sh -c "cvs add {}/*.html" \; && \
76         cvs add coverage/libtasn1.info coverage/gcov.css || true && \
77         cvs commit -m "Update." coverage
78
79 clang:
80         make clean
81         scan-build ./configure
82         rm -rf scan.tmp
83         scan-build -o scan.tmp make
84
85 clang-copy:
86         rm -fv `find $(htmldir)/clang-analyzer -type f | grep -v CVS`
87         mkdir -p $(htmldir)/clang-analyzer/
88         cp -rv scan.tmp/*/* $(htmldir)/clang-analyzer/
89
90 clang-upload:
91         cd $(htmldir) && \
92                 cvs add clang-analyzer || true && \
93                 cvs add clang-analyzer/*.css clang-analyzer/*.js \
94                         clang-analyzer/*.html || true && \
95                 cvs commit -m "Update." clang-analyzer
96
97 cyclo-copy:
98         cp -v doc/cyclo/cyclo-$(PACKAGE).html $(htmldir)/cyclo/index.html
99
100 cyclo-upload:
101         cd $(htmldir) && cvs commit -m "Update." cyclo/index.html
102
103 gendoc-copy:
104         cd doc && $(SHELL) ../build-aux/gendocs.sh \
105                 --html "--css-include=texinfo.css" \
106                 -o ../$(htmldir)/manual/ $(PACKAGE) "$(PACKAGE_NAME)"
107
108 gendoc-upload:
109         cd $(htmldir) && \
110                 cvs add manual || true && \
111                 cvs add manual/html_node || true && \
112                 cvs add -kb manual/*.gz manual/*.pdf || true && \
113                 cvs add manual/*.txt manual/*.html \
114                         manual/html_node/*.html || true && \
115                 cvs commit -m "Update." manual/
116
117 gtkdoc-copy:
118         mkdir -p $(htmldir)/reference/
119         cp -v doc/reference/$(PACKAGE).pdf \
120                 doc/reference/html/*.html \
121                 doc/reference/html/*.png \
122                 doc/reference/html/*.devhelp2 \
123                 doc/reference/html/*.css \
124                 $(htmldir)/reference/
125
126 gtkdoc-upload:
127         cd $(htmldir) && \
128                 cvs add reference || true && \
129                 cvs add -kb reference/*.png reference/*.pdf || true && \
130                 cvs add reference/*.html reference/*.css \
131                         reference/*.devhelp2 || true && \
132                 cvs commit -m "Update." reference/
133
134 ChangeLog:
135         git2cl > ChangeLog
136         cat .clcopying >> ChangeLog
137
138 tag = $(PACKAGE)_`echo $(VERSION) | sed 's/\./_/g'`
139
140 tarball:
141         ! git tag -l $(tag) | grep $(PACKAGE) > /dev/null
142         rm -f ChangeLog
143         $(MAKE) ChangeLog distcheck
144
145 libtasn14win:
146         cd windows && make -f libtasn14win.mk libtasn14win VERSION=$(VERSION)
147
148 libtasn14win-upload:
149         cd windows && make -f libtasn14win.mk upload VERSION=$(VERSION)
150
151 source:
152         git tag -u b565716f -m $(VERSION) $(tag)
153
154 release-check: syntax-check tarball libtasn14win gendoc-copy gtkdoc-copy coverage coverage-copy clang clang-copy
155
156 release-upload-www: gendoc-upload gtkdoc-upload coverage-upload clang-upload
157
158 release-upload-ftp:
159         build-aux/gnupload --to ftp.gnu.org:$(PACKAGE) $(distdir).tar.gz
160         cp $(distdir).tar.gz $(distdir).tar.gz.sig ../releases/$(PACKAGE)/
161         git push
162         git push --tags
163
164 release: release-check release-upload-www source release-upload-ftp libtasn14win-upload