Update new web pages in release, not openconnect.html
[platform/upstream/openconnect.git] / Makefile.am
1
2 SUBDIRS = www
3 if USE_NLS
4 SUBDIRS += po
5 endif
6
7 lib_LTLIBRARIES = libopenconnect.la
8 bin_PROGRAMS = openconnect
9 man8_MANS = openconnect.8
10
11 openconnect_SOURCES = xml.c main.c dtls.c cstp.c mainloop.c tun.c
12
13 openconnect_CFLAGS = $(OPENSSL_CFLAGS) $(LIBXML2_CFLAGS) $(LIBPROXY_CFLAGS) $(ZLIB_CFLAGS)
14 openconnect_LDADD = libopenconnect.la $(OPENSSL_LIBS) $(LIBXML2_LIBS) $(LIBPROXY_LIBS) $(ZLIB_LIBS)
15
16 libopenconnect_la_SOURCES = ssl.c http.c version.c auth.c library.c
17 libopenconnect_la_CFLAGS = $(OPENSSL_CFLAGS) $(LIBXML2_CFLAGS) $(LIBPROXY_CFLAGS)
18 libopenconnect_la_LIBADD = $(OPENSSL_LIBS) $(LIBXML2_LIBS) $(LIBPROXY_LIBS)
19 libopenconnect_la_LDFLAGS = -version-number 1:2
20 noinst_HEADERS = openconnect-internal.h openconnect.h
21 include_HEADERS = openconnect.h
22
23 pkgconfigdir = $(libdir)/pkgconfig
24 pkgconfig_DATA = openconnect.pc
25
26 EXTRA_DIST = version.sh openconnect.html openconnect.8 COPYING.LGPL
27
28 DISTCLEANFILES = $(pkgconfig_DATA) version.c
29
30 version.c: $(filter-out version.c, $(libopenconnect_la_SOURCES)) \
31            $(openconnect_SOURCES) Makefile.am configure.ac \
32            openconnect.h openconnect-internal.h version.sh \
33            $(wildcard .git/index .git/refs/tags)
34         @./version.sh
35
36 tmp-dist: uncommitted-check
37         $(MAKE) $(AM_MAKEFLAGS) VERSION=$(patsubst v%,%,$(shell git describe --tags)) NODISTHOOK=1 dist
38
39 uncommitted-check:
40         @if ! git update-index --refresh --unmerged || \
41             ! git diff-index --name-only --exit-code HEAD; then \
42                 echo "*** ERROR: Uncommitted changes in above files"; exit 1; fi
43
44 dist-hook: uncommitted-check
45  ifndef NODISTHOOK
46         @if ! git rev-parse --verify v$(VERSION) &> /dev/null; then \
47                 echo "*** ERROR: Version v$(VERSION) is not tagged"; exit 1; fi
48         @if ! git diff --name-only --exit-code v$(VERSION) HEAD > /dev/null; then \
49                 echo "*** ERROR: Git checkout not at version v$(VERSION)"; exit 1; fi
50  endif
51
52 tag: uncommitted-check
53         @if git rev-parse --verify v$(VERSION) &> /dev/null; then \
54                 echo "*** ERROR: Version v$(VERSION) is already tagged"; exit 1; fi
55         @sed 's/AC_INIT.*/AC_INIT(openconnect, $(VERSION))/' -i configure.ac
56         @sed 's/^v=.*/v="v$(VERSION)"/' -i version.sh
57         @( echo '1,/<!-- latest-release-start -->/p' ;\
58            echo '/<!-- latest-release-end -->/,$$p' ;\
59            echo  '/<!-- latest-release-start -->/a\' ;\
60            echo  'The latest release is <a href="ftp://ftp.infradead.org/pub/openconnect/openconnect-$(VERSION).tar.gz">OpenConnect v$(VERSION)</a>, released on $(shell date +%Y-%m-%d) with the following changelog:</p>\' ;\
61            sed '0,/<b>OpenConnect HEAD/d;/<\/ul><br\/>/,$$d;s/$$/\\/' www/changelog.xml ;\
62            echo '     </ul>' ) | \
63          sed -n -f - -i www/download.xml
64         @( echo "s/Last modified: .*/Last modified: $(shell date)/" ;\
65            echo '/  <li><b>OpenConnect HEAD/a\' ;\
66            echo '     <ul>\' ;\
67            echo '       <li><i>No changelog entries yet</i></li>\';\
68            echo '     </ul><br/>\' ;  echo '  </li>\' ;\
69            echo '  <li><b><a href="ftp://ftp.infradead.org/pub/openconnect/openconnect-$(VERSION).tar.gz">OpenConnect v$(VERSION)</a></b> &#8212; $(shell date +%Y-%m-%d)' ) | \
70                 sed -f - -i www/changelog.xml
71 # stupid syntax highlighting '
72         @git commit -s -m "Tag version $(VERSION)" configure.ac version.sh www/download.xml www/changelog.xml
73         @git tag v$(VERSION)
74         @./autogen.sh