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

Archive Download this file

Branches

Tags

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