8 tor_platform_source=ntmain.c
13 EXTRA_DIST=ntmain.c or_sha1.i
18 evdns_source=eventdns.c
21 COMMON_SRC = buffers.c circuitbuild.c circuitlist.c \
22 circuituse.c command.c config.c \
23 connection.c connection_edge.c connection_or.c control.c \
24 cpuworker.c directory.c dirserv.c dirvote.c \
25 dns.c dnsserv.c geoip.c hibernate.c main.c $(tor_platform_source) \
26 networkstatus.c onion.c policies.c \
27 reasons.c relay.c rendcommon.c rendclient.c rendmid.c \
28 rendservice.c rephist.c router.c routerlist.c routerparse.c \
29 $(evdns_source) config_codedigest.c
31 tor_SOURCES = $(COMMON_SRC) tor_main.c
33 AM_CPPFLAGS = -DSHARE_DATADIR="\"$(datadir)\"" \
34 -DLOCALSTATEDIR="\"$(localstatedir)\"" \
35 -DBINDIR="\"$(bindir)\""
37 # -L flags need to go in LDFLAGS. -l flags need to go in LDADD.
38 # This seems to matter nowhere but on windows, but I assure you that it
39 # matters a lot there, and is quite hard to debug if you forget to do it.
41 tor_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@
42 tor_LDADD = ../common/libor.a ../common/libor-crypto.a \
43 ../common/libor-event.a \
44 -lz -levent -lssl -lcrypto @TOR_LIB_WS32@ @TOR_LIB_GDI@
45 test_SOURCES = $(COMMON_SRC) test_data.c test.c
47 test_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \
48 @TOR_LDFLAGS_libevent@
49 test_LDADD = ../common/libor.a ../common/libor-crypto.a \
50 ../common/libor-event.a \
51 -lz -levent -lssl -lcrypto @TOR_LIB_WS32@ @TOR_LIB_GDI@
53 noinst_HEADERS = or.h eventdns.h eventdns_tor.h micro-revision.i
55 config_codedigest.o: or_sha1.i
57 tor_main.o: micro-revision.i
59 micro-revision.i: FORCE
61 if test "x$$svkdir" = x ; then \
64 if test -d ../../.git && test -x "`which git 2>&1;true`" ; then \
65 if test -d ../../.git/svn && test -x "`which git-svn 2>&1;true`" ; then \
66 git-svn info ../../README | \
67 sed -n 's/^Revision: \([0-9][0-9]*\).*/"\1"/p' \
68 > micro-revision.tmp \
71 elif test -d ../../.svn && test -x "`which svn 2>&1;true`" ; then \
73 sed -n 's/^Revision: \([0-9][0-9]*\).*/"\1"/p' > micro-revision.tmp \
75 elif test -x "`which svk 2>&1;true`" && test -d $$svkdir/local; then \
78 while test x$$rev = xx; do \
79 x=`svk info $$location | \
80 sed -n 's/^Mirrored From:.*, Rev\. \([0-9][0-9]*\)/\1/p'`; \
81 if test x$$x != x; then \
85 loc=`svk info $$location | \
86 sed -n 's/^Copied From: \(.*\), Rev\. [0-9][0-9]*/\1/p' | \
88 if test x$$loc = x; then \
95 if test x$$rev != xx; then \
96 echo \"$$rev\" > micro-revision.tmp; \
99 if test ! -f micro-revision.tmp ; then \
100 if test ! -f micro-revision.i ; then \
101 echo '""' > micro-revision.i; \
103 elif test ! -f micro-revision.i || \
104 test x"`cat micro-revision.tmp`" != x"`cat micro-revision.i`"; then \
105 mv micro-revision.tmp micro-revision.i; \
108 or_sha1.i: $(tor_SOURCES) test_data.c test.c
109 if test "@SHA1SUM@" != none; then \
110 @SHA1SUM@ $(tor_SOURCES) test_data.c test.c | @SED@ -n 's/^\(.*\)$$/"\1\\n"/p' > or_sha1.i; \
111 elif test "@OPENSSL@" != none; then \
112 @OPENSSL@ sha1 $(tor_SOURCES) test_data.c test.c | @SED@ -n 's/SHA1(\(.*\))= \(.*\)/"\2 \1\\n"/p' > or_sha1.i; \
120 #Dummy target to ensure that micro-revision.i _always_ gets built.