Update gnulib files.
[gnutls:gnutls.git] / cfg.mk
1 # Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation
2 #
3 # Author: Simon Josefsson
4 #
5 # This file is part of GNUTLS.
6 #
7 # This file is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # This file is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this file; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
21 WFLAGS ?= WARN_CFLAGS=-Werror
22 ADDFLAGS ?=
23 CFGFLAGS ?= --enable-gtk-doc $(ADDFLAGS)
24
25 INDENT_SOURCES = `find . -name \*.c|grep -v -e ^./lgl -e ^./gl -e ^./src/cfg -e -gaa.c -e asn1_tab.c`
26
27 ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile)
28 .DEFAULT_GOAL := bootstrap
29 endif
30
31 PODIR := lib/po
32 PO_DOMAIN := libgnutls
33
34 local-checks-to-skip = sc_prohibit_strcmp sc_prohibit_atoi_atof         \
35         sc_error_message_uppercase sc_prohibit_have_config_h            \
36         sc_require_config_h sc_require_config_h_first                   \
37         sc_trailing_blank sc_unmarked_diagnostics sc_immutable_NEWS
38
39 autoreconf:
40         for f in $(PODIR)/*.po.in; do \
41                 cp $$f `echo $$f | sed 's/.in//'`; \
42         done
43         mv lib/build-aux/config.rpath lib/build-aux/config.rpath-
44         test -f ./configure || autoreconf --install
45         mv lib/build-aux/config.rpath- lib/build-aux/config.rpath
46
47 update-po: refresh-po
48         for f in `ls $(PODIR)/*.po | grep -v quot.po`; do \
49                 cp $$f $$f.in; \
50         done
51         git add $(PODIR)/*.po.in
52         git commit -m "Sync with TP." $(PODIR)/LINGUAS $(PODIR)/*.po.in
53
54 bootstrap: autoreconf
55         $(WFLAGS) ./configure $(CFGFLAGS)
56
57 glimport:
58         gnulib-tool --m4-base gl/m4 --import
59         cd lib && gnulib-tool --m4-base gl/m4 --import
60         cd libextra && gnulib-tool --m4-base gl/m4 --import
61
62 # Code Coverage
63
64 pre-coverage:
65         ln -sf /usr/local/share/gaa/gaa.skel src/gaa.skel
66
67 web-coverage:
68         rm -fv `find $(htmldir)/coverage -type f | grep -v CVS`
69         cp -rv doc/coverage/* $(htmldir)/coverage/
70
71 upload-web-coverage:
72         cd $(htmldir) && \
73                 cvs commit -m "Update." coverage
74
75 # Mingw32
76
77 W32ROOT ?= $(HOME)/gnutls4win/inst
78
79 mingw32: autoreconf 
80         ./configure $(CFGFLAGS) --host=i586-mingw32msvc --build=`build-aux/config.guess` --with-libtasn1-prefix=$(W32ROOT) --with-libgcrypt-prefix=$(W32ROOT) --prefix $(W32ROOT)
81
82 .PHONY: bootstrap autoreconf mingw32
83
84 # Release
85
86 ChangeLog:
87         git log --pretty --numstat --summary --since="2005 November 07" -- | git2cl > ChangeLog
88         cat .clcopying >> ChangeLog
89
90 tag = $(PACKAGE)_`echo $(VERSION) | sed 's/\./_/g'`
91 htmldir = ../www-$(PACKAGE)
92
93 release: prepare upload web upload-web
94
95 prepare:
96         ! git tag -l $(tag) | grep $(PACKAGE) > /dev/null
97         rm -f ChangeLog
98         $(MAKE) ChangeLog distcheck
99         git commit -m Generated. ChangeLog
100         git tag -u b565716f! -m $(VERSION) $(tag)
101
102 upload:
103         git push
104         git push --tags
105         build-aux/gnupload --to alpha.gnu.org:$(PACKAGE) $(distdir).tar.bz2
106         scp $(distdir).tar.bz2 $(distdir).tar.bz2.sig igloo.linux.gr:~ftp/pub/gnutls/devel/
107         ssh igloo.linux.gr 'cd ~ftp/pub/gnutls/devel/ && sha1sum *.tar.bz2 > CHECKSUMS'
108         cp $(distdir).tar.bz2 $(distdir).tar.bz2.sig ../releases/$(PACKAGE)/
109
110 web:
111         cd doc && ../build-aux/gendocs.sh --html "--css-include=texinfo.css" \
112                 -o ../$(htmldir)/manual/ $(PACKAGE) $(PACKAGE_NAME)
113         cd doc/doxygen && doxygen && cd ../.. && cp -v doc/doxygen/html/* $(htmldir)/doxygen/ && cd doc/doxygen/latex && make refman.pdf && cd ../../../ && cp doc/doxygen/latex/refman.pdf $(htmldir)/doxygen/$(PACKAGE).pdf
114         cp -v doc/reference/html/*.html doc/reference/html/*.png doc/reference/html/*.devhelp doc/reference/html/*.css $(htmldir)/reference/
115
116 upload-web:
117         cd $(htmldir) && cvs commit -m "Update." manual/ reference/ doxygen/