Makefile.am 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. TESTS = test
  2. noinst_PROGRAMS = test
  3. bin_PROGRAMS = tor
  4. if BUILD_NT_SERVICES
  5. tor_platform_source=ntmain.c
  6. else
  7. tor_platform_source=
  8. endif
  9. EXTRA_DIST=ntmain.c or_sha1.i
  10. if USE_EXTERNAL_EVDNS
  11. evdns_source=
  12. else
  13. evdns_source=eventdns.c
  14. endif
  15. COMMON_SRC = 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 geoip.c hibernate.c main.c $(tor_platform_source) \
  20. networkstatus.c onion.c policies.c \
  21. reasons.c relay.c rendcommon.c rendclient.c rendmid.c \
  22. rendservice.c rephist.c router.c routerlist.c routerparse.c \
  23. $(evdns_source) config_codedigest.c
  24. tor_SOURCES = $(COMMON_SRC) tor_main.c
  25. AM_CPPFLAGS = -DSHARE_DATADIR="\"$(datadir)\"" \
  26. -DLOCALSTATEDIR="\"$(localstatedir)\"" \
  27. -DBINDIR="\"$(bindir)\""
  28. # -L flags need to go in LDFLAGS. -l flags need to go in LDADD.
  29. # This seems to matter nowhere but on windows, but I assure you that it
  30. # matters a lot there, and is quite hard to debug if you forget to do it.
  31. tor_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@
  32. tor_LDADD = ../common/libor.a ../common/libor-crypto.a \
  33. ../common/libor-event.a \
  34. -lz -levent -lssl -lcrypto @TOR_LIB_WS32@ @TOR_LIB_GDI@
  35. test_SOURCES = $(COMMON_SRC) test_data.c test.c
  36. test_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \
  37. @TOR_LDFLAGS_libevent@
  38. test_LDADD = ../common/libor.a ../common/libor-crypto.a \
  39. ../common/libor-event.a \
  40. -lz -levent -lssl -lcrypto @TOR_LIB_WS32@ @TOR_LIB_GDI@
  41. noinst_HEADERS = or.h eventdns.h eventdns_tor.h micro-revision.i
  42. config_codedigest.o: or_sha1.i
  43. tor_main.o: micro-revision.i
  44. micro-revision.i: FORCE
  45. @svkdir=$$SVKROOT; \
  46. if test "x$$svkdir" = x ; then \
  47. svkdir=$$HOME/.svk; \
  48. fi; \
  49. if test -d ../../.git && test -x "`which git 2>&1;true`" ; then \
  50. if test -d ../../.git/svn && test -x "`which git-svn 2>&1;true`" ; then \
  51. git-svn info ../../README | \
  52. sed -n 's/^Revision: \([0-9][0-9]*\).*/"\1"/p' \
  53. > micro-revision.tmp \
  54. || true; \
  55. fi; \
  56. elif test -d ../../.svn && test -x "`which svn 2>&1;true`" ; then \
  57. svn info ../.. | \
  58. sed -n 's/^Revision: \([0-9][0-9]*\).*/"\1"/p' > micro-revision.tmp \
  59. || true; \
  60. elif test -x "`which svk 2>&1;true`" && test -d $$svkdir/local; then \
  61. location=../..; \
  62. rev=x; \
  63. while test x$$rev = xx; do \
  64. x=`svk info $$location | \
  65. sed -n 's/^Mirrored From:.*, Rev\. \([0-9][0-9]*\)/\1/p'`; \
  66. if test x$$x != x; then \
  67. rev=$$x; \
  68. break; \
  69. else \
  70. loc=`svk info $$location | \
  71. sed -n 's/^Copied From: \(.*\), Rev\. [0-9][0-9]*/\1/p' | \
  72. head -1`; \
  73. if test x$$loc = x; then \
  74. break; \
  75. else \
  76. location=/$$loc; \
  77. fi; \
  78. fi; \
  79. done; \
  80. if test x$$rev != xx; then \
  81. echo \"$$rev\" > micro-revision.tmp; \
  82. fi; \
  83. fi; \
  84. if test ! -f micro-revision.tmp ; then \
  85. if test ! -f micro-revision.i ; then \
  86. echo '""' > micro-revision.i; \
  87. fi; \
  88. elif test ! -f micro-revision.i || \
  89. test x"`cat micro-revision.tmp`" != x"`cat micro-revision.i`"; then \
  90. mv micro-revision.tmp micro-revision.i; \
  91. fi; true
  92. or_sha1.i: $(tor_SOURCES) test_data.c test.c
  93. if test "@SHA1SUM@" != none; then \
  94. @SHA1SUM@ $(tor_SOURCES) test_data.c test.c | @SED@ -n 's/^\(.*\)$$/"\1\\n"/p' > or_sha1.i; \
  95. elif test "@OPENSSL@" != none; then \
  96. @OPENSSL@ sha1 $(tor_SOURCES) test_data.c test.c | @SED@ -n 's/SHA1(\(.*\))= \(.*\)/"\2 \1\\n"/p' > or_sha1.i; \
  97. else \
  98. rm or_sha1.i; \
  99. touch or_sha1.i; \
  100. fi
  101. #Dummy target to ensure that micro-revision.i _always_ gets built.
  102. FORCE: