aboutsummaryrefslogtreecommitdiff
path: root/src/core/include.am
blob: 7752a7974b7553356e245b1503282d89d5fe7bfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#
# Modules are conditionally compiled in tor starting here. We add the C files
# only if the modules has been enabled at configure time. We always add the
# source files of every module to libtor-testing.a so we can build the unit
# tests for everything. See the UNITTESTS_ENABLED branch below.
#
LIBTOR_APP_TESTING_A_SOURCES = $(LIBTOR_APP_A_SOURCES)

src_core_libtor_app_a_SOURCES = \
	$(LIBTOR_APP_A_SOURCES) \
	$(LIBTOR_APP_A_STUB_SOURCES)

if UNITTESTS_ENABLED

# Add the sources of the modules that are needed for tests to work here.
LIBTOR_APP_TESTING_A_SOURCES += $(MODULE_RELAY_SOURCES)
LIBTOR_APP_TESTING_A_SOURCES += $(MODULE_DIRCACHE_SOURCES)
LIBTOR_APP_TESTING_A_SOURCES += $(MODULE_DIRAUTH_SOURCES)

src_core_libtor_app_testing_a_SOURCES = $(LIBTOR_APP_TESTING_A_SOURCES)
else
src_core_libtor_app_testing_a_SOURCES =
endif

AM_CPPFLAGS += -DSHARE_DATADIR="\"$(datadir)\""		\
		-DLOCALSTATEDIR="\"$(localstatedir)\""	\
		-DBINDIR="\"$(bindir)\""

src_core_libtor_app_testing_a_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
src_core_libtor_app_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)

micro-revision.i: FORCE
	$(AM_V_at)rm -f micro-revision.tmp; \
	if test -r "$(top_srcdir)/.git" && \
			test -x "`which git 2>&1;true`"; then \
		HASH="`cd "$(top_srcdir)" && git rev-parse --short=16 HEAD`"; \
		echo \"$$HASH\" > micro-revision.tmp; \
	fi; \
	if test ! -f micro-revision.tmp; then \
		if test ! -f micro-revision.i; then \
			echo '""' > micro-revision.i; \
		fi; \
	elif test ! -f micro-revision.i || \
			test x"`cat micro-revision.tmp`" != x"`cat micro-revision.i`"; then \
		mv micro-revision.tmp micro-revision.i; \
	fi; \
	rm -f micro-revision.tmp; \
	true

CLEANFILES+= micro-revision.i micro-revision.tmp

FORCE: