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.cccmd_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 quick_alloc.hh vector.hh base.hh\
11simplestring_xform.cc simplestring_xform.hh \
12constants.cc constants.hh numeric_vocab.hh \
13platform.hh numeric_vocab.cc
14
15LUAEXT_SOURCES = \
16vocab.hh vocab.cc vocab_terms.hh vocab_macros.hh vocab_cast.hh \
17charset.cc charset.hh paths.cc paths.hh\
18interner.hh hash_map.hhvocab_hash.hh\
19luaext_mkstemp.cc luaext_parse_basic_io.cc\
20luaext_guess_binary.cc luaext_platform.cc luaext_globish.cc\
21lua.cc lua.hh mkstemp.cc mkstemp.hh file_io.cc file_io.hh\
22globish.cc globish.hh basic_io.cc basic_io.hh
23
24MOST_SOURCES = \
25$(SANITY_CORE_SOURCES) $(LUAEXT_SOURCES) platform-wrapped.hh\
26mtn-sanity.cc mtn-sanity.hh ui.cc ui.hh\
27app_state.cc app_state.hh\
28commands.cc commands.hh $(CMD_SOURCES)\
29diff_patch.cc diff_patch.hh\
30lua_hooks.cc lua_hooks.hh \
31transforms.cc transforms.hh\
32update.cc update.hh\
33work.cc work_migration.cc work.hh\
34cert.cc cert.hh\
35project.cc project.hh\
36outdated_indicator.cc outdated_indicator.hh\
37database.cc database.hh\
38key_store.cc key_store.hh\
39ssh_agent.cc ssh_agent.hh\
40keys.cc keys.hh\
41packet.cc packet.hh\
42rcs_file.cc rcs_file.hh\
43xdelta.cc xdelta.hh\
44schema_migration.cc schema_migration.hh\
45refiner.cc refiner.hh\
46enumerator.cc enumerator.hh\
47netsync.cc \
48netxx_pipe.cc netxx_pipe.hh\
49netcmd.cc netcmd.hh\
50merkle_tree.cc merkle_tree.hh \
51lcs.cc lcs.hh\
52rcs_import.cc rcs_import.hh \
53revision.cc revision.hh\
54cset.cc cset.hh\
55roster.cc roster.hh \
56mt_version.cc mt_version.hh\
57automate.cc\
58database_check.cc database_check.hh\
59epoch.cc epoch.hh\
60inodeprint.cc inodeprint.hh\
61selectors.cc selectors.hh\
62annotate.cc annotate.hh\
63restrictions.ccrestrictions.hh\
64hmac.cc hmac.hh\
65string_queue.cc string_queue.hh\
66roster_merge.cc roster_merge.hh\
67merge.cc merge.hh\
68legacy.cc legacy.hh uri.cc uri.hh\
69graph.cc graph.hh\
70roster_delta.cc roster_delta.hh\
71sha1.hh sha1.cc sha1_engine.hh \
72pcrewrap.cc pcrewrap.hh\
73rev_height.cc rev_height.hh\
74asciik.cc asciik.hh\
75dates.cc dates.hh\
76\
77lru_writeback_cache.hh hybrid_map.hh\
78\
79cleanup.hh unit_tests.hh\
80cycle_detector.hh randomfile.hh adler32.hh\
81randomizer.cc randomizer.hh\
82netio.hh smap.hh gettext.h\
83package_revision.c package_revision.h\
84package_full_revision.c package_full_revision.h\
85option.cc option.hh options.cc options.hh options_list.hh\
86specialized_lexical_cast.cc lexical_cast.hh\
87i18n.h parallel_iter.hh safe_map.hh pch.hh current_exception.hh
88
89NETXX_SOURCES =\
90netxx/accept.cxx netxx/accept.h netxx/address.cxx\
91netxx/common.h netxx/compat.h netxx/datagram.cxx\
92netxx/datagramserver.cxx netxx/osutil.cxx netxx/osutil.h\
93netxx/peer.cxx netxx/probe.cxx netxx/probe_impl.h\
94netxx/probe_select.cxx netxx/recvfrom.cxx netxx/recvfrom.h\
95netxx/resolve.h netxx/serverbase.cxx netxx/serverbase.h\
96netxx/sockaddr.cxx netxx/sockaddr.h netxx/socket.cxx \
97netxx/socket.h netxx/sockopt.cxx netxx/stream.cxx\
98netxx/streambase.cxx netxx/streamserver.cxx\
99netxx/address.h netxx/datagram.h netxx/datagramserver.h\
100netxx/netbuf.h netxx/netxx.h netxx/peer.h netxx/probe.h \
101netxx/probeinfo.h netxx/sockopt.h netxx/stream.h\
102netxx/streambase.h netxx/streamserver.h netxx/timeout.h\
103netxx/types.h
104
105BOTAN_SOURCES = \
106botan/aes.cpp botan/aes_tab.cpp \
107botan/arc4.cpp botan/alg_id.cpp \
108botan/asn1_alt.cpp botan/asn1_att.cpp botan/asn1_dn.cpp \
109botan/asn1_ku.cpp botan/asn1_oid.cpp \
110botan/asn1_str.cpp botan/asn1_tm.cpp \
111botan/base.cpp botan/base64.cpp botan/basefilt.cpp \
112botan/ber_dec.cpp botan/big_base.cpp \
113botan/big_code.cpp botan/big_io.cpp botan/big_ops2.cpp \
114botan/big_ops3.cpp botan/blinding.cpp botan/buf_es.cpp \
115botan/buf_filt.cpp botan/cbc.cpp botan/certstor.cpp \
116botan/cfb.cpp botan/charset.cpp botan/crc32.cpp \
117botan/crl_ent.cpp botan/ctr.cpp botan/cts.cpp \
118botan/data_snk.cpp botan/data_src.cpp \
119botan/def_ops.cpp botan/defalloc.cpp \
120botan/der_enc.cpp botan/divide.cpp botan/dl_algo.cpp \
121botan/dl_group.cpp \
122botan/dlies.cpp botan/eax.cpp botan/ecb.cpp botan/eme1.cpp \
123botan/eme_pkcs.cpp botan/emsa1.cpp botan/emsa2.cpp \
124botan/emsa3.cpp botan/emsa4.cpp botan/emsa_raw.cpp \
125botan/eng_base.cpp botan/engine.cpp botan/es_file.cpp \
126botan/exceptn.cpp botan/filter.cpp botan/filters.cpp \
127botan/fips140.cpp \
128botan/get_algo.cpp botan/get_enc.cpp botan/get_pbe.cpp \
129botan/gzip.cpp botan/hash_id.cpp botan/hex.cpp botan/hmac.cpp \
130botan/if_algo.cpp botan/inifile.cpp botan/init_def.cpp \
131botan/kdf.cpp botan/keypair.cpp botan/look_pk.cpp \
132botan/make_prm.cpp botan/mdx_hash.cpp \
133botan/mem_pool.cpp botan/mgf1.cpp botan/mlock.cpp \
134botan/mode_pad.cpp botan/modebase.cpp \
135botan/mp_comba.cpp botan/mp_mulop.cpp \
136botan/mp_misc.cpp botan/mp_mul.cpp botan/mp_shift.cpp \
137botan/mutex.cpp botan/numthry.cpp \
138botan/ofb.cpp botan/oids.cpp botan/parsing.cpp botan/pbes1.cpp \
139botan/pbes2.cpp botan/pem.cpp botan/pipe.cpp botan/pipe_io.cpp \
140botan/pipe_rw.cpp botan/pk_algs.cpp botan/pk_core.cpp \
141botan/pk_filts.cpp botan/pk_keys.cpp botan/pk_util.cpp \
142botan/pkcs10.cpp botan/pkcs8.cpp botan/policy.cpp \
143botan/pow_mod.cpp \
144botan/prf_x942.cpp botan/primes.cpp botan/pubkey.cpp \
145botan/randpool.cpp botan/reducer.cpp botan/rng.cpp \
146botan/rsa.cpp botan/s2k.cpp botan/secqueue.cpp \
147botan/sha160.cpp botan/symkey.cpp botan/timers.cpp \
148botan/ui.cpp botan/util.cpp botan/x509_ca.cpp \
149botan/x509_crl.cpp botan/x509_key.cpp botan/x509_obj.cpp \
150botan/x509cert.cpp botan/x509find.cpp botan/x509opt.cpp \
151botan/des.cpp botan/des_tab.cpp botan/pkcs5.cpp \
152botan/x509self.cpp botan/x509stor.cpp \
153botan/def_alg.cpp botan/def_mode.cpp botan/sha256.cpp \
154botan/x931_rng.cpp botan/out_buf.cpp botan/bit_ops.cpp \
155botan/big_rand.cpp botan/def_powm.cpp botan/libstate.cpp \
156botan/modules.cpp botan/mp_numth.cpp \
157botan/mp_sqr.cpp botan/powm_fw.cpp \
158botan/powm_mnt.cpp botan/mp_asm.cpp \
159botan/asn1_int.cpp botan/config.cpp botan/datastor.cpp \
160botan/def_char.cpp botan/init_opt.cpp botan/jacobi.cpp \
161botan/x509_ext.cpp botan/x509stat.cpp \
162\
163botan/aes.h botan/botan.h botan/es_win32.h \
164botan/lookup.h botan/randpool.h botan/version.h \
165botan/buf_es.h botan/der_enc.h \
166botan/exceptn.h botan/mdx_hash.h \
167botan/reducer.h botan/x509_ca.h botan/allocate.h \
168botan/buf_filt.h botan/dh.h botan/filter.h botan/mem_ops.h \
169botan/pbe.h botan/rng.h botan/x509cert.h botan/arc4.h \
170botan/cbc.h botan/dl_algo.h botan/filters.h botan/mem_pool.h \
171botan/pbe_pkcs.h botan/rsa.h botan/x509_crl.h \
172botan/certstor.h botan/dlies.h botan/fips140.h botan/mgf1.h \
173botan/pem.h botan/s2k.h botan/x509_key.h botan/asn1_obj.h \
174botan/cfb.h botan/modebase.h \
175botan/pipe.h botan/x509_obj.h \
176botan/asn1_oid.h botan/eax.h botan/gzip.h \
177botan/mode_pad.h botan/pk_algs.h botan/secmem.h \
178botan/x509find.h botan/x509self.h botan/config.h botan/ecb.h \
179botan/hex.h botan/pk_core.h botan/secqueue.h \
180botan/x509stor.h botan/base64.h botan/crc32.h botan/eme.h \
181botan/hmac.h botan/mp_core.h botan/pkcs10.h botan/sha160.h \
182botan/crl_ent.h botan/emsa.h botan/eng_def.h \
183botan/if_algo.h botan/pkcs8.h \
184botan/basefilt.h botan/ctr.h botan/engine.h \
185botan/init.h botan/mp_types.h botan/pk_filts.h botan/symkey.h \
186botan/base.h botan/cts.h botan/enums.h botan/kdf.h \
187botan/mutex.h botan/pk_keys.h botan/timers.h botan/ber_dec.h \
188botan/data_snk.h botan/es_capi.h botan/keypair.h \
189botan/numthry.h botan/pk_ops.h botan/types.h botan/bigint.h \
190botan/data_src.h botan/es_egd.h botan/look_add.h botan/ofb.h \
191botan/pk_util.h botan/ui.h botan/blinding.h botan/defalloc.h \
192botan/es_file.h botan/look_pk.h botan/oids.h botan/pubkey.h \
193botan/util.h botan/charset.h botan/hash_id.h \
194botan/des.h botan/pkcs5.h \
195botan/x931_rng.h botan/sha256.h \
196botan/parsing.h botan/out_buf.h botan/bit_ops.h \
197botan/def_powm.h botan/dl_group.h botan/libstate.h \
198botan/modules.h botan/mp_asm.h botan/pow_mod.h botan/mp_asmi.h \
199botan/build.h botan/asn1_int.h botan/datastor.h botan/def_char.h \
200botan/stl_util.h botan/x509_ext.h botan/x509stat.h \
201botan/alg_id.h
202
203BOOST_SANDBOX_SOURCES =\
204boost/circular_buffer_adaptor.hpp\
205boost/circular_buffer_base.hpp\
206boost/circular_buffer_fwd.hpp\
207boost/circular_buffer.hpp
208
209SQLITE_SOURCES =\
210sqlite/alter.c sqlite/attach.c sqlite/auth.c sqlite/btree.c\
211sqlite/build.c sqlite/date.c sqlite/delete.c sqlite/expr.c\
212sqlite/func.c sqlite/hash.c sqlite/insert.c\
213sqlite/legacy.csqlite/main.c sqlite/opcodes.c\
214sqlite/os.c sqlite/os_unix.c sqlite/os_win.c sqlite/os_os2.c\
215sqlite/pager.c sqlite/parse.c sqlite/pragma.c sqlite/printf.c\
216sqlite/random.c sqlite/select.c\
217sqlite/table.c sqlite/tokenize.c\
218sqlite/trigger.c sqlite/update.c sqlite/utf.c\
219sqlite/util.c sqlite/vacuum.c\
220sqlite/vdbe.c sqlite/vdbeapi.c sqlite/vdbeaux.c\
221sqlite/vdbemem.c sqlite/where.c\
222sqlite/prepare.c sqlite/callback.c\
223sqlite/analyze.c sqlite/vdbefifo.c\
224sqlite/complete.c sqlite/malloc.c sqlite/vdbeblob.c\
225sqlite/loadext.c sqlite/vtab.c\
226\
227sqlite/btree.h sqlite/hash.h sqlite/opcodes.h sqlite/os.h\
228sqlite/os_common.h sqlite/os_os2.h\
229sqlite/parse.h sqlite/sqlite3.hsqlite/sqlite3ext.h\
230sqlite/sqliteInt.h\
231sqlite/vdbe.h sqlite/vdbeInt.h\
232sqlite/pager.h sqlite/btreeInt.h sqlite/sqliteLimit.h
233
234LUA_SOURCES =\
235lua/lapi.cc lua/lapi.h\
236lua/lcode.cc lua/lcode.h\
237lua/ldebug.cc lua/ldebug.h\
238lua/ldo.cc lua/ldo.h\
239lua/ldump.cc\
240lua/lfunc.cc lua/lfunc.h\
241lua/lgc.cc lua/lgc.h\
242lua/linit.cc\
243lua/llex.cc lua/llex.h\
244lua/lmem.cc lua/lmem.h\
245lua/lobject.cc lua/lobject.h\
246lua/lopcodes.cc lua/lopcodes.h\
247lua/lparser.cc lua/lparser.h\
248lua/lstate.cc lua/lstate.h\
249lua/lstring.cc lua/lstring.h\
250lua/ltable.cc lua/ltable.h\
251lua/ltests.cc\
252lua/ltm.cc lua/ltm.h\
253lua/lundump.cc lua/lundump.h\
254lua/lvm.cc lua/lvm.h\
255lua/lzio.cc lua/lzio.h\
256\
257lua/luaconf.h lua/llimits.h\
258lua/lua.h lua/lauxlib.hlua/lualib.h\
259\
260lua/lauxlib.cc\
261lua/lbaselib.cc\
262lua/ldblib.cc\
263lua/liolib.cc\
264lua/lmathlib.cc\
265lua/loadlib.cc\
266lua/lstrlib.cc\
267lua/ltablib.cc\
268lua/loslib.cc
269
270IDNA_SOURCES =\
271idna/gunibreak.h idna/gunidecomp.h idna/idna.h idna/nfkc.c\
272idna/punycode.c idna/rfc3454.c idna/stringprep.h idna/version.c\
273idna/gunicomp.h idna/idna.c idna/idn-int.h idna/profiles.c\
274idna/punycode.h idna/stringprep.c idna/toutf8.c
275
276PCRE_SOURCES =\
277pcre/pcre_chartables.c pcre/pcre_compile.c pcre/pcre_config.c\
278pcre/pcre_dfa_exec.c pcre/pcre_exec.c pcre/pcre_fullinfo.c\
279pcre/pcre_get.c pcre/pcre_globals.c pcre/pcre_info.c\
280pcre/pcre_maketables.c pcre/pcre_newline.c\
281pcre/pcre_ord2utf8.c pcre/pcre_refcount.c pcre/pcre_study.c\
282pcre/pcre_tables.c pcre/pcre_try_flipped.c\
283pcre/pcre_ucp_searchfuncs.c pcre/pcre_valid_utf8.c\
284pcre/pcre_version.c pcre/pcre_xclass.c pcre/pcre_config.h\
285pcre/pcre.h pcre/pcre_internal.h pcre/ucp.h pcre/ucpinternal.h\
286pcre/ucptable.h
287
288UNIX_PLATFORM_SOURCES =\
289unix/read_password.cc unix/get_system_flavour.cc\
290unix/process.cc unix/terminal.cc unix/inodeprint.cc\
291unix/fs.cc unix/make_io_binary.cc unix/os_strerror.cc \
292unix/cputime.cc unix/ssh_agent_platform.cc\
293unix/ssh_agent_platform.hh unix/tester-plaf.cc
294
295WIN32_PLATFORM_SOURCES =\
296win32/read_password.cc win32/get_system_flavour.cc\
297win32/process.cc win32/terminal.cc win32/inodeprint.cc\
298win32/fs.cc win32/make_io_binary.cc win32/os_strerror.cc\
299win32/cputime.cc win32/ssh_agent_platform.cc\
300win32/ssh_agent_platform.hh win32/tester-plaf.cc
301
302# these files contain unit tests
303UNIT_TEST_SOURCES =\
304basic_io.cc charset.cc commands.cc crypto_tests.cc cset.cc\
305dates.cc diff_patch.cc globish.cc graph.cc keys.cc netcmd.cc\
306netxx_pipe.cc numeric_vocab.cc option.cc outdated_indicator.cc\
307packet.cc paths.cc refiner.cc restrictions.cc rev_height.cc\
308revision.cc roster.cc roster_merge.cc simplestring_xform.cc\
309string_queue.cc transforms.cc unit_tests.cc uri.cc vocab.cc\
310xdelta.cc
311
312# these files do not contain unit tests, but are required for unit testing
313# and must be recompiled for that purpose
314UNIT_TEST_SRC_SUPPORT =\
315lua_hooks.cc roster_delta.cc
316
317# these files do not contain unit tests; they are required for unit
318# testing, but can be used "as is" from the main build. (many of
319# these _should_ have unit tests, but they haven't been written yet.)
320UNIT_TEST_OBJ_SUPPORT =\
321mtn-app_state.$(OBJEXT) mtn-cert.$(OBJEXT)\
322mtn-constants.$(OBJEXT) mtn-database.$(OBJEXT)\
323mtn-epoch.$(OBJEXT) mtn-file_io.$(OBJEXT) mtn-hmac.$(OBJEXT)\
324mtn-inodeprint.$(OBJEXT) mtn-key_store.$(OBJEXT)\
325mtn-lcs.$(OBJEXT) mtn-legacy.$(OBJEXT) mtn-lua.$(OBJEXT)\
326mtn-merkle_tree.$(OBJEXT) mtn-mt_version.$(OBJEXT)\
327mtn-mtn-sanity.$(OBJEXT) mtn-options.$(OBJEXT)\
328mtn-package_full_revision.$(OBJEXT)\
329mtn-package_revision.$(OBJEXT) mtn-project.$(OBJEXT)\
330mtn-randomizer.$(OBJEXT) mtn-sanity.$(OBJEXT)\
331mtn-schema.$(OBJEXT) mtn-schema_migration.$(OBJEXT)\
332mtn-selectors.$(OBJEXT) mtn-specialized_lexical_cast.$(OBJEXT)\
333mtn-ssh_agent.$(OBJEXT) mtn-std_hooks.$(OBJEXT)\
334mtn-ui.$(OBJEXT) mtn-work.$(OBJEXT)\
335mtn-work_migration.$(OBJEXT) mtn-pcrewrap.$(OBJEXT)
336
337# primaries
338
339bin_PROGRAMS = mtn
340noinst_PROGRAMS = txt2c
341EXTRA_PROGRAMS =
342
343mtn_SOURCES = $(MOST_SOURCES) monotone.cc
344nodist_mtn_SOURCES = std_hooks.c schema.c
345
346unit_tester_SOURCES = $(UNIT_TEST_SOURCES) $(UNIT_TEST_SRC_SUPPORT)
347nodist_unit_tester_SOURCES = test_hooks.c
348unit_tester_LDADD = $(UNIT_TEST_OBJ_SUPPORT)
349
350tester_SOURCES = tester.cc
351nodist_tester_SOURCES = testlib.c
352tester_LDADD = $(addprefix mtn-, $(patsubst %.cc, %.$(OBJEXT), \
353 $(filter %.cc, $(SANITY_CORE_SOURCES) $(LUAEXT_SOURCES) \
354 pcrewrap.cc)))
355
356txt2c_SOURCES = txt2c.cc
357
358noinst_LIBRARIES = libplatform.a lib3rdparty.a
359libplatform_a_SOURCES = platform.hh tester-plaf.hh
360lib3rdparty_a_SOURCES = $(BOOST_SANDBOX_SOURCES) \
361$(BOTAN_SOURCES) \
362$(IDNA_SOURCES) \
363$(NETXX_SOURCES) \
364$(LUA_SOURCES) \
365$(SQLITE_SOURCES)
366
367if INCLUDED_PCRE
368lib3rdparty_a_SOURCES += $(PCRE_SOURCES)
369endif
370
371htmldir = $(datadir)/doc/monotone
372html_DATA = monotone.html
373
374# flags
375
376if BUILD_PCH
377
378PCH_SOURCE = $(srcdir)/pch.hh
379# the .gch file only will be seen if it's in the same dir as the .hh file,
380# so need to copy it for separate build directories
381PCH_BUILD = pch-build.hh
382PCH_FLAGS = -Winvalid-pch -include $(PCH_BUILD)
383PCH_FILE = $(PCH_BUILD).gch
384sinclude $(PCH_FILE).dep
385
386*.o *.lo *.obj: $(PCH_FILE)
387
388$(PCH_BUILD): $(PCH_SOURCE)
389cp $(PCH_SOURCE) $(PCH_BUILD)
390
391$(PCH_FILE): $(PCH_BUILD)
392$(MAKE) PCH_FLAGS= pch-file
393
394pch-file:
395$(CXXCOMPILE) -x c++-header $(PCH_BUILD) -o $(PCH_FILE) \
396-MT $(PCH_FILE) -MD -MP -MF "./$(PCH_FILE).Tdep" \
397&& mv "./$(PCH_FILE).Tdep" "./$(PCH_FILE).dep" \
398|| rm "./$(PCH_FILE).Tdep"
399endif
400
401SUFFIXES = .gch
402
403AM_CPPFLAGS =
404AM_CFLAGS = $(AM_CPPFLAGS) -DTEMP_STORE=1 -DNDEBUG -DSQLITE_OMIT_CURSOR -DSQLITE_OMIT_LOAD_EXTENSION -DTHREADSAFE=0 -DSQLITE_THREAD_OVERRIDE_LOCK=-1 $(SQLITE_CPPFLAGS)
405AM_CXXFLAGS = $(AM_CPPFLAGS)
406AM_LDFLAGS =
407
408lib3rdparty_a_CPPFLAGS =
409lib3rdparty_a_CFLAGS = $(AM_CFLAGS) $(LIB3RDPARTY_CFLAGS)
410lib3rdparty_a_CXXFLAGS = $(AM_CXXFLAGS) $(LIB3RDPARTY_CXXFLAGS)
411
412mtn_LDFLAGS =
413mtn_CPPFLAGS = -I$(top_srcdir)/lua
414mtn_CFLAGS = $(AM_CFLAGS) $(MTN_CFLAGS)
415mtn_CXXFLAGS = $(AM_CXXFLAGS) $(PCH_FLAGS) $(MTN_CXXFLAGS)
416mtn_LDADD = libplatform.a lib3rdparty.a $(BOOSTLIBS) $(LIBICONV) $(LIBINTL)
417
418unit_tester_LDFLAGS =
419unit_tester_CPPFLAGS = -DBUILD_UNIT_TESTS -I$(top_srcdir)/lua
420unit_tester_CXXFLAGS = $(AM_CXXFLAGS) $(PCH_FLAGS)
421unit_tester_LDADD += libplatform.a lib3rdparty.a \
422 $(BOOSTLIBS) $(LIBICONV) $(LIBINTL)
423
424tester_LDFLAGS =
425tester_CPPFLAGS = -I$(top_srcdir)/lua
426tester_CXXFLAGS = $(AM_CXXFLAGS)
427tester_LDADD += libplatform.a lib3rdparty.a $(BOOSTLIBS) $(LIBICONV) $(LIBINTL)
428
429if INCLUDED_PCRE
430 lib3rdparty_a_CPPFLAGS += -I$(top_srcdir)/pcre
431 mtn_CPPFLAGS += -I$(top_srcdir)/pcre
432 unit_tester_CPPFLAGS += -I$(top_srcdir)/pcre
433 tester_CPPFLAGS += -I$(top_srcdir)/pcre
434else
435 mtn_CPPFLAGS += $(PCRE_CFLAGS)
436 unit_tester_CPPFLAGS += $(PCRE_CFLAGS)
437 tester_CPPFLAGS += $(PCRE_CFLAGS)
438
439 mtn_LDADD += $(PCRE_LIBS)
440 unit_tester_LDADD += $(PCRE_LIBS)
441 tester_LDADD += $(PCRE_LIBS)
442endif
443
444if WIN32_PLATFORM
445 libplatform_a_SOURCES += $(WIN32_PLATFORM_SOURCES)
446 mtn_SOURCES += win32/main.cc
447 mtn_LDADD += -lshfolder -lws2_32 -lintl -liconv -liphlpapi
448 unit_tester_LDADD += -lshfolder -lws2_32 -lintl -liconv -liphlpapi
449 lib3rdparty_a_CPPFLAGS += -DWIN32 -DBOTAN_EXT_ENTROPY_SRC_CAPI -DBOTAN_EXT_ENTROPY_SRC_WIN32
450 lib3rdparty_a_SOURCES += botan/es_capi.cpp botan/es_win32.cpp
451else
452 libplatform_a_SOURCES += $(UNIX_PLATFORM_SOURCES)
453 mtn_SOURCES += unix/main.cc
454endif
455
456if MISSING_INET_PTON
457 lib3rdparty_a_SOURCES += netxx/inet_pton.cxx netxx/inet_pton.h
458 lib3rdparty_a_CPPFLAGS += -DNETXX_NO_PTON
459endif
460
461if MISSING_INET_NTOP
462 lib3rdparty_a_SOURCES += netxx/inet_ntop.cxx netxx/inet_ntop.h
463 lib3rdparty_a_CPPFLAGS += -DNETXX_NO_NTOP
464endif
465
466if MISSING_GETADDRINFO
467 lib3rdparty_a_SOURCES += netxx/resolve_gethostbyname.cxx netxx/resolve_getservbyname.cxx
468else
469 lib3rdparty_a_SOURCES += netxx/resolve_getaddrinfo.cxx
470endif
471
472if MISSING_INET6
473 lib3rdparty_a_CPPFLAGS += -DNETXX_NO_INET6
474endif
475
476# i18n support
477
478SUBDIRS = po
479datadir = @datadir@
480localedir = $(datadir)/locale
481DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
482
483# extra files
484
485PDF_FIGURES= figures/branch-heads.pdf figures/cert.pdf\
486figures/difference-between-versions.pdf\
487figures/file-id-manifest-id.pdf figures/fork.pdf\
488figures/general-workflow.pdf figures/linear-history.pdf\
489figures/local-workflow.pdf figures/manifest.pdf\
490figures/merge.pdf figures/network-workflow.pdf\
491figures/parent-child-hashes.pdf\
492figures/parent-child-names-hashes.pdf figures/parent-child.pdf\
493figures/revision-chaining.pdf figures/revision.pdf\
494figures/statement.pdf figures/three-versions.pdf\
495figures/two-branches.pdf
496
497PNG_FIGURES=$(addprefix $(top_builddir)/figures/,$(notdir $(PDF_FIGURES:.pdf=.png)))
498EPS_FIGURES=$(addprefix $(top_builddir)/figures/,$(notdir $(PDF_FIGURES:.pdf=.eps)))
499TEXI_FRAGMENTS = pcre/pcrepattern.texi pcre/pcresyntax.texi
500
501info_TEXINFOS = monotone.texi
502EXTRA_DIST = $(PDF_FIGURES) $(PNG_FIGURES) INSTALL README.changesets\
503UPGRADE monotone.spec monotone.html texinfo.css schema.sql\
504std_hooks.lua test_hooks.lua testlib.lua lua-testsuite.lua\
505$(srcdir)/tests tester-testsuite.lua $(srcdir)/tester-tests\
506unit-testsuite.lua package.m4 package_revision.txt\
507package_full_revision_dist.txt $(wildcard $(srcdir)/m4/*.m4)\
508sqlite/keywordhash.h contrib/README contrib/monoprof.sh\
509contrib/monotone-notify.pl contrib/ciabot_monotone.py\
510contrib/monotone.el contrib/monotone-nav.el\
511contrib/monotone.bash_completion\
512contrib/monotone.zsh_completion contrib/mtbrowse.sh\
513contrib/colorize contrib/color-logs.sh contrib/color-logs.conf\
514contrib/get_stdio.pl contrib/ciabot_monotone_hookversion.py\
515contrib/Monotone.pm $(wildcard $(srcdir)/contrib/*.lua)\
516$(wildcard $(srcdir)/examples/*)\
517win32/monotone.iss win32/modpath.iss $(wildcard\
518$(srcdir)/debian/*) mac/monotone-pkg-logo.gif\
519mac/monotone.pmproj mac/package-intro.rtf audit-includes\
520$(TEXI_FRAGMENTS)
521
522MAKEINFOFLAGS=-I $(top_builddir)
523
524monotone.info: monotone.texi version.texi std_hooks.lua $(TEXI_FRAGMENTS)
525
526monotone.pdf: monotone.texi version.texi std_hooks.lua $(TEXI_FRAGMENTS) \
527 $(PDF_FIGURES)
528
529monotone.dvi: monotone.texi version.texi std_hooks.lua $(TEXI_FRAGMENTS) \
530 $(EPS_FIGURES)
531
532#%.eps: %.epsi
533#mv -f $< $@
534#
535#%.epsi: %.ps
536#ps2epsi $< $@
537
538%.eps : %.ps
539ps2eps <$< >$@
540
541$(top_builddir)/figures/%.ps: $(srcdir)/figures/%.pdf
542mkdir -p $(top_builddir)/figures
543#acroread -toPostScript -pairs $< $@
544pdftops $< $@
545
546# build an OS X installer
547# requires sudo since packagemaker just looks at directory permissions.
548PKG_INST_ROOT = $(PWD)/$(top_builddir)/pkg_inst_root
549monotone-$(PACKAGE_VERSION).pkg: monotone.pdf html
550sudo rm -rf $(PKG_INST_ROOT)
551rm -rf "$@"
552$(MAKE) install-strip DESTDIR=$(PKG_INST_ROOT)
553mkdir -p $(PKG_INST_ROOT)/Developer/Documentation/monotone
554cp monotone.pdf $(PKG_INST_ROOT)/Developer/Documentation/monotone/
555cp -r html $(PKG_INST_ROOT)/Developer/Documentation/monotone/html
556plutil -convert xml1 -o monotone-xml.pmproj.in $(srcdir)/mac/monotone.pmproj
557sed "s/__MONOTONE_VERSION__/$(PACKAGE_VERSION)/g" \
558< monotone-xml.pmproj.in > monotone-xml.pmproj
559cp $(srcdir)/mac/monotone-pkg-logo.gif $(srcdir)/mac/package-intro.rtf \
560$(srcdir)/COPYING .
561mv COPYING COPYING.txt
562chmod -R o-w,g-w,a+rX $(PKG_INST_ROOT)
563sudo chown -R root:wheel $(PKG_INST_ROOT)/usr
564sudo chown -R root:admin $(PKG_INST_ROOT)/Developer
565/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker \
566-build -proj monotone-xml.pmproj -p "$@"
567
568# build an OS X distribution disk image
569dmg: monotone-$(PACKAGE_VERSION).dmg
570
571monotone-$(PACKAGE_VERSION).dmg: monotone-$(PACKAGE_VERSION).pkg
572rm -rf $(top_builddir)/dmg_root "$@"
573mkdir $(top_builddir)/dmg_root
574cp -R $^ $(top_builddir)/dmg_root/
575chmod -R a+rX $(top_builddir)/dmg_root
576hdiutil create -srcfolder "$(top_builddir)/dmg_root" \
577"$@" -format UDZO -scrub -imagekey zlib-level=9 \
578-volname monotone-$(PACKAGE_VERSION)
579
580# testsuite stuff (could this possibly be more ugly?) To get
581# parallelism, we cannot use Automake's TESTS feature at all. The
582# shell script embedded in the 'check-local' rule is partially
583# borrowed from automake 1.9's check.am
584
585check-local: tester_tests.status unit_tests.status lua_tests.status
586@all=0; failed=0; error=0; \
587for f in $^; do \
588 all=`expr $$all + 1`; \
589 if test -f $$f; then \
590 s=`cat $$f`; \
591 if test "$$s" = 0; then \
592 :; \
593 elif test "$$s" = 1; then \
594 failed=`expr $$failed + 1`; \
595 else \
596 error=`expr $$error + 1`; \
597 fi; \
598 else \
599 error=`expr $$error + 1`; \
600 fi; \
601done; \
602if test "$$failed" = 0 && test "$$error" = 0; then \
603 exit=0; \
604 report=""; \
605 banner="All $$all tests passed"; \
606else \
607 exit=1; \
608 report="Please report to $(PACKAGE_BUGREPORT)"; \
609 if test "$$error" = 0; then \
610 banner="$$failed of $$all tests failed"; \
611 elif test "$$failed" = 0; then \
612 banner="$$error of $$all tests malfunctioned"; \
613 else \
614 banner="$$failed of $$all tests failed and $$error malfunctioned"; \
615 fi; \
616fi; \
617rl=`echo $$report | wc -c`; \
618bl=`echo $$banner | wc -c`; \
619if test $$rl -gt $$bl; then \
620 dashes=`echo "$$report" | sed s/./=/g`; \
621else \
622 dashes=`echo "$$banner" | sed s/./=/g`; \
623fi; \
624echo $$dashes; \
625echo $$banner; \
626test -z "$$report" || echo "$$report"; \
627exit $$exit
628
629run_%_tests: Makefile
630{ echo '#!/bin/sh'; \
631 echo 'PATH=$(top_builddir):$$PATH'; \
632 echo '$(top_builddir)/tester $(srcdir)/$*-testsuite.lua "$$@"'; \
633 echo 'echo $$? > $*_tests.status'; \
634 echo 'exit 0'; } > $@
635chmod 755 $@
636
637# The leading + causes Make to treat this as a recursive invocation,
638# allowing it to participate in the jobserver protocol.
639%_tests.status: run_%_tests %-testsuite.lua tester$(EXEEXT) FORCE
640+./run_$*_tests
641
642unit_tests.status : unit_tester
643lua_tests.status : mtn
644check_PROGRAMS = unit_tester tester
645
646# We want the tests re-run even if the .status files already exist.
647# .PHONY does not work for that (bad interaction with pattern rules),
648# but the FORCE hack does.
649.PHONY: check-local FORCE
650FORCE:
651.PRECIOUS: run_tester_tests run_unit_tests run_lua_tests
652
653mostlyclean-local:
654rm -rf tester_dir unit-tests package_full_revision.txt
655
656DISTCLEANFILES = mt-stdint.h xgettext.opts pch-build.hh.gch.dep\
657run_tester_tests run_unit_tests run_lua_tests\
658report_tester_tests report_unit_tests report_lua_tests\
659tester_tests.status unit_tests.status lua_tests.status
660
661# distcheck stuff
662
663DISTCHECK_CONFIGURE_FLAGS = \
664--with-bundled-sqlite \
665--with-bundled-lua
666
667# note: these targets are all in srcdir; they are *not* built during
668# the VPATH build part of distcheck (with non-writable source
669# directory) but only during the initial dist stage.
670
671$(srcdir)/package.m4: $(top_srcdir)/configure.ac
672{ \
673 echo '# Signature of the current package.'; \
674 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
675 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
676 echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
677 echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
678 echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
679} >$(srcdir)/package.m4
680
681# we generate some source files to copy data into the executable
682# note that the only things that should go in BUILT_SOURCES are things
683# that need to be generated early on 'make all'; this is _not_ true of
684# generated source files, but it is true for the PCH if used.
685
686CLEAN_SOURCES = std_hooks.c test_hooks.c testlib.c schema.c \
687package_revision.c package_full_revision.txt \
688package_full_revision_raw.txt package_full_revision.c
689
690BUILT_SOURCES = $(PCH_FILE) $(PCH_BUILD)
691
692CLEANFILES = $(BUILT_SOURCES) $(CLEAN_SOURCES) $(EPS_FIGURES)
693
694txt2c: txt2c.cc
695$(CXX) $(CXXFLAGS) -o $@ $<
696chmod 0755 $@$(EXEEXT)
697
698# FIXME: should use stamp files.
699%.c: %.sql txt2c
700./txt2c $(TXT2CFLAGS) --no-static $< $(*F) >$@.tmp
701cmp -s $@.tmp $@ || mv -f $@.tmp $@
702rm -f $@.tmp
703
704%.c: %.lua txt2c
705./txt2c $(TXT2CFLAGS) --no-static $< $(*F) >$@.tmp
706cmp -s $@.tmp $@ || mv -f $@.tmp $@
707rm -f $@.tmp
708
709%.c: %.txt txt2c
710./txt2c $(TXT2CFLAGS) --no-static $< $(*F) >$@.tmp
711cmp -s $@.tmp $@ || mv -f $@.tmp $@
712rm -f $@.tmp
713
714# This construct causes --strip-trailing to be applied only when
715# generating package_revision.c.
716TXT2CFLAGS =
717package_revision.c : TXT2CFLAGS = --strip-trailing
718
719# This is phony, so that we always try to rebuild it. If it succeeds
720# in calculating changes, it produces its target; otherwise, its
721# target does not exist.
722.PHONY: package_revision_raw.txt
723# if both attempts fail, then we need to remove the empty file that >
724# creates, and also make sure that the shell command exits
725# successfully; the rm -f ensures both
726package_revision_raw.txt:
727REAL_BLDDIR=$$PWD/$(top_builddir); \
728(cd $(srcdir) && $$REAL_BLDDIR/mtn --root=. automate get_base_revision_id) 2>/dev/null >$@ \
729|| (cd $(srcdir) && mtn --root=. automate get_base_revision_id) 2>/dev/null >$@ \
730|| rm -f $@
731package_revision.txt: package_revision_raw.txt
732if [ -f $< ]; then \
733 cp $< $@; \
734fi
735if [ ! -f $@ -a -f $(srcdir)/$@ ]; then \
736 cp $(srcdir)/$@ $@; \
737fi
738[ -f $@ ] || echo "unknown" > $@
739
740# To avoid a dependency loop here, what we do is:
741# calculate changes
742# |
743# package_full_revision_raw.txt
744# | \ <-- add "generated from cached data" text
745# | package_full_revision_dist.txt
746# | /
747# package_full_revision.txt
748
749# See above comment.
750.PHONY: package_full_revision_raw.txt
751package_full_revision_raw.txt:
752REAL_BLDDIR=$$PWD/$(top_builddir); \
753(cd $(srcdir) && $$REAL_BLDDIR/mtn --root=. automate get_revision) 2>/dev/null >$@ \
754|| (cd $(srcdir) && mtn --root=. automate get_revision) 2>/dev/null >$@ \
755|| rm -f $@
756# See above comment -- the file this depends on may or may not exist.
757# This file, however, must always exist, so that 'make dist' can
758# include it in the tarball it generates. So there are three cases:
759# -- if the raw file does not exist, then
760# -- if the dist file exists, then we leave it alone
761# -- if the dist file does not exist, then we say "unknown"
762# -- if the raw file does exist, then we regenerate the dist file
763package_full_revision_dist.txt: package_full_revision_raw.txt
764if [ -f $< ]; then \
765 cp -f $< $@ \
766 && (echo ''; \
767 echo ' Generated from data cached in the distribution;'; \
768 echo ' further changes may have been made.') >> $@; \
769fi
770if [ ! -f $@ -a -f $(srcdir)/$@ ]; then \
771 cp $(srcdir)/$@ $@; \
772fi
773[ -f $@ ] || echo "unknown" > $@
774# The raw file may not exist, but the dist file definitely does; we
775# just take the first dependency that exists.
776package_full_revision.txt: package_full_revision_raw.txt package_full_revision_dist.txt
777rm -f $@
778for SRC in $^; do ([ -f $$SRC -a ! -f $@ ] && cp -f $$SRC $@) || true; done
779
780# This is a magic directive copy-and-pasted, then modified, from the
781# automake 1.9 manual, section 13.4, "Checking the distribution".
782# Normally, 'distcheck' does a clean build, and then afterwards runs
783# 'distclean', and 'distclean' is supposed to remove everything that
784# the build created. However, we have some targets
785# (package_revision.txt, package_full_revision_dist.txt) that we
786# distribute, but then always attempt to rebuild optimistically, and
787# then if that fails fall back on the distributed versions. This
788# means that 'distclean' should _not_ remove those files, since they
789# are distributed, yet building the package will generate those files,
790# thus automake thinks that 'distclean' _should_ remove those files,
791# and 'distcheck' gets cranky if we don't. So basically what this
792# line does is tell 'distcheck' to shut up and ignore those two files.
793distcleancheck_listfiles = find . -type f -a ! -name package_revision.txt -a ! -name package_full_revision_dist.txt
794
795# the distcheck-hook checks for errors in the use of base.hh
796distcheck-hook:
797cd $(srcdir) && $(SHELL) audit-includes \
798$(sort $(mtn_SOURCES) $(unit_tester_SOURCES) $(tester_SOURCES) \
799 $(UNIX_PLATFORM_SOURCES) $(WIN32_PLATFORM_SOURCES) \
800 win32/main.cc unix/main.cc)
801
802# automake doesn't build html docs
803
804CHECK_SRCDIR_EQ_BUILDDIR=[ "`cd \"$(srcdir)\"; pwd`" = "`pwd`" -a -f ./monotone.texi ]
805
806.PHONY: apidocs
807apidocs:
808doxygen doxygen.cfg
809
810monotone.html: monotone.texi version.texi $(TEXI_FRAGMENTS) \
811 std_hooks.lua texinfo.css
812if $(CHECK_SRCDIR_EQ_BUILDDIR); then :; else \
813cp -r $(srcdir)/figures .; \
814cp $(srcdir)/texinfo.css .; \
815fi
816makeinfo -I $(srcdir) --no-split --no-headers --output $@ --html $<
817cp $@ $@.bak
818sed -e 's,<head>,<head><link type="text/css" rel="stylesheet" href="texinfo.css" />,' $@.bak >$@
819rm -f $@.bak
820
821html: monotone.texi version.texi std_hooks.lua texinfo.css
822if $(CHECK_SRCDIR_EQ_BUILDDIR); then :; else \
823cp -r $(srcdir)/figures .; \
824fi
825mkdir -p $@
826cp -r $(srcdir)/figures $@
827cp $(srcdir)/texinfo.css $@
828makeinfo -I $(srcdir) --number-sections --html --output $@ $<
829for f in $@/*.html; do \
830cp $$f $$f.bak; \
831sed -e 's,<head>,<head><link type="text/css" rel="stylesheet" href="texinfo.css" />,' $$f.bak >$$f; \
832rm -f $$f.bak; \
833done

Archive Download this file

Branches

Tags

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