refactor and give it unit tests
[tor.git] / Makefile.am
blob4639c22c41de9a7b9fa9046e63667cb5b957c177
1 # Copyright (c) 2001-2004, Roger Dingledine
2 # Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson
3 # Copyright (c) 2007-2011, The Tor Project, Inc.
4 # See LICENSE for licensing information
6 # "foreign" means we don't follow GNU package layout standards
7 # 1.9 means we require automake vesion 1.9
8 AUTOMAKE_OPTIONS = foreign 1.9 subdir-objects
10 ACLOCAL_AMFLAGS = -I m4
12 noinst_LIBRARIES=
13 EXTRA_DIST=
14 noinst_HEADERS=
15 bin_PROGRAMS=
16 CLEANFILES=
17 TESTS=
18 noinst_PROGRAMS=
19 DISTCLEANFILES=
20 bin_SCRIPTS=
21 AM_CPPFLAGS=
22 include src/include.am
23 include doc/include.am
24 include contrib/include.am
27 EXTRA_DIST+= \
28         ChangeLog                                       \
29         INSTALL                                         \
30         LICENSE                                         \
31         Makefile.nmake                                  \
32         README                                          \
33         ReleaseNotes
35 #install-data-local:
36 #       $(INSTALL) -m 755 -d $(LOCALSTATEDIR)/lib/tor
38 # Allows to override rpmbuild with rpmbuild-md5 from fedora-packager so that
39 # building for EL5 won't fail on https://bugzilla.redhat.com/show_bug.cgi?id=490613
40 RPMBUILD ?= rpmbuild
42 # Use automake's dist-gzip target to build the tarball
43 dist-rpm: dist-gzip
44         TIMESTAMP=$$(date +"%Y-%m-%d_%H.%M.%S");                                \
45         RPM_BUILD_DIR=$$(mktemp -d "/tmp/tor-rpm-build-$$TIMESTAMP-XXXX");      \
46         mkdir -p "$$RPM_BUILD_DIR"/{BUILD,RPMS,SOURCES/"tor-$(VERSION)",SPECS,SRPMS}; \
47         cp -fa "$(distdir).tar.gz" "$$RPM_BUILD_DIR"/SOURCES/;                  \
48         LIBS=-lrt $(RPMBUILD) -ba --define "_topdir $$RPM_BUILD_DIR" tor.spec;  \
49         cp -fa "$$RPM_BUILD_DIR"/SRPMS/* .;                                     \
50         cp -fa "$$RPM_BUILD_DIR"/RPMS/* .;                                      \
51         rm -rf "$$RPM_BUILD_DIR";                                               \
52         echo "RPM build finished";                                              \
53         #end of dist-rpm
55 dist: check
57 doxygen:
58         doxygen && cd doc/doxygen/latex && make
60 test: all
61         ./src/test/test
63 # Avoid strlcpy.c, strlcat.c, aes.c, OpenBSD_malloc_Linux.c, sha256.c,
64 # eventdns.[hc], tinytest*.[ch]
65 check-spaces:
66         ./contrib/checkSpace.pl -C                    \
67                 src/common/*.[ch]                     \
68                 src/or/*.[ch]                         \
69                 src/test/*.[ch]                       \
70                 src/tools/*.[ch]                      \
71                 src/tools/tor-fw-helper/*.[ch]
73 check-docs:
74         ./contrib/checkOptionDocs.pl
76 check-logs:
77         ./contrib/checkLogs.pl                        \
78                 src/*/*.[ch] | sort -n
80 version:
81         @echo "Tor @VERSION@"
82         @if test -d "$(top_srcdir)/.git" && test -x "`which git 2>&1;true`"; then \
83            echo -n "git: " ;\
84            (cd "$(top_srcdir)" && git rev-parse --short=16 HEAD); \
85         fi