monotone

monotone Mtn Source Tree

Root/Makefile.am

1AUTOMAKE_OPTIONS=subdir-objects 1.7.1
2ACLOCAL_AMFLAGS = -I m4
3
4CMD_SOURCES =\
5cmd.hh cmd_netsync.cc cmd_list.cc cmd_packet.cc cmd_key_cert.cc\
6cmd_merging.cc cmd_db.cc cmd_diff_log.cc cmd_ws_commit.cc\
7cmd_othervcs.cc cmd_automate.cc cmd_files.cc
8
9SANITY_CORE_SOURCES =\
10sanity.cc sanity.hh ui.cc ui.hh quick_alloc.hh\
11vocab.hh vocab.cc vocab_terms.hh vocab_macros.hh\
12charset.cc charset.hh\
13simplestring_xform.cc simplestring_xform.hh\
14constants.cc constants.hh numeric_vocab.hh paths.cc paths.hh\
15interner.hh hash_map.hh platform.hh
16
17LUAEXT_SOURCES =\
18lua.cc lua.hh mkstemp.cc mkstemp.hh file_io.cc file_io.hh\
19globish.cc globish.hh basic_io.cc basic_io.hh
20
21MOST_SOURCES =\
22 $(SANITY_CORE_SOURCES)$(LUAEXT_SOURCES)\
23 app_state.cc app_state.hh\
24 commands.cc commands.hh $(CMD_SOURCES)\
25 diff_patch.cc diff_patch.hh\
26 lua_hooks.cc lua_hooks.hh\
27 transforms.cc transforms.hh\
28 update.cc update.hh\
29 work.cc work.hh\
30 cert.cc cert.hh\
31 database.cc database.hh\
32 key_store.cc key_store.hh\
33 localized_file_io.cc localized_file_io.hh\
34 keys.cc keys.hh\
35 packet.cc packet.hh\
36 rcs_file.cc rcs_file.hh\
37 xdelta.cc xdelta.hh\
38 schema_migration.cc schema_migration.hh\
39 refiner.cc refiner.hh\
40 enumerator.cc enumerator.hh\
41 netsync.cc netsync.hh\
42 netxx_pipe.cc netxx_pipe.hh\
43 netcmd.cc netcmd.hh\
44 merkle_tree.cc merkle_tree.hh\
45 lcs.cc lcs.hh\
46 rcs_import.cc rcs_import.hh\
47 revision.cc revision.hh\
48 cset.cc cset.hh\
49 roster.cc roster.hh\
50 mt_version.cc mt_version.hh\
51 automate.cc\
52 database_check.cc database_check.hh\
53 epoch.cc epoch.hh\
54 inodeprint.cc inodeprint.hh\
55 selectors.cc selectors.hh\
56 annotate.cc annotate.hh\
57 restrictions.cc restrictions.hh\
58 hmac.cc hmac.hh \
59 string_queue.cc string_queue.hh \
60 roster_merge.cc roster_merge.hh \
61 merge.cc merge.hh \
62 legacy.cc legacy.hh \
63 uri.cc uri.hh \
64 \
65 lru_cache.h \
66 \
67 cleanup.hh unit_tests.hh \
68 cycle_detector.hh randomfile.hh adler32.hh \
69 randomizer.cc randomizer.hh \
70 netio.hh smap.hh gettext.h\
71 package_revision.c package_revision.h\
72 package_full_revision.c package_full_revision.h options.hh\
73 i18n.h parallel_iter.hh safe_map.hh pch.hh
74
75if ENABLE_FAKEPTHREAD
76 MOST_SOURCES += fake_pthread.c
77endif
78
79NETXX_SOURCES =\
80netxx/accept.cxx netxx/accept.h netxx/address.cxx\
81netxx/common.h netxx/compat.h netxx/datagram.cxx\
82netxx/datagramserver.cxx netxx/osutil.cxx netxx/osutil.h\
83netxx/peer.cxx netxx/probe.cxx netxx/probe_impl.h\
84netxx/probe_select.cxx netxx/recvfrom.cxx netxx/recvfrom.h\
85netxx/resolve.h netxx/serverbase.cxx netxx/serverbase.h\
86 netxx/sockaddr.cxx netxx/sockaddr.h netxx/socket.cxx\
87netxx/socket.h netxx/sockopt.cxx netxx/stream.cxx\
88netxx/streambase.cxx netxx/streamserver.cxx\
89netxx/address.h netxx/datagram.h netxx/datagramserver.h\
90netxx/netbuf.h netxx/netxx.h netxx/peer.h netxx/probe.h\
91netxx/probeinfo.h netxx/sockopt.h netxx/stream.h netxx/streambase.h\
92netxx/streamserver.h netxx/timeout.h netxx/types.h
93
94BOTAN_SOURCES = \
95 botan/aes.cpp botan/aes_tab.cpp botan/algolist.cpp\
96 botan/allocate.cpp botan/arc4.cpp botan/asn1_alg.cpp\
97 botan/asn1_alt.cpp botan/asn1_att.cpp botan/asn1_dn.cpp\
98 botan/asn1_ext.cpp botan/asn1_ku.cpp botan/asn1_oid.cpp\
99 botan/asn1_str.cpp botan/asn1_tm.cpp botan/barrett.cpp\
100 botan/base.cpp botan/base64.cpp botan/basefilt.cpp\
101 botan/ber_code.cpp botan/ber_dec.cpp botan/big_base.cpp\
102 botan/big_code.cpp botan/big_io.cpp botan/big_ops2.cpp\
103 botan/big_ops3.cpp botan/blinding.cpp botan/buf_es.cpp\
104 botan/buf_filt.cpp botan/cbc.cpp botan/certstore.cpp\
105 botan/cfb.cpp botan/charset.cpp botan/conf.cpp botan/crc32.cpp\
106 botan/crl_ent.cpp botan/ctr.cpp botan/cts.cpp\
107 botan/data_snk.cpp botan/data_src.cpp \
108 botan/def_ops.cpp botan/defalloc.cpp botan/der_code.cpp\
109 botan/der_enc.cpp botan/divide.cpp botan/dl_algo.cpp\
110 botan/dl_group.cpp botan/dl_param.cpp\
111 botan/dl_cache.cpp \
112 botan/dlies.cpp botan/eax.cpp botan/ecb.cpp botan/eme1.cpp\
113 botan/eme_pkcs.cpp botan/emsa1.cpp botan/emsa2.cpp\
114 botan/emsa3.cpp botan/emsa4.cpp botan/emsa_raw.cpp\
115 botan/eng_base.cpp botan/engine.cpp botan/es_file.cpp\
116 botan/exceptn.cpp botan/filter.cpp botan/filters.cpp\
117 botan/fips140.cpp botan/fused.cpp\
118 botan/get_algo.cpp botan/get_enc.cpp botan/get_pbe.cpp\
119 botan/gzip.cpp botan/hash_id.cpp botan/hex.cpp botan/hmac.cpp\
120 botan/if_algo.cpp botan/inifile.cpp botan/init.cpp\
121 botan/kdf.cpp botan/keypair.cpp botan/look_pk.cpp\
122 botan/lookup.cpp botan/make_prm.cpp botan/mdx_hash.cpp\
123 botan/mem_pool.cpp botan/mgf1.cpp botan/mlock.cpp\
124 botan/mod_exp.cpp botan/mode_pad.cpp botan/modebase.cpp\
125 botan/mp_comba.cpp botan/mp_core.cpp botan/mp_fkmul.cpp\
126 botan/mp_misc.cpp botan/mp_mul.cpp botan/mp_shift.cpp\
127 botan/mp_smul.cpp botan/mutex.cpp botan/numthry.cpp\
128 botan/ofb.cpp botan/oids.cpp botan/parsing.cpp botan/pbes1.cpp\
129 botan/pbes2.cpp botan/pem.cpp botan/pipe.cpp botan/pipe_io.cpp\
130 botan/pipe_rw.cpp botan/pk_algs.cpp botan/pk_core.cpp\
131 botan/pk_filts.cpp botan/pk_keys.cpp botan/pk_util.cpp\
132 botan/pkcs10.cpp botan/pkcs8.cpp botan/policy.cpp\
133 botan/pow_mod.cpp \
134 botan/prf_x942.cpp botan/primes.cpp botan/pubkey.cpp\
135 botan/randpool.cpp botan/reducer.cpp botan/rng.cpp\
136 botan/rsa.cpp botan/s2k.cpp botan/secqueue.cpp\
137 botan/sha160.cpp botan/symkey.cpp botan/timers.cpp\
138 botan/ui.cpp botan/util.cpp botan/x509_ca.cpp\
139 botan/x509_crl.cpp botan/x509_key.cpp botan/x509_obj.cpp\
140 botan/x509cert.cpp botan/x509find.cpp botan/x509opt.cpp\
141 botan/des.cpp botan/des_tab.cpp botan/pkcs5.cpp \
142 botan/x509self.cpp botan/x509stor.cpp \
143 botan/def_alg.cpp botan/def_mode.cpp botan/sha256.cpp \
144 botan/x931_rng.cpp botan/out_buf.cpp botan/bit_ops.cpp \
145 \
146 botan/aes.h botan/botan.h botan/def_eng.h botan/es_win32.h\
147 botan/lookup.h botan/randpool.h botan/version.h\
148 botan/algolist.h botan/buf_es.h botan/der_enc.h\
149 botan/exceptn.h botan/mdx_hash.h botan/par_hash.h\
150 botan/reducer.h botan/x509_ca.h botan/allocate.h\
151 botan/buf_filt.h botan/dh.h botan/filter.h botan/mem_ops.h\
152 botan/pbe.h botan/rng.h botan/x509cert.h botan/arc4.h\
153 botan/cbc.h botan/dl_algo.h botan/filters.h botan/mem_pool.h\
154 botan/pbe_pkcs.h botan/rsa.h botan/x509_crl.h botan/asn1.h\
155 botan/certstor.h botan/dlies.h botan/fips140.h botan/mgf1.h\
156 botan/pem.h botan/s2k.h botan/x509_key.h botan/asn1_obj.h\
157 botan/cfb.h botan/dl_param.h botan/modebase.h\
158 botan/pipe.h botan/x509_obj.h\
159 botan/asn1_oid.h botan/conf.h botan/eax.h botan/gzip.h\
160 botan/mode_pad.h botan/pk_algs.h botan/secmem.h\
161 botan/x509self.h botan/barrett.h botan/config.h botan/ecb.h\
162 botan/hex.h botan/mod_exp.h botan/pk_core.h botan/secqueue.h\
163 botan/x509stor.h botan/base64.h botan/crc32.h botan/eme.h\
164 botan/hmac.h botan/mp_core.h botan/pkcs10.h botan/sha160.h\
165 botan/crl_ent.h botan/emsa.h\
166 botan/if_algo.h botan/mp_madd.h botan/pkcs8.h \
167 botan/x919_mac.h botan/basefilt.h botan/ctr.h botan/engine.h\
168 botan/init.h botan/mp_types.h botan/pk_filts.h botan/symkey.h\
169 botan/base.h botan/cts.h botan/enums.h botan/kdf.h\
170 botan/mutex.h botan/pk_keys.h botan/timers.h botan/ber_dec.h\
171 botan/data_snk.h botan/es_capi.h botan/keypair.h\
172 botan/numthry.h botan/pk_ops.h botan/types.h botan/bigint.h\
173 botan/data_src.h botan/es_egd.h botan/look_add.h botan/ofb.h\
174 botan/pk_util.h botan/ui.h botan/blinding.h botan/defalloc.h\
175 botan/es_file.h botan/look_pk.h botan/oids.h botan/pubkey.h\
176 botan/util.h botan/charset.h botan/hash_id.h \
177 botan/des.h botan/pkcs5.h\
178 botan/x931_rng.h botan/sha256.h \
179 botan/parsing.h botan/out_buf.h botan/bit_ops.h
180
181
182
183BOOST_SANDBOX_SOURCES = \
184 boost/circular_buffer_adaptor.hpp \
185boost/circular_buffer_base.hpp \
186boost/circular_buffer_fwd.hpp \
187boost/circular_buffer.hpp
188
189SQLITE_SOURCES = \
190 sqlite/alter.c sqlite/attach.c sqlite/auth.c sqlite/btree.c \
191 sqlite/build.c sqlite/date.c sqlite/delete.c sqlite/expr.c sqlite/func.c \
192 sqlite/hash.c sqlite/insert.c \
193 sqlite/legacy.c sqlite/main.c sqlite/opcodes.c \
194 sqlite/os.c sqlite/os_unix.c sqlite/os_win.c sqlite/os_os2.c \
195 sqlite/pager.c sqlite/parse.c sqlite/pragma.c sqlite/printf.c \
196 sqlite/random.c sqlite/select.c sqlite/table.c sqlite/tokenize.c \
197 sqlite/trigger.c sqlite/update.c sqlite/utf.c \
198 sqlite/util.c sqlite/vacuum.c \
199 sqlite/vdbe.c sqlite/vdbeapi.c sqlite/vdbeaux.c \
200 sqlite/vdbemem.c sqlite/where.c \
201sqlite/prepare.c sqlite/callback.c \
202sqlite/analyze.c sqlite/vdbefifo.c \
203sqlite/complete.c \
204\
205 sqlite/btree.h sqlite/hash.h sqlite/opcodes.h sqlite/os.h \
206 sqlite/os_common.h sqlite/os_os2.h \
207 sqlite/parse.h sqlite/sqlite3.h sqlite/sqliteInt.h sqlite/vdbe.h sqlite/vdbeInt.h \
208sqlite/pager.h
209
210LUA_SOURCES = \
211lua/lapi.c lua/lapi.h lua/lauxlib.c lua/lauxlib.h lua/lbaselib.c \
212lua/lcode.c lua/lcode.h lua/ldblib.c lua/ldebug.c lua/ldebug.h lua/ldo.c \
213lua/ldo.h lua/ldump.c lua/lfunc.c lua/lfunc.h lua/lgc.c lua/lgc.h \
214lua/liolib.c lua/llex.c lua/llex.h lua/llimits.h lua/lmathlib.c lua/lmem.c \
215lua/lmem.h lua/loadlib.c lua/lobject.c lua/lobject.h lua/lopcodes.c \
216lua/lopcodes.h lua/lparser.c lua/lparser.h lua/lstate.c lua/lstate.h \
217lua/lstring.c lua/lstring.h lua/lstrlib.c lua/ltable.c lua/ltable.h \
218lua/ltablib.c lua/ltests.c lua/ltm.c lua/ltm.h lua/lua.h lua/lualib.h \
219lua/lundump.c lua/lundump.h lua/lvm.c lua/lvm.h lua/lzio.c lua/lzio.h
220
221IDNA_SOURCES = \
222idna/gunibreak.h idna/gunidecomp.h idna/idna.h idna/nfkc.c\
223idna/punycode.c idna/rfc3454.c idna/stringprep.h idna/version.c \
224idna/gunicomp.h idna/idna.c idna/idn-int.h idna/profiles.c\
225idna/punycode.h idna/stringprep.c idna/toutf8.c
226
227POPT_SOURCES = \
228popt/findme.c popt/poptconfig.c popt/poptint.h \
229popt/findme.h popt/popt.h popt/poptparse.c \
230popt/popt.c popt/popthelp.c popt/system.h
231
232UNIX_PLATFORM_SOURCES = \
233unix/read_password.cc unix/get_system_flavour.cc unix/process.cc unix/terminal.cc \
234unix/inodeprint.cc unix/fs.cc unix/make_io_binary.cc unix/os_strerror.cc
235
236WIN32_PLATFORM_SOURCES = \
237win32/read_password.cc win32/get_system_flavour.cc win32/process.cc win32/terminal.cc \
238win32/inodeprint.cc win32/fs.cc win32/make_io_binary.cc win32/os_strerror.cc
239
240# primaries
241
242bin_PROGRAMS = mtn
243check_PROGRAMS = unit_tests tester
244noinst_PROGRAMS = txt2c
245EXTRA_PROGRAMS = usher
246
247mtn_SOURCES = $(MOST_SOURCES) monotone.cc main.cc
248usher_SOURCES = contrib/usher.cc
249unit_tests_SOURCES = $(MOST_SOURCES) unit_tests.cc crypto_tests.cc
250tester_SOURCES = $(SANITY_CORE_SOURCES) $(LUAEXT_SOURCES) tester.cc
251
252txt2c_SOURCES = txt2c.cc
253
254noinst_LIBRARIES = libplatform.a lib3rdparty.a
255libplatform_a_SOURCES = platform.hh
256lib3rdparty_a_SOURCES = $(BOOST_SANDBOX_SOURCES) \
257$(BOTAN_SOURCES) \
258$(IDNA_SOURCES) \
259$(POPT_SOURCES) \
260$(NETXX_SOURCES) \
261$(LUA_SOURCES) \
262$(SQLITE_SOURCES)
263
264htmldir = $(datadir)/doc/monotone
265html_DATA = monotone.html
266
267# flags
268
269if BUILD_PCH
270
271PCH_SOURCE = $(srcdir)/pch.hh
272# the .gch file only will be seen if it's in the same dir as the .hh file,
273# so need to copy it for separate build directories
274PCH_BUILD = pch-build.hh
275PCH_FLAGS = -Winvalid-pch -include $(PCH_BUILD)
276PCH_FILE = $(PCH_BUILD).gch
277sinclude $(PCH_FILE).dep
278
279*.o *.lo *.obj: $(PCH_FILE)
280
281$(PCH_BUILD): $(PCH_SOURCE)
282cp $(PCH_SOURCE) $(PCH_BUILD)
283
284$(PCH_FILE): $(PCH_BUILD)
285$(MAKE) PCH_FLAGS= pch-file
286
287pch-file:
288$(CXXCOMPILE) -x c++-header $(PCH_BUILD) -o $(PCH_FILE) \
289 -MT $(PCH_FILE) -MD -MP -MF "./$(PCH_FILE).Tdep" \
290 && mv "./$(PCH_FILE).Tdep" "./$(PCH_FILE).dep" \
291 || rm "./$(PCH_FILE).Tdep"
292endif
293
294SUFFIXES = .gch
295
296AM_CPPFLAGS =
297AM_CFLAGS = $(AM_CPPFLAGS) -DTEMP_STORE=1 -DNDEBUG -DBOOST_DISABLE_THREADS -DBOOST_SP_DISABLE_THREADS -DSQLITE_OMIT_CURSOR -DTHREADSAFE=0 -DSQLITE_THREAD_OVERRIDE_LOCK=-1 $(SQLITE_CPPFLAGS)
298AM_CXXFLAGS = $(AM_CPPFLAGS) -DNDEBUG -DBOOST_DISABLE_THREADS -DBOOST_SP_DISABLE_THREADS
299AM_LDFLAGS =
300
301lib3rdparty_a_CPPFLAGS =
302lib3rdparty_a_CFLAGS = $(AM_CFLAGS) $(LIB3RDPARTY_CFLAGS)
303lib3rdparty_a_CXXFLAGS = $(AM_CXXFLAGS) $(LIB3RDPARTY_CXXFLAGS)
304
305mtn_LDFLAGS =
306mtn_CPPFLAGS = -I$(top_srcdir)/lua -I$(top_srcdir)/sqlite
307mtn_CFLAGS = $(AM_CFLAGS) $(MTN_CFLAGS)
308mtn_CXXFLAGS = $(AM_CXXFLAGS) $(PCH_FLAGS) $(MTN_CXXFLAGS)
309
310unit_tests_LDFLAGS =
311unit_tests_CPPFLAGS = -DBUILD_UNIT_TESTS -I$(top_srcdir)/lua -I$(top_srcdir)/sqlite
312unit_tests_CXXFLAGS = $(AM_CXXFLAGS) $(PCH_FLAGS)
313
314tester_LDFLAGS =
315tester_CPPFLAGS = -I$(top_srcdir)/lua
316tester_CXXFLAGS = $(AM_CXXFLAGS)
317
318# conditionals from configury
319
320if STATIC_BOOST
321 BOOSTLIBS = @BOOST_LIBDIR@/libboost_filesystem$(BOOST_SUFFIX).a \
322 @BOOST_LIBDIR@/libboost_date_time$(BOOST_SUFFIX).a \
323 @BOOST_LIBDIR@/libboost_regex$(BOOST_SUFFIX).a
324 mtn_LDADD = lib3rdparty.a $(BOOSTLIBS)
325 unit_tests_LDADD = lib3rdparty.a $(BOOSTLIBS) \
326 @BOOST_LIBDIR@/libboost_unit_test_framework$(BOOST_SUFFIX).a
327 tester_LDADD = lib3rdparty.a $(BOOSTLIBS)
328else
329 mtn_LDADD = lib3rdparty.a
330 unit_tests_LDADD = lib3rdparty.a -lboost_unit_test_framework$(BOOST_SUFFIX)
331 tester_LDADD = lib3rdparty.a
332endif
333
334mtn_LDADD += libplatform.a $(LIBICONV) $(LIBINTL)
335unit_tests_LDADD += libplatform.a $(LIBICONV) $(LIBINTL)
336tester_LDADD += libplatform.a $(LIBICONV) $(LIBINTL)
337
338if WITH_CRYPTO
339 AM_CPPFLAGS += -DWITH_CRYPTO
340endif
341
342if WIN32_PLATFORM
343 libplatform_a_SOURCES += $(WIN32_PLATFORM_SOURCES)
344 mtn_LDADD += -lshfolder -lws2_32 -lintl -liconv -liphlpapi
345 unit_tests_LDADD += -lshfolder -lws2_32 -lintl -liconv -liphlpapi
346 lib3rdparty_a_CPPFLAGS += -DWIN32 -DBOTAN_EXT_ENTROPY_SRC_CAPI -DBOTAN_EXT_ENTROPY_SRC_WIN32
347 lib3rdparty_a_SOURCES += botan/es_capi.cpp botan/es_win32.cpp
348else
349 libplatform_a_SOURCES += $(UNIX_PLATFORM_SOURCES)
350endif
351
352if MISSING_INET_PTON
353 lib3rdparty_a_SOURCES += netxx/inet_pton.cxx netxx/inet_pton.h
354 lib3rdparty_a_CPPFLAGS += -DNETXX_NO_PTON
355endif
356
357if MISSING_INET_NTOP
358 lib3rdparty_a_SOURCES += netxx/inet_ntop.cxx netxx/inet_ntop.h
359 lib3rdparty_a_CPPFLAGS += -DNETXX_NO_NTOP
360endif
361
362if MISSING_GETADDRINFO
363 lib3rdparty_a_SOURCES += netxx/resolve_gethostbyname.cxx netxx/resolve_getservbyname.cxx
364else
365 lib3rdparty_a_SOURCES += netxx/resolve_getaddrinfo.cxx
366endif
367
368if MISSING_INET6
369 lib3rdparty_a_CPPFLAGS += -DNETXX_NO_INET6
370endif
371
372# i18n support
373
374SUBDIRS = po
375datadir = @datadir@
376localedir = $(datadir)/locale
377DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
378
379# extra files
380
381PDF_FIGURES= figures/branch-heads.pdf figures/cert.pdf\
382figures/difference-between-versions.pdf\
383figures/file-id-manifest-id.pdf figures/fork.pdf\
384figures/general-workflow.pdf figures/linear-history.pdf\
385figures/local-workflow.pdf figures/manifest.pdf figures/merge.pdf\
386figures/network-workflow.pdf figures/parent-child-hashes.pdf\
387figures/parent-child-names-hashes.pdf figures/parent-child.pdf\
388figures/revision-chaining.pdf figures/revision.pdf\
389figures/statement.pdf figures/three-versions.pdf\
390figures/two-branches.pdf
391
392PNG_FIGURES=$(addprefix $(top_builddir)/figures/,$(notdir $(PDF_FIGURES:.pdf=.png)))
393EPS_FIGURES=$(addprefix $(top_builddir)/figures/,$(notdir $(PDF_FIGURES:.pdf=.eps)))
394
395man1_MANS = mtn.1
396info_TEXINFOS = monotone.texi
397EXTRA_DIST = $(man1_MANS) \
398 $(PDF_FIGURES) \
399 $(PNG_FIGURES) \
400 INSTALL \
401 README.changesets \
402 UPGRADE \
403 monotone.spec \
404 monotone.html \
405 texinfo.css \
406 schema.sql \
407 std_hooks.lua test_hooks.lua tester.lua \
408 testsuite.lua $(srcdir)/tests \
409 tester-testsuite.lua $(srcdir)/tester-tests/ \
410 package.m4 \
411 package_revision.txt package_full_revision_dist.txt \
412 $(wildcard $(srcdir)/m4/*.m4) \
413 popt/README popt/CHANGES popt/COPYING popt/popt.3 popt/popt.ps \
414 $(wildcard $(srcdir)/popt/test?.c) popt/testit.sh \
415 sqlite/keywordhash.h \
416 contrib/README \
417 contrib/monoprof.sh \
418 contrib/monotone-notify.pl \
419 contrib/monotone-import.pl \
420 contrib/ciabot_monotone.py \
421 contrib/monotone.el \
422 contrib/monotone-nav.el \
423 contrib/monotone.bash_completion \
424 contrib/monotone.zsh_completion \
425 contrib/mtbrowse.sh \
426 contrib/colorize \
427 contrib/color-logs.sh \
428 contrib/color-logs.conf \
429 contrib/get_stdio.pl \
430 contrib/ciabot_monotone_hookversion.py \
431 contrib/monotone-cvs-ignore.lua \
432 contrib/usher.cc \
433 $(wildcard $(srcdir)/examples/*) \
434 win32/monotone.iss win32/modpath.iss \
435 $(wildcard $(srcdir)/debian/*)
436
437MAKEINFOFLAGS=-I $(top_builddir)
438
439monotone.info: monotone.texi version.texi std_hooks.lua
440
441monotone.pdf: monotone.texi version.texi std_hooks.lua $(PDF_FIGURES)
442
443monotone.dvi: monotone.texi version.texi std_hooks.lua $(EPS_FIGURES)
444
445#%.eps: %.epsi
446#mv -f $< $@
447#
448#%.epsi: %.ps
449#ps2epsi $< $@
450
451%.eps : %.ps
452ps2eps <$< >$@
453
454$(top_builddir)/figures/%.ps: $(srcdir)/figures/%.pdf
455mkdir -p $(top_builddir)/figures
456#acroread -toPostScript -pairs $< $@
457pdftops $< $@
458
459
460# testsuite stuff (could this possibly be more ugly?)
461
462if BUILD_UNIT_TESTS
463TESTS = unit_tests run_lua_tests
464else
465TESTS = run_lua_tests
466endif
467
468TESTS_ENVIRONMENT=AUTOTEST_PATH="."
469
470mostlyclean-local:
471rm -rf tester_dir package_full_revision.txt
472
473DISTCLEANFILES = mt-stdint.h xgettext.opts pch-build.hh.gch.dep run_lua_tests
474
475# distcheck stuff
476
477DISTCHECK_CONFIGURE_FLAGS = \
478 --with-bundled-sqlite \
479 --with-bundled-lua \
480 --enable-static-boost
481
482# note: these targets are all in srcdir; they are *not* built during
483# the VPATH build part of distcheck (with non-writable source
484# directory) but only during the initial dist stage.
485
486$(srcdir)/package.m4: $(top_srcdir)/configure.ac
487{ \
488 echo '# Signature of the current package.'; \
489 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
490 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
491 echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
492 echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
493 echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
494} >$(srcdir)/package.m4
495
496run_lua_tests: Makefile
497echo '#!/bin/sh' > $@ ; \
498echo 'PATH=$(top_builddir):$$PATH' >> $@ ; \
499echo 'exec $(top_builddir)/tester $(srcdir)/testsuite.lua "$$@"' >> $@ ; \
500chmod 755 $@
501
502# we generate some headers to copy data into the executable
503
504BUILT_SOURCES_CLEAN = std_hooks.h test_hooks.h tester.h \
505 schema.h \
506 package_revision.c \
507 package_full_revision.txt package_full_revision_raw.txt package_full_revision.c \
508 $(PCH_FILE) $(PCH_BUILD)
509BUILT_SOURCES_NOCLEAN = package_revision.txt package_full_revision_dist.txt
510BUILT_SOURCES = $(BUILT_SOURCES_CLEAN) $(BUILT_SOURCES_NOCLEAN)
511CLEANFILES = $(BUILT_SOURCES_CLEAN) $(EPS_FIGURES)
512
513txt2c: txt2c.cc Makefile
514$(CXX) $(CXXFLAGS) -o $@ $<
515chmod 0755 $@$(EXEEXT)
516
517.PHONY: apidocs
518apidocs:
519doxygen doxygen.cfg
520
521%.h: %.sql txt2c Makefile
522./txt2c $< $(*F) >$@.tmp
523cmp -s $@.tmp $@ || mv -f $@.tmp $@
524rm -f $@.tmp
525
526%.h: %.lua txt2c Makefile
527./txt2c $< $(*F) >$@.tmp
528cmp -s $@.tmp $@ || mv -f $@.tmp $@
529rm -f $@.tmp
530
531# A fake target so we can use _MTN/revision as a prerequisite, yet not
532# crash if _MTN/revision does not exist.
533$(srcdir)/_MTN/revision:
534true
535package_revision.txt: $(srcdir)/_MTN/revision
536if [ -f $< ]; then cp $< $@; fi
537if [ ! -f $@ ]; then echo "unknown" > $@; fi
538package_revision.c: package_revision.txt txt2c Makefile
539./txt2c --strip-trailing --no-static $< package_revision >$@.tmp
540cmp -s $@.tmp $@ || mv -f $@.tmp $@
541rm -f $@.tmp
542
543# To avoid a dependency loop here, what we do is:
544# calculate changes
545# |
546# package_full_revision_raw.txt
547# | \ <-- add "generated from cached data" text
548# | package_full_revision_dist.txt
549# | /
550# package_full_revision.txt
551
552# This is phony, so that we always try to rebuild it. If it succeeds
553# in calculating changes, it produces its target; otherwise, its
554# target does not exist.
555.PHONY: package_full_revision_raw.txt
556package_full_revision_raw.txt:
557# if both attempts fail, then we need to remove the empty file that >
558# creates, and also make sure that the shell command exits
559# successfully; the rm -f ensures both
560REAL_BLDDIR=$$PWD/$(top_builddir); \
561(cd $(srcdir) && $$REAL_BLDDIR/mtn --root=. automate get_revision) 2>/dev/null >$@ \
562|| (cd $(srcdir) && mtn --root=. automate get_revision) 2>/dev/null >$@ \
563|| rm -f $@
564# See above comment -- the file this depends on may or may not exist.
565# This file, however, must always exist, so that 'make dist' can
566# include it in the tarball it generates. So there are three cases:
567# -- if the raw file does not exist, then
568# -- if the dist file exists, then we leave it alone
569# -- if the dist file does not exist, then we say "unknown"
570# -- if the raw file does exist, then we regenerate the dist file
571package_full_revision_dist.txt: package_full_revision_raw.txt
572if [ -f $< ]; then \
573 cp -f $< $@ \
574 && (echo ''; \
575 echo ' Generated from data cached in the distribution;'; \
576 echo ' further changes may have been made.') >> $@; \
577fi
578[ -f $@ ] || echo "unknown" > $@
579# The raw file may not exist, but the dist file definitely does; we
580# just take the first dependency that exists.
581package_full_revision.txt: package_full_revision_raw.txt package_full_revision_dist.txt
582rm -f $@
583for SRC in $^; do ([ -f $$SRC -a ! -f $@ ] && cp -f $$SRC $@) || true; done
584package_full_revision.c: package_full_revision.txt txt2c Makefile
585./txt2c --no-static $< package_full_revision >$@.tmp
586cmp -s $@.tmp $@ || mv -f $@.tmp $@
587rm -f $@.tmp
588
589# This is a magic directive copy-and-pasted, then modified, from the
590# automake 1.9 manual, section 13.4, "Checking the distribution".
591# Normally, 'distcheck' does a clean build, and then afterwards runs
592# 'distclean', and 'distclean' is supposed to remove everything that
593# the build created. However, we have some targets
594# (package_revision.txt, package_full_revision_dist.txt) that we
595# distribute, but then always attempt to rebuild optimistically, and
596# then if that fails fall back on the distributed versions. This
597# means that 'distclean' should _not_ remove those files, since they
598# are distributed, yet building the package will generate those files,
599# those automake thinks that 'distclean' _should_ remove those files,
600# and 'distcheck' gets cranky if we don't. So basically what this
601# line does is tell 'distcheck' to shut up and ignore those two files.
602distcleancheck_listfiles = find . -type f -a ! -name package_revision.txt -a ! -name package_full_revision_dist.txt
603
604# automake doesn't build html docs
605
606CHECK_SRCDIR_EQ_BUILDDIR=[ "`cd \"$(srcdir)\"; pwd`" = "`pwd`" -a -f ./monotone.texi ]
607
608monotone.html: monotone.texi version.texi std_hooks.lua texinfo.css
609if $(CHECK_SRCDIR_EQ_BUILDDIR); then :; else \
610cp -r $(srcdir)/figures .; \
611cp $(srcdir)/texinfo.css .; \
612fi
613makeinfo -I $(srcdir) --no-split --no-headers --output $@ --html $<
614cp $@ $@.bak
615sed -e 's,<head>,<head><link type="text/css" rel="stylesheet" href="texinfo.css" />,' $@.bak >$@
616rm -f $@.bak
617
618html: monotone.texi version.texi std_hooks.lua texinfo.css
619if $(CHECK_SRCDIR_EQ_BUILDDIR); then :; else \
620cp -r $(srcdir)/figures .; \
621fi
622mkdir -p $@
623cp -r $(srcdir)/figures $@
624cp $(srcdir)/texinfo.css $@
625makeinfo -I $(srcdir) --number-sections --html --output $@ $<
626for f in $@/*.html; do \
627cp $$f $$f.bak; \
628sed -e 's,<head>,<head><link type="text/css" rel="stylesheet" href="texinfo.css" />,' $$f.bak >$$f; \
629rm -f $$f.bak; \
630done
631
632# Explicit dependencies of object files on generated headers, so Make
633# knows it has to build 'em.
634mtn-lua_hooks.o unit_tests-lua_hooks.o : test_hooks.h std_hooks.h
635mtn-database.o unit_tests-database.o : schema.h
636
637tester.o : tester.h

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status