Remove openconnect.html from EXTRA_DIST
[platform/upstream/openconnect.git] / Makefile.am
1
2 SUBDIRS =
3 if BUILD_WWW
4 SUBDIRS += www
5 endif
6 if USE_NLS
7 SUBDIRS += po
8 endif
9
10 lib_LTLIBRARIES = libopenconnect.la
11 sbin_PROGRAMS = openconnect
12 man8_MANS = openconnect.8
13
14 AM_CPPFLAGS = -DLOCALEDIR="\"$(localedir)\""
15 openconnect_SOURCES = xml.c main.c dtls.c cstp.c mainloop.c tun.c
16
17 openconnect_CFLAGS = $(OPENSSL_CFLAGS) $(LIBXML2_CFLAGS) $(LIBPROXY_CFLAGS) $(ZLIB_CFLAGS)
18 openconnect_LDADD = libopenconnect.la $(OPENSSL_LIBS) $(LIBXML2_LIBS) $(LIBPROXY_LIBS) $(ZLIB_LIBS) $(LIBINTL)
19
20 library_srcs = ssl.c http.c auth.c library.c
21 libopenconnect_la_SOURCES = version.c $(library_srcs)
22 libopenconnect_la_CFLAGS = $(OPENSSL_CFLAGS) $(LIBXML2_CFLAGS) $(LIBPROXY_CFLAGS)
23 libopenconnect_la_LIBADD = $(OPENSSL_LIBS) $(LIBXML2_LIBS) $(LIBPROXY_LIBS) $(LIBINTL)
24 libopenconnect_la_LDFLAGS = -version-number 1:2
25 noinst_HEADERS = openconnect-internal.h openconnect.h
26 include_HEADERS = openconnect.h
27
28 pkgconfigdir = $(libdir)/pkgconfig
29 pkgconfig_DATA = openconnect.pc
30
31 EXTRA_DIST = version.sh openconnect.8 COPYING.LGPL
32
33 DISTCLEANFILES = $(pkgconfig_DATA)
34
35 main.o: version.c
36 version.c: $(library_srcs) $(openconnect_SOURCES) Makefile.am configure.ac \
37            openconnect.h openconnect-internal.h version.sh @GITVERSIONDEPS@
38         @cd $(srcdir) && ./version.sh $@
39
40 tmp-dist: uncommitted-check
41         $(MAKE) $(AM_MAKEFLAGS) VERSION=$(patsubst v%,%,$(shell git describe --tags)) DISTHOOK=0 dist
42
43 uncommitted-check:
44         @if ! git update-index --refresh --unmerged || \
45             ! git diff-index --name-only --exit-code HEAD; then \
46                 echo "*** ERROR: Uncommitted changes in above files"; exit 1; fi
47
48 DISTHOOK=1
49 dist-hook: uncommitted-check
50         @if [ $(DISTHOOK) = 1 ]; then \
51             if ! git rev-parse --verify v$(VERSION) &> /dev/null; then \
52                 echo "*** ERROR: Version v$(VERSION) is not tagged"; exit 1; fi ; \
53             if ! git diff --name-only --exit-code v$(VERSION) HEAD > /dev/null; then \
54                 echo "*** ERROR: Git checkout not at version v$(VERSION)"; exit 1; fi ; \
55         fi
56
57 sign-dist: dist
58         @for a in $(DIST_ARCHIVES); do \
59                 gpg --default-key 67E2F359 --detach-sign -a $$a ; \
60         done
61
62 tag: uncommitted-check
63         @if git rev-parse --verify v$(VERSION) &> /dev/null; then \
64                 echo "*** ERROR: Version v$(VERSION) is already tagged"; exit 1; fi
65         @sed 's/AC_INIT.*/AC_INIT(openconnect, $(VERSION))/' -i configure.ac
66         @sed 's/^v=.*/v="v$(VERSION)"/' -i version.sh
67         @( echo '1,/<!-- latest-release-start -->/p' ;\
68            echo '/<!-- latest-release-end -->/,$$p' ;\
69            echo  '/<!-- latest-release-start -->/a\' ;\
70            echo  'The latest release is <a href="ftp://ftp.infradead.org/pub/openconnect/openconnect-$(VERSION).tar.gz">OpenConnect v$(VERSION)</a>\' ;\
71            echo  '<i>(<a href="ftp://ftp.infradead.org/pub/openconnect/openconnect-$(VERSION).tar.gz.asc">PGP signature</a>)</i>,\' ;\
72            echo 'released on $(shell date +%Y-%m-%d) with the following changelog:</p>\' ;\
73            sed '0,/<b>OpenConnect HEAD/d;/<\/ul><br\/>/,$$d;s/$$/\\/' www/changelog.xml ;\
74            echo '     </ul>' ) | \
75          sed -n -f - -i www/download.xml
76         @( echo "s/Last modified: .*/Last modified: $(shell date)/" ;\
77            echo '/  <li><b>OpenConnect HEAD/a\' ;\
78            echo '     <ul>\' ;\
79            echo '       <li><i>No changelog entries yet</i></li>\';\
80            echo '     </ul><br/>\' ;  echo '  </li>\' ;\
81            echo '  <li><b><a href="ftp://ftp.infradead.org/pub/openconnect/openconnect-$(VERSION).tar.gz">OpenConnect v$(VERSION)</a></b>\' ;\
82            echo '     <i>(<a href="ftp://ftp.infradead.org/pub/openconnect/openconnect-$(VERSION).tar.gz.asc">PGP signature</a>)</i> &#8212; $(shell date +%Y-%m-%d)' ) | \
83                 sed -f - -i www/changelog.xml
84 # stupid syntax highlighting '
85         @git commit -s -m "Tag version $(VERSION)" configure.ac version.sh www/download.xml www/changelog.xml
86         @git tag v$(VERSION)
87         @./autogen.sh
88
89 update-translations:
90         @if ! git diff-index --name-only --exit-code HEAD -- po/; then \
91                 echo "*** ERROR: Uncommitted changes in above files"; exit 1; fi
92         @tx pull -af
93         @git commit -s -m "Update translations from Transifex" -- po/
94
95 upload-pot:
96         @make -C po openconnect.pot && tx push -s