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