Makefile.am 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. @rm -f micro-revision.tmp; \
  46. if test -d ../../.git && test -x "`which git 2>&1;true`"; then \
  47. HASH="`git rev-parse --short=16 HEAD`"; \
  48. echo \"$$HASH\" > micro-revision.tmp; \
  49. fi; \
  50. if test ! -f micro-revision.tmp ; then \
  51. if test ! -f micro-revision.i ; then \
  52. echo '""' > micro-revision.i; \
  53. fi; \
  54. elif test ! -f micro-revision.i || \
  55. test x"`cat micro-revision.tmp`" != x"`cat micro-revision.i`"; then \
  56. mv micro-revision.tmp micro-revision.i; \
  57. fi; true
  58. or_sha1.i: $(tor_SOURCES) test_data.c test.c
  59. if test "@SHA1SUM@" != none; then \
  60. @SHA1SUM@ $(tor_SOURCES) test_data.c test.c | @SED@ -n 's/^\(.*\)$$/"\1\\n"/p' > or_sha1.i; \
  61. elif test "@OPENSSL@" != none; then \
  62. @OPENSSL@ sha1 $(tor_SOURCES) test_data.c test.c | @SED@ -n 's/SHA1(\(.*\))= \(.*\)/"\2 \1\\n"/p' > or_sha1.i; \
  63. else \
  64. rm or_sha1.i; \
  65. touch or_sha1.i; \
  66. fi
  67. #Dummy target to ensure that micro-revision.i _always_ gets built.
  68. FORCE: