include.am 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. bin_PROGRAMS+= src/or/tor
  2. noinst_LIBRARIES += \
  3. src/or/libtor.a
  4. if UNITTESTS_ENABLED
  5. noinst_LIBRARIES += \
  6. src/or/libtor-testing.a
  7. endif
  8. if COVERAGE_ENABLED
  9. noinst_PROGRAMS+= src/or/tor-cov
  10. endif
  11. if BUILD_NT_SERVICES
  12. tor_platform_source=src/or/ntmain.c
  13. else
  14. tor_platform_source=
  15. endif
  16. EXTRA_DIST+= src/or/ntmain.c src/or/or_sha1.i src/or/Makefile.nmake
  17. if USE_EXTERNAL_EVDNS
  18. evdns_source=
  19. else
  20. evdns_source=src/ext/eventdns.c
  21. endif
  22. LIBTOR_A_SOURCES = \
  23. src/or/addressmap.c \
  24. src/or/buffers.c \
  25. src/or/channel.c \
  26. src/or/channeltls.c \
  27. src/or/circpathbias.c \
  28. src/or/circuitbuild.c \
  29. src/or/circuitlist.c \
  30. src/or/circuitmux.c \
  31. src/or/circuitmux_ewma.c \
  32. src/or/circuitstats.c \
  33. src/or/circuituse.c \
  34. src/or/command.c \
  35. src/or/config.c \
  36. src/or/confparse.c \
  37. src/or/connection.c \
  38. src/or/connection_edge.c \
  39. src/or/connection_or.c \
  40. src/or/control.c \
  41. src/or/cpuworker.c \
  42. src/or/directory.c \
  43. src/or/dirserv.c \
  44. src/or/dirvote.c \
  45. src/or/dns.c \
  46. src/or/dnsserv.c \
  47. src/or/fp_pair.c \
  48. src/or/geoip.c \
  49. src/or/entrynodes.c \
  50. src/or/ext_orport.c \
  51. src/or/hibernate.c \
  52. src/or/main.c \
  53. src/or/microdesc.c \
  54. src/or/networkstatus.c \
  55. src/or/nodelist.c \
  56. src/or/onion.c \
  57. src/or/onion_fast.c \
  58. src/or/onion_tap.c \
  59. src/or/transports.c \
  60. src/or/policies.c \
  61. src/or/reasons.c \
  62. src/or/relay.c \
  63. src/or/rendclient.c \
  64. src/or/rendcommon.c \
  65. src/or/rendmid.c \
  66. src/or/rendservice.c \
  67. src/or/rephist.c \
  68. src/or/replaycache.c \
  69. src/or/router.c \
  70. src/or/routerkeys.c \
  71. src/or/routerlist.c \
  72. src/or/routerparse.c \
  73. src/or/routerset.c \
  74. src/or/scheduler.c \
  75. src/or/statefile.c \
  76. src/or/status.c \
  77. src/or/torcert.c \
  78. src/or/onion_ntor.c \
  79. $(evdns_source) \
  80. $(tor_platform_source) \
  81. src/or/config_codedigest.c
  82. src_or_libtor_a_SOURCES = $(LIBTOR_A_SOURCES)
  83. src_or_libtor_testing_a_SOURCES = $(LIBTOR_A_SOURCES)
  84. #libtor_a_LIBADD = ../common/libor.a ../common/libor-crypto.a \
  85. # ../common/libor-event.a
  86. #src_or_libtor_a_LIBADD = src/trunnel/libor-trunnel.a
  87. src_or_tor_SOURCES = src/or/tor_main.c
  88. AM_CPPFLAGS += -I$(srcdir)/src/or -Isrc/or
  89. src/or/tor_main.o: micro-revision.i
  90. AM_CPPFLAGS += -DSHARE_DATADIR="\"$(datadir)\"" \
  91. -DLOCALSTATEDIR="\"$(localstatedir)\"" \
  92. -DBINDIR="\"$(bindir)\""
  93. src_or_libtor_testing_a_CPPFLAGS = -DTOR_UNIT_TESTS $(AM_CPPFLAGS)
  94. src_or_libtor_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
  95. # -L flags need to go in LDFLAGS. -l flags need to go in LDADD.
  96. # This seems to matter nowhere but on windows, but I assure you that it
  97. # matters a lot there, and is quite hard to debug if you forget to do it.
  98. src_or_tor_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@
  99. src_or_tor_LDADD = src/or/libtor.a src/common/libor.a \
  100. src/common/libor-crypto.a $(LIBDONNA) \
  101. src/common/libor-event.a src/trunnel/libor-trunnel.a \
  102. @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \
  103. @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ @TOR_SYSTEMD_LIBS@
  104. if COVERAGE_ENABLED
  105. src_or_tor_cov_SOURCES = src/or/tor_main.c
  106. src_or_tor_cov_CPPFLAGS = -DTOR_UNIT_TESTS $(AM_CPPFLAGS)
  107. src_or_tor_cov_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
  108. src_or_tor_cov_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@
  109. src_or_tor_cov_LDADD = src/or/libtor-testing.a src/common/libor-testing.a \
  110. src/common/libor-crypto-testing.a $(LIBDONNA) \
  111. src/common/libor-event-testing.a src/trunnel/libor-trunnel-testing.a \
  112. @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \
  113. @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ @TOR_SYSTEMD_LIBS@
  114. TESTING_TOR_BINARY = ./src/or/tor-cov
  115. else
  116. TESTING_TOR_BINARY = ./src/or/tor
  117. endif
  118. ORHEADERS = \
  119. src/or/addressmap.h \
  120. src/or/buffers.h \
  121. src/or/channel.h \
  122. src/or/channeltls.h \
  123. src/or/circpathbias.h \
  124. src/or/circuitbuild.h \
  125. src/or/circuitlist.h \
  126. src/or/circuitmux.h \
  127. src/or/circuitmux_ewma.h \
  128. src/or/circuitstats.h \
  129. src/or/circuituse.h \
  130. src/or/command.h \
  131. src/or/config.h \
  132. src/or/confparse.h \
  133. src/or/connection.h \
  134. src/or/connection_edge.h \
  135. src/or/connection_or.h \
  136. src/or/control.h \
  137. src/or/cpuworker.h \
  138. src/or/directory.h \
  139. src/or/dirserv.h \
  140. src/or/dirvote.h \
  141. src/or/dns.h \
  142. src/or/dnsserv.h \
  143. src/or/eventdns_tor.h \
  144. src/or/ext_orport.h \
  145. src/or/fp_pair.h \
  146. src/or/geoip.h \
  147. src/or/entrynodes.h \
  148. src/or/hibernate.h \
  149. src/or/main.h \
  150. src/or/microdesc.h \
  151. src/or/networkstatus.h \
  152. src/or/nodelist.h \
  153. src/or/ntmain.h \
  154. src/or/onion.h \
  155. src/or/onion_fast.h \
  156. src/or/onion_ntor.h \
  157. src/or/onion_tap.h \
  158. src/or/or.h \
  159. src/or/transports.h \
  160. src/or/policies.h \
  161. src/or/reasons.h \
  162. src/or/relay.h \
  163. src/or/rendclient.h \
  164. src/or/rendcommon.h \
  165. src/or/rendmid.h \
  166. src/or/rendservice.h \
  167. src/or/rephist.h \
  168. src/or/replaycache.h \
  169. src/or/router.h \
  170. src/or/routerkeys.h \
  171. src/or/routerlist.h \
  172. src/or/routerkeys.h \
  173. src/or/routerset.h \
  174. src/or/routerparse.h \
  175. src/or/scheduler.h \
  176. src/or/statefile.h \
  177. src/or/status.h \
  178. src/or/torcert.h
  179. noinst_HEADERS+= $(ORHEADERS) micro-revision.i
  180. src/or/config_codedigest.o: src/or/or_sha1.i
  181. micro-revision.i: FORCE
  182. @rm -f micro-revision.tmp; \
  183. if test -d "$(top_srcdir)/.git" && \
  184. test -x "`which git 2>&1;true`"; then \
  185. HASH="`cd "$(top_srcdir)" && git rev-parse --short=16 HEAD`"; \
  186. echo \"$$HASH\" > micro-revision.tmp; \
  187. fi; \
  188. if test ! -f micro-revision.tmp ; then \
  189. if test ! -f micro-revision.i ; then \
  190. echo '""' > micro-revision.i; \
  191. fi; \
  192. elif test ! -f micro-revision.i || \
  193. test x"`cat micro-revision.tmp`" != x"`cat micro-revision.i`"; then \
  194. mv micro-revision.tmp micro-revision.i; \
  195. fi; true
  196. src/or/or_sha1.i: $(src_or_tor_SOURCES) $(src_or_libtor_a_SOURCES) $(ORHEADERS)
  197. $(AM_V_GEN)if test "@SHA1SUM@" != none; then \
  198. (cd "$(srcdir)" && "@SHA1SUM@" $(src_or_tor_SOURCES) $(src_or_libtor_a_SOURCES) $(ORHEADERS) ) | \
  199. "@SED@" -n 's/^\(.*\)$$/"\1\\n"/p' > src/or/or_sha1.i; \
  200. elif test "@OPENSSL@" != none; then \
  201. (cd "$(srcdir)" && "@OPENSSL@" sha1 $(src_or_tor_SOURCES) $(src_or_libtor_a_SOURCES) $(ORHEADERS)) | \
  202. "@SED@" -n 's/SHA1(\(.*\))= \(.*\)/"\2 \1\\n"/p' > src/or/or_sha1.i; \
  203. else \
  204. rm src/or/or_sha1.i; \
  205. touch src/or/or_sha1.i; \
  206. fi
  207. CLEANFILES+= micro-revision.i src/or/micro-revision.i
  208. FORCE: