blob: 40e1a0a7eda89f4561fd9c991b5852b436cea1d2 [file] [log] [blame]
Brian Aker95d9fd52012-10-15 22:44:03 -04001# vim:ft=automake
2
Brian Aker870a3142012-10-17 02:10:49 -04003BUILT_SOURCES=
Brian Aker95d9fd52012-10-15 22:44:03 -04004EXTRA_DIST=
5TESTS=
6bin_PROGRAMS=
7check_PROGRAMS=
8lib_LTLIBRARIES=
9man_MANS=
10noinst_HEADERS=
11noinst_LTLIBRARIES=
12noinst_PROGRAMS=
13
14# GNU style is "make check", this will make check and test work
15TESTS+= $(check_PROGRAMS)
16test: check
17
Brian Aker6fa3a082012-10-17 00:16:32 -040018ACLOCAL_AMFLAGS= -I m4
Brian Aker95d9fd52012-10-15 22:44:03 -040019
Jacob Appelbaum66064ff2012-07-11 09:44:34 +020020# Our Debian version
Jacob Appelbaum2c3a39f2012-07-11 09:54:34 +020021DEBIAN_VERSION := $(shell if [ -e debian/changelog ]; then cat debian/changelog|head -n1|cut -d\- -f2| head -c 1; else echo "unknown"; fi)
Jacob Appelbaum5de8b0a2012-02-02 01:43:22 +010022
Brian Aker95d9fd52012-10-15 22:44:03 -040023EXTRA_DIST+= AUTHORS
24EXTRA_DIST+= README
25EXTRA_DIST+= LICENSE
26EXTRA_DIST+= TODO
27EXTRA_DIST+= apparmor-profile
28EXTRA_DIST+= CHANGELOG
29EXTRA_DIST+= autogen.sh
30
31include src/include.am
Jacob Appelbaume9b80422012-07-09 23:01:43 +020032
Brian Akerb12abad2012-10-16 01:25:00 -040033# Cleanup individual files in order to preserve uninstall/etc order
34maintainer-clean-local:
35 @rm -r -f autom4te.cache
36 @rm Makefile.in
37 @rm aclocal.m4
38 @rm config.in
39 @rm config/config.guess
40 @rm config/config.sub
41 @rm config/depcomp
42 @rm config/install-sh
43 @rm config/ltmain.sh
44 @rm config/missing
45 @rm configure
46 @rmdir config
47 @rm m4/libtool.m4
48 @rm m4/ltoptions.m4
49 @rm m4/ltsugar.m4
50 @rm m4/ltversion.m4
51 @rm m4/lt~obsolete.m4
Brian Aker6fa3a082012-10-17 00:16:32 -040052 @rm -f tlsdate-*.tar.gz
Jacob Appelbaumd16abc32012-10-30 16:22:36 +010053 @rm src/configmake.h
Brian Akerd4ad5192012-10-16 03:55:56 -040054 @find ./ | $(GREP) \~$$ | xargs rm -f
Christian Grothoff16fe93e2012-02-14 00:11:23 +010055
Brian Aker870a3142012-10-17 02:10:49 -040056certdir = @TLSDATE_CA_ROOTS@
57cert_DATA = ca-roots/tlsdate-ca-roots.conf
58EXTRA_DIST+= $(cert_DATA)
59
60
Jacob Appelbaum5de8b0a2012-02-02 01:43:22 +010061# Our documentation
Brian Aker95d9fd52012-10-15 22:44:03 -040062man_MANS+= man/tlsdate.1
Jacob Appelbaum6a86a242012-10-29 21:45:26 +010063man_MANS+= man/tlsdated.1
Brian Aker95d9fd52012-10-15 22:44:03 -040064man_MANS+= man/tlsdate-helper.1
Jacob Appelbaum7727ec92012-10-30 22:39:20 +010065man_MANS+= man/tlsdate-routeup.1
Brian Aker95d9fd52012-10-15 22:44:03 -040066EXTRA_DIST+= $(man_MANS)
Jacob Appelbaum5de8b0a2012-02-02 01:43:22 +010067
Brian Akerb12abad2012-10-16 01:25:00 -040068.PHONY: debian_orig git-tag git-push git-tag-debian deb really-clean valgrind_test
Jacob Appelbaumc61b0d02012-07-09 20:53:49 +020069debian_orig:
Brian Aker95d9fd52012-10-15 22:44:03 -040070 $(MAKE) distcheck
Jacob Appelbaumc61b0d02012-07-09 20:53:49 +020071 mv tlsdate-$(VERSION).tar.gz ../tlsdate_$(VERSION).orig.tar.gz
Jacob Appelbaumcd24b1c2012-07-09 21:54:34 +020072
73git-tag:
74 git tag -u 0xD81D840E -s tlsdate-$(VERSION)
75
Jacob Appelbaum66064ff2012-07-11 09:44:34 +020076git-tag-debian:
77 git tag -u 0xD81D840E -s tlsdate-$(VERSION)-debian-${DEBIAN_VERSION}
78
Jacob Appelbaumcd24b1c2012-07-09 21:54:34 +020079git-push:
80 git push --tags
81 git push
Jacob Appelbaum66064ff2012-07-11 09:44:34 +020082
83deb: debian_orig
Jacob Appelbaumaecba052012-10-30 16:00:42 +010084 debuild -i'.*' -rfakeroot -uc -us -d
Jacob Appelbaum76630ba2012-08-03 00:43:43 -070085
86valgrind_test:
Brian Aker95d9fd52012-10-15 22:44:03 -040087 TESTS_ENVIRONMENT="./libtool --mode=execute valgrind --trace-children=yes --leak-check=full" ./src/tlsdate -v -V -n -H encrypted.google.com
Jacob Appelbaum28604422012-10-12 18:25:31 -070088
89# This allows us to parse the Mozilla NSS CA trusted root list and ensures we
90# respect the trust bits as they are set - using them directly without the
91# context is dangerous. This gives us a basic set of CA roots to trust for use
92# with tlsdate without relying on any system CA list.
93# You'll need agl's extract-nss-root-certs to recreate this file:
94# https://github.com/agl/extract-nss-root-certs
95update_ca_root_data:
96 curl https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt\?raw\=1 -o ca-roots/certdata.txt
Jacob Appelbaum0f520172012-10-15 19:18:44 -070097 go run ~/Documents/code/git/extract-nss-root-certs/convert_mozilla_certdata.go ca-roots/certdata.txt > ca-roots/tlsdate-ca-roots.conf
98 rm ca-roots/certdata.txt
99
Jacob Appelbaumd16abc32012-10-30 16:22:36 +0100100BUILT_SOURCES+= src/configmake.h
101noinst_HEADERS+= src/configmake.h
102src/configmake.h: ${top_srcdir}/Makefile.in
Brian Aker870a3142012-10-17 02:10:49 -0400103 @echo "Making $@"
104 @rm -f $@-t $@
105 @{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
106 echo '#define TLSDATE_CONFIG "$(sysconfdir)/ca-roots/"'; \
107 } | sed '/""/d' > $@-t
108 @if diff $@-t $@ >/dev/null 2>&1 ; then \
109 rm @-t ; \
110 else \
111 mv $@-t $@ ; \
112 fi
113