for once, it was "no-tab man" that struck again.
[tor.git] / src / or / Makefile.am
blob22ceac945da6299983cf17294e287c3b97001a6f
1 TESTS = test
3 noinst_PROGRAMS = test
5 bin_PROGRAMS = tor
7 if BUILD_NT_SERVICES
8 tor_platform_source=ntmain.c
9 else
10 tor_platform_source=
11 endif
13 EXTRA_DIST=ntmain.c
15 tor_SOURCES = buffers.c circuitbuild.c circuitlist.c \
16         circuituse.c command.c config.c \
17         connection.c connection_edge.c connection_or.c control.c \
18         cpuworker.c directory.c dirserv.c dirvote.c \
19         dns.c dnsserv.c hibernate.c main.c $(tor_platform_source) \
20         networkstatus.c \
21         onion.c policies.c relay.c rendcommon.c rendclient.c rendmid.c \
22         rendservice.c rephist.c router.c routerlist.c routerparse.c \
23         eventdns.c \
24         tor_main.c
26 # -L flags need to go in LDFLAGS. -l flags need to go in LDADD.
27 # This seems to matter nowhere but on windows, but I assure you that it
28 # matters a lot there, and is quite hard to debug if you forget to do it.
30 tor_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@
31 tor_LDADD = ../common/libor.a ../common/libor-crypto.a \
32   -lz -levent -lssl -lcrypto @TOR_LIB_WS32@ @TOR_LIB_GDI@
33 test_SOURCES = buffers.c circuitbuild.c circuitlist.c \
34         circuituse.c command.c config.c \
35         connection.c connection_edge.c connection_or.c control.c \
36         cpuworker.c directory.c dirserv.c dirvote.c \
37         dns.c dnsserv.c hibernate.c main.c $(tor_platform_source) \
38         networkstatus.c \
39         onion.c policies.c relay.c rendcommon.c rendclient.c rendmid.c \
40         rendservice.c rephist.c router.c routerlist.c routerparse.c \
41         eventdns.c \
42         test_data.c test.c
44 test_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \
45         @TOR_LDFLAGS_libevent@
46 test_LDADD = ../common/libor.a ../common/libor-crypto.a \
47         -lz -levent -lssl -lcrypto @TOR_LIB_WS32@ @TOR_LIB_GDI@
49 noinst_HEADERS = or.h eventdns.h eventdns_tor.h micro-revision.i
51 tor_main.o: micro-revision.i
53 micro-revision.i: FORCE
54         @svkdir=$$SVKROOT; \
55         if test "x$$svkdir" = x ; then \
56           svkdir=$$HOME/.svk; \
57         fi; \
58         if test -d ../../.svn && test -x "`which svn 2>&1;true`" ; then \
59           svn info ../.. |                                      \
60           sed -n 's/^Revision: \([0-9][0-9]*\).*/"\1"/p' > micro-revision.tmp \
61              || true;                                           \
62         elif test -x "`which svk 2>&1;true`" && test -d $$svkdir/local; then \
63           location=../..;                                       \
64           rev=x;                                                \
65           while test x$$rev = xx; do                            \
66             x=`svk info $$location |                            \
67               sed -n 's/^Mirrored From:.*, Rev\. \([0-9][0-9]*\)/\1/p'`; \
68             if test x$$x != x; then                             \
69               rev=$$x;                                          \
70               break;                                            \
71             else                                                \
72               loc=`svk info $$location |                        \
73                 sed -n 's/^Copied From: \(.*\), Rev\. [0-9][0-9]*/\1/p'`; \
74               if test x$$loc = x; then                          \
75                 break;                                          \
76               else                                              \
77                 location=/$$loc;                                \
78               fi;                                               \
79             fi;                                                 \
80           done;                                                 \
81           if test x$$rev != xx; then                            \
82             echo \"$$rev\" > micro-revision.tmp;                \
83           fi;                                                   \
84         fi;                                                     \
85         if test ! -f micro-revision.tmp ; then                  \
86           if test ! -f micro-revision.i ; then                  \
87             echo '""' > micro-revision.i;                       \
88           fi;                                                   \
89         elif test ! -f micro-revision.i ||                      \
90           test x"`cat micro-revision.tmp`" != x"`cat micro-revision.i`"; then \
91           mv micro-revision.tmp micro-revision.i;               \
92         fi; true
94 #Dummy target to ensure that micro-revision.i _always_ gets built.
95 FORCE: