Commit 2a4a1496 authored by Stewart Smith's avatar Stewart Smith Committed by Nick Mathewson
Browse files

Move to non-recursive make

This gives us a few benefits:
1) make -j clean all
   this will start working, as it should. It currently doesn't.
2) increased parallel build
   recursive make will max out at number of files in a directory,
   non-recursive make doesn't have such a limitation
3) Removal of duplicate information in make files,
   less error prone

I've also slightly updated how we call AM_INIT_AUTOMAKE, as the way
that was used was not only deprecated but will be *removed* in the next
major automake release (1.13).... so probably best that we can continue
to bulid tor without requiring old automake.
(see http://www.gnu.org/software/automake/manual/html_node/Public-Macros.html )

For more reasons  why, see resources such as:
http://miller.emu.id.au/pmiller/books/rmch/
parent ca90aea5
......@@ -7,11 +7,21 @@
# 1.7 means we require automake vesion 1.7
AUTOMAKE_OPTIONS = foreign 1.7
SUBDIRS = src doc contrib
noinst_LIBRARIES=
EXTRA_DIST=
noinst_HEADERS=
bin_PROGRAMS=
CLEANFILES=
TESTS=
noinst_PROGRAMS=
DISTCLEANFILES=
bin_SCRIPTS=
include src/include.am
include doc/include.am
include contrib/include.am
DIST_SUBDIRS = src doc contrib
EXTRA_DIST = \
EXTRA_DIST+= \
ChangeLog \
INSTALL \
LICENSE \
......
......@@ -3,8 +3,9 @@ dnl Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson
dnl Copyright (c) 2007-2012, The Tor Project, Inc.
dnl See LICENSE for licensing information
AC_INIT
AM_INIT_AUTOMAKE(tor, 0.2.4.0-alpha-dev)
AC_INIT([tor],[0.2.4.0-alpha-dev])
AC_CONFIG_SRCDIR([src/or/main.c])
AM_INIT_AUTOMAKE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_CONFIG_HEADER(orconfig.h)
......@@ -1324,16 +1325,7 @@ AC_CONFIG_FILES([
contrib/tor.sh
contrib/torctl
contrib/torify
doc/Makefile
src/Makefile
src/common/Makefile
src/config/Makefile
src/config/torrc.sample
src/or/Makefile
src/test/Makefile
src/tools/Makefile
src/tools/tor-fw-helper/Makefile
src/win32/Makefile
tor.spec
])
......
SUBDIRS = suse
DIST_SUBDIRS = suse
confdir = $(sysconfdir)/tor
EXTRA_DIST = \
cross.sh \
exitlist \
linux-tor-prio.sh \
package_nsis-mingw.sh \
rc.subr \
tor-ctrl.sh \
tor-exit-notice.html \
tor-mingw.nsi.in \
tor-tsocks.conf \
tor.ico \
tor.nsi.in \
tor.sh \
torctl
conf_DATA = tor-tsocks.conf
bin_SCRIPTS = torify
include contrib/suse/include.am
EXTRA_DIST+= \
contrib/cross.sh \
contrib/exitlist \
contrib/linux-tor-prio.sh \
contrib/package_nsis-mingw.sh \
contrib/rc.subr \
contrib/tor-ctrl.sh \
contrib/tor-exit-notice.html \
contrib/tor-mingw.nsi.in \
contrib/tor-tsocks.conf \
contrib/tor.ico \
contrib/tor.nsi.in \
contrib/tor.sh \
contrib/torctl
conf_DATA+= contrib/tor-tsocks.conf
bin_SCRIPTS+= contrib/torify
confdir = $(sysconfdir)/tor
EXTRA_DIST = tor.sh
EXTRA_DIST+= contrib/suse/tor.sh
......@@ -18,7 +18,7 @@ demand($TOR_NSI);
open(F, $CONFIGURE_IN) or die "$!";
$version = undef;
while (<F>) {
if (/AM_INIT_AUTOMAKE\(tor,\s*([^\)]*)\)/) {
if (/AC_INIT\(\[tor\],\s*\[([^\]]*)\]\)/) {
$version = $1;
last;
}
......
......@@ -12,8 +12,8 @@
# part of the source distribution, so that people without asciidoc can
# just use the .1 and .html files.
regular_mans = tor tor-gencert tor-resolve torify
all_mans = $(regular_mans) tor-fw-helper
regular_mans = doc/tor doc/tor-gencert doc/tor-resolve doc/torify
all_mans = $(regular_mans) doc/tor-fw-helper
if USE_ASCIIDOC
if USE_FW_HELPER
......@@ -34,11 +34,11 @@ nodist_man_MANS =
doc_DATA =
endif
EXTRA_DIST = HACKING asciidoc-helper.sh \
$(html_in) $(man_in) $(txt_in) \
tor-rpm-creation.txt \
tor-win32-mingw-creation.txt spec/README \
state-contents.txt
EXTRA_DIST+= doc/HACKING doc/asciidoc-helper.sh \
$(html_in) $(man_in) $(txt_in) \
doc/tor-rpm-creation.txt \
doc/tor-win32-mingw-creation.txt doc/spec/README \
doc/state-contents.txt
docdir = @docdir@
......@@ -47,43 +47,43 @@ asciidoc_product = $(nodist_man_MANS) $(doc_DATA)
# Generate the html documentation from asciidoc, but don't do
# machine-specific replacements yet
$(html_in) :
$(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh html @ASCIIDOC@ $(top_srcdir)/doc/$@
$(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh html @ASCIIDOC@ $(top_srcdir)/$@
tor.html.in : tor.1.txt
torify.html.in : torify.1.txt
tor-gencert.html.in : tor-gencert.1.txt
tor-resolve.html.in : tor-resolve.1.txt
tor-fw-helper.html.in : tor-fw-helper.1.txt
doc/tor.html.in : doc/tor.1.txt
doc/torify.html.in : doc/torify.1.txt
doc/tor-gencert.html.in : doc/tor-gencert.1.txt
doc/tor-resolve.html.in : doc/tor-resolve.1.txt
doc/tor-fw-helper.html.in : doc/tor-fw-helper.1.txt
# Generate the manpage from asciidoc, but don't do
# machine-specific replacements yet
$(man_in) :
$(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh man @A2X@ $(top_srcdir)/doc/$@
$(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh man @A2X@ $(top_srcdir)/$@
tor.1.in : tor.1.txt
torify.1.in : torify.1.txt
tor-gencert.1.in : tor-gencert.1.txt
tor-resolve.1.in : tor-resolve.1.txt
tor-fw-helper.1.in : tor-fw-helper.1.txt
doc/tor.1.in : doc/tor.1.txt
doc/torify.1.in : doc/torify.1.txt
doc/tor-gencert.1.in : doc/tor-gencert.1.txt
doc/tor-resolve.1.in : doc/tor-resolve.1.txt
doc/tor-fw-helper.1.in : doc/tor-fw-helper.1.txt
# use ../config.status to swap all machine-specific magic strings
# in the asciidoc with their replacements.
$(asciidoc_product) :
$(AM_V_GEN)if test -e $(top_srcdir)/doc/$@.in && ! test -e ./$@.in ; then \
cp $(top_srcdir)/doc/$@.in .; \
$(AM_V_GEN)if test -e $(top_srcdir)/$@.in && ! test -e $@.in ; then \
cp $(top_srcdir)/$@.in doc/.; \
fi
$(AM_V_GEN)../config.status --file=$@;
$(AM_V_GEN)$(top_srcdir)/config.status --file=$@;
tor.1 : tor.1.in
torify.1 : torify.1.in
tor-gencert.1 : tor-gencert.1.in
tor-resolve.1 : tor-resolve.1.in
tor-fw-helper.1 : tor-fw-helper.1.in
tor.html : tor.html.in
torify.html : torify.html.in
tor-gencert.html : tor-gencert.html.in
tor-resolve.html : tor-resolve.html.in
tor-fw-helper.html : tor-fw-helper.html.in
doc/tor.1 : doc/tor.1.in
doc/torify.1 : doc/torify.1.in
doc/tor-gencert.1 : doc/tor-gencert.1.in
doc/tor-resolve.1 : doc/tor-resolve.1.in
doc/tor-fw-helper.1 : doc/tor-fw-helper.1.in
doc/tor.html : doc/tor.html.in
doc/torify.html : doc/torify.html.in
doc/tor-gencert.html : doc/tor-gencert.html.in
doc/tor-resolve.html : doc/tor-resolve.html.in
doc/tor-fw-helper.html : doc/tor-fw-helper.html.in
CLEANFILES = $(asciidoc_product) config.log
DISTCLEANFILES = $(html_in) $(man_in)
CLEANFILES+= $(asciidoc_product) config.log
DISTCLEANFILES+= $(html_in) $(man_in)
# leave in dependency order, since common must be built first
SUBDIRS = common or test tools win32 config
DIST_SUBDIRS = common or test tools win32 config
noinst_LIBRARIES = libor.a libor-crypto.a libor-event.a
EXTRA_DIST = common_sha1.i sha256.c Makefile.nmake
#CFLAGS = -Wall -Wpointer-arith -O2
if USE_OPENBSD_MALLOC
libor_extra_source=OpenBSD_malloc_Linux.c
else
libor_extra_source=
endif
libor_a_SOURCES = \
address.c \
compat.c \
container.c \
di_ops.c \
log.c \
memarea.c \
mempool.c \
procmon.c \
util.c \
util_codedigest.c \
$(libor_extra_source)
libor_crypto_a_SOURCES = \
aes.c \
crypto.c \
torgzip.c \
tortls.c
libor_event_a_SOURCES = compat_libevent.c
noinst_HEADERS = \
address.h \
aes.h \
ciphers.inc \
compat.h \
compat_libevent.h \
container.h \
crypto.h \
di_ops.h \
ht.h \
memarea.h \
mempool.h \
procmon.h \
strlcat.c \
strlcpy.c \
torgzip.h \
torint.h \
torlog.h \
tortls.h \
util.h
common_sha1.i: $(libor_SOURCES) $(libor_crypto_a_SOURCES) $(noinst_HEADERS)
if test "@SHA1SUM@" != none; then \
(cd "$(srcdir)" && "@SHA1SUM@" $(libor_SOURCES) $(libor_crypto_a_SOURCES) $(noinst_HEADERS)) | "@SED@" -n 's/^\(.*\)$$/"\1\\n"/p' > common_sha1.i; \
elif test "@OPENSSL@" != none; then \
(cd "$(srcdir)" && "@OPENSSL@" sha1 $(libor_SOURCES) $(libor_crypto_a_SOURCES) $(noinst_HEADERS)) | "@SED@" -n 's/SHA1(\(.*\))= \(.*\)/"\2 \1\\n"/p' > common_sha1.i; \
else \
rm common_sha1.i; \
touch common_sha1.i; \
fi
util_codedigest.o: common_sha1.i
crypto.o: sha256.c
noinst_LIBRARIES+= src/common/libor.a src/common/libor-crypto.a src/common/libor-event.a
EXTRA_DIST+= \
src/common/common_sha1.i \
src/common/sha256.c \
src/common/Makefile.nmake
#CFLAGS = -Wall -Wpointer-arith -O2
if USE_OPENBSD_MALLOC
libor_extra_source=src/common/OpenBSD_malloc_Linux.c
else
libor_extra_source=
endif
src_common_libor_a_SOURCES = \
src/common/address.c \
src/common/compat.c \
src/common/container.c \
src/common/di_ops.c \
src/common/log.c \
src/common/memarea.c \
src/common/mempool.c \
src/common/procmon.c \
src/common/util.c \
src/common/util_codedigest.c \
$(libor_extra_source)
src_common_libor_crypto_a_SOURCES = \
src/common/aes.c \
src/common/crypto.c \
src/common/torgzip.c \
src/common/tortls.c
src_common_libor_event_a_SOURCES = src/common/compat_libevent.c
noinst_HEADERS+= \
src/common/address.h \
src/common/aes.h \
src/common/ciphers.inc \
src/common/compat.h \
src/common/compat_libevent.h \
src/common/container.h \
src/common/crypto.h \
src/common/di_ops.h \
src/common/ht.h \
src/common/memarea.h \
src/common/mempool.h \
src/common/procmon.h \
src/common/strlcat.c \
src/common/strlcpy.c \
src/common/torgzip.h \
src/common/torint.h \
src/common/torlog.h \
src/common/tortls.h \
src/common/util.h
src_common_common_sha1.i: $(libor_SOURCES) $(libor_crypto_a_SOURCES) $(noinst_HEADERS)
if test "@SHA1SUM@" != none; then \
(cd "$(srcdir)" && "@SHA1SUM@" $(src_common_libor_SOURCES) $(src_common_libor_crypto_a_SOURCES) $(noinst_HEADERS)) | "@SED@" -n 's/^\(.*\)$$/"\1\\n"/p' > src/common/common_sha1.i; \
elif test "@OPENSSL@" != none; then \
(cd "$(srcdir)" && "@OPENSSL@" sha1 $(src_common_libor_SOURCES) $(src_Common_libor_crypto_a_SOURCES) $(noinst_HEADERS)) | "@SED@" -n 's/SHA1(\(.*\))= \(.*\)/"\2 \1\\n"/p' > src/common/common_sha1.i; \
else \
rm src/common/common_sha1.i; \
touch src/common/common_sha1.i; \
fi
src_common_util_codedigest.o: src/common/common_sha1.i
src_common_crypto.o: src/common/sha256.c
......@@ -2,15 +2,15 @@ confdir = $(sysconfdir)/tor
tordatadir = $(datadir)/tor
EXTRA_DIST = geoip
EXTRA_DIST+= src/config/geoip
# fallback-consensus
conf_DATA = torrc.sample
conf_DATA = src/config/torrc.sample
tordata_DATA = geoip
tordata_DATA = src/config/geoip
# fallback_consensus
# If we don't have it, fake it.
fallback-consensus:
touch fallback-consensus
src_config_fallback-consensus:
touch src/config/fallback-consensus
include src/common/include.am
include src/or/include.am
include src/test/include.am
include src/tools/include.am
include src/win32/include.am
include src/config/include.am
\ No newline at end of file
bin_PROGRAMS = tor
noinst_LIBRARIES = libtor.a
if BUILD_NT_SERVICES
tor_platform_source=ntmain.c
else
tor_platform_source=
endif
EXTRA_DIST=ntmain.c or_sha1.i Makefile.nmake
if USE_EXTERNAL_EVDNS
evdns_source=
else
evdns_source=eventdns.c
endif
libtor_a_SOURCES = \
buffers.c \
circuitbuild.c \
circuitlist.c \
circuituse.c \
command.c \
config.c \
connection.c \
connection_edge.c \
connection_or.c \
control.c \
cpuworker.c \
directory.c \
dirserv.c \
dirvote.c \
dns.c \
dnsserv.c \
geoip.c \
hibernate.c \
main.c \
microdesc.c \
networkstatus.c \
nodelist.c \
onion.c \
transports.c \
policies.c \
reasons.c \
relay.c \
rendclient.c \
rendcommon.c \
rendmid.c \
rendservice.c \
rephist.c \
replaycache.c \
router.c \
routerlist.c \
routerparse.c \
status.c \
$(evdns_source) \
$(tor_platform_source) \
config_codedigest.c
#libtor_a_LIBADD = ../common/libor.a ../common/libor-crypto.a \
# ../common/libor-event.a
tor_SOURCES = tor_main.c
AM_CPPFLAGS = -DSHARE_DATADIR="\"$(datadir)\"" \
-DLOCALSTATEDIR="\"$(localstatedir)\"" \
-DBINDIR="\"$(bindir)\""
# -L flags need to go in LDFLAGS. -l flags need to go in LDADD.
# This seems to matter nowhere but on windows, but I assure you that it
# matters a lot there, and is quite hard to debug if you forget to do it.
tor_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@
tor_LDADD = ./libtor.a ../common/libor.a ../common/libor-crypto.a \
../common/libor-event.a \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \
@TOR_LIB_WS32@ @TOR_LIB_GDI@
noinst_HEADERS = \
buffers.h \
circuitbuild.h \
circuitlist.h \
circuituse.h \
command.h \
config.h \
connection.h \
connection_edge.h \
connection_or.h \
control.h \
cpuworker.h \
directory.h \
dirserv.h \
dirvote.h \
dns.h \
dnsserv.h \
eventdns.h \
eventdns_tor.h \
geoip.h \
hibernate.h \
main.h \
microdesc.h \
networkstatus.h \
nodelist.h \
ntmain.h \
onion.h \
or.h \
transports.h \
policies.h \
reasons.h \
relay.h \
rendclient.h \
rendcommon.h \
rendmid.h \
rendservice.h \
rephist.h \
replaycache.h \
router.h \
routerlist.h \
routerparse.h \
status.h \
micro-revision.i
config_codedigest.o: or_sha1.i
tor_main.o: micro-revision.i
micro-revision.i: FORCE
@rm -f micro-revision.tmp; \
if test -d "$(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; true
or_sha1.i: $(tor_SOURCES) $(libtor_a_SOURCES)
if test "@SHA1SUM@" != none; then \
(cd "$(srcdir)" && "@SHA1SUM@" $(tor_SOURCES) $(libtor_a_SOURCES)) | \
"@SED@" -n 's/^\(.*\)$$/"\1\\n"/p' > or_sha1.i; \
elif test "@OPENSSL@" != none; then \
(cd "$(srcdir)" && "@OPENSSL@" sha1 $(tor_SOURCES) $(libtor_a_SOURCES)) | \
"@SED@" -n 's/SHA1(\(.*\))= \(.*\)/"\2 \1\\n"/p' > or_sha1.i; \
else \
rm or_sha1.i; \
touch or_sha1.i; \
fi
CLEANFILES = micro-revision.i
#Dummy target to ensure that micro-revision.i _always_ gets built.
FORCE:
bin_PROGRAMS+= src/or/tor
noinst_LIBRARIES+= src/or/libtor.a
if BUILD_NT_SERVICES
tor_platform_source=src/or/ntmain.c
else
tor_platform_source=
endif
EXTRA_DIST+= src/or/ntmain.c src/or/or_sha1.i src/or/Makefile.nmake
if USE_EXTERNAL_EVDNS
evdns_source=
else
evdns_source=src/or/eventdns.c
endif
src_or_libtor_a_SOURCES = \
src/or/buffers.c \
src/or/circuitbuild.c \
src/or/circuitlist.c \
src/or/circuituse.c \
src/or/command.c \
src/or/config.c \
src/or/connection.c \
src/or/connection_edge.c \
src/or/connection_or.c \
src/or/control.c \
src/or/cpuworker.c \
src/or/directory.c \
src/or/dirserv.c \
src/or/dirvote.c \
src/or/dns.c \
src/or/dnsserv.c \
src/or/geoip.c \
src/or/hibernate.c \
src/or/main.c \
src/or/microdesc.c \
src/or/networkstatus.c \
src/or/nodelist.c \
src/or/onion.c \
src/or/transports.c \
src/or/policies.c \
src/or/reasons.c \
src/or/relay.c \
src/or/rendclient.c \
src/or/rendcommon.c \
src/or/rendmid.c \
src/or/rendservice.c \
src/or/rephist.c \
src/or/replaycache.c \
src/or/router.c \
src/or/routerlist.c \
src/or/routerparse.c \
src/or/status.c \
$(evdns_source) \
$(tor_platform_source) \
src/or/config_codedigest.c
#libtor_a_LIBADD = ../common/libor.a ../common/libor-crypto.a \
# ../common/libor-event.a
src_or_tor_SOURCES = src/or/tor_main.c
src_or_tor_INCLUDES= -Isrc/or/
src/or/tor_main.c: src/or/micro-revision.i
AM_CPPFLAGS = -DSHARE_DATADIR="\"$(datadir)\"" \
-DLOCALSTATEDIR="\"$(localstatedir)\"" \
-DBINDIR="\"$(bindir)\""
# -L flags need to go in LDFLAGS. -l flags need to go in LDADD.
# This seems to matter nowhere but on windows, but I assure you that it
# matters a lot there, and is quite hard to debug if you forget to do it.
src_or_tor_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@
src_or_tor_LDADD = src/or/libtor.a src/common/libor.a src/common/libor-crypto.a \
src/common/libor-event.a \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \
@TOR_LIB_WS32@ @TOR_LIB_GDI@
noinst_HEADERS+= \
src/or/buffers.h \
src/or/circuitbuild.h \
src/or/circuitlist.h \
src/or/circuituse.h \
src/or/command.h \
src/or/config.h \
src/or/connection.h \
src/or/connection_edge.h \
src/or/connection_or.h \
src/or/control.h \
src/or/cpuworker.h \
src/or/directory.h \