Switch to using autohate :(
[platform/upstream/openconnect.git] / Makefile.am
1
2
3 lib_LTLIBRARIES = libopenconnect.la
4 bin_PROGRAMS = openconnect
5 man8_MANS = openconnect.8
6
7 openconnect_SOURCES = xml.c main.c dtls.c cstp.c mainloop.c tun.c
8
9 openconnect_CFLAGS = $(OPENSSL_CFLAGS) $(LIBXML2_CFLAGS) $(LIBPROXY_CFLAGS)
10 openconnect_LDADD = libopenconnect.la $(OPENSSL_LIBS) $(LIBXML2_LIBS) $(LIBPROXY_LIBS)
11
12 libopenconnect_la_SOURCES = ssl.c http.c version.c auth.c library.c
13 libopenconnect_la_CFLAGS = $(OPENSSL_CFLAGS) $(LIBXML2_CFLAGS) $(LIBPROXY_CFLAGS)
14 libopenconnect_la_LIBADD = $(OPENSSL_LIBS) $(LIBXML2_LIBS) $(LIBPROXY_LIBS)
15 libopenconnect_la_LDFLAGS = -version-number 1:2
16 noinst_HEADERS = openconnect-internal.h openconnect.h
17 include_HEADERS = openconnect.h
18
19 pkgconfigdir = $(libdir)/pkgconfig
20 pkgconfig_DATA = openconnect.pc
21
22 EXTRA_DIST = version.sh openconnect.html openconnect.8 COPYING.LGPL
23
24 DISTCLEANFILES = $(pkgconfig_DATA) version.c
25
26 version.c: $(filter-out version.c, $(libopenconnect_la_SOURCES)) \
27            $(openconnect_SOURCES) Makefile.am configure.ac \
28            openconnect.h openconnect-internal.h version.sh \
29            $(wildcard .git/index .git/refs/tags)
30         @./version.sh
31
32 dist-hook:
33         @git update-index --refresh --unmerged
34         @if git diff-index --name-only HEAD | grep ^ ; then \
35                 echo Uncommitted changes in above files; exit 1; fi
36
37  ifdef VERSION
38 tag:
39         @git update-index --refresh --unmerged
40         @if git diff-index --name-only HEAD | grep ^ ; then \
41                 echo Uncommitted changes in above files; exit 1; fi
42         @sed 's/AC_INIT.*/AC_INIT(openconnect, $(VERSION))/' -i configure.ac
43         @sed 's/^v=.*/v="v$(VERSION)"/' -i version.sh
44         @( echo "s/Last modified: .*/Last modified: $(shell date)/" ;\
45            echo '/  <LI><B>OpenConnect HEAD/a\' ;\
46            echo '     <UL>\' ;\
47            echo '       <LI><I>No changelog entries yet</I></LI>\';\
48            echo '     </UL><BR>\' ;  echo '  </LI>\' ;\
49            echo '  <LI><B><A HREF="ftp://ftp.infradead.org/pub/openconnect/openconnect-$(VERSION).tar.gz">OpenConnect v$(VERSION)</a></B> &mdash; $(shell date +%Y-%m-%d)<BR>' ) | \
50                 sed -f - -i openconnect.html
51 # stupid syntax highlighting '
52         @git commit -s -m "Tag version $(VERSION)" configure.ac version.sh openconnect.html
53         @git tag v$(VERSION)
54         @./autogen.sh
55
56  endif