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

Archive Download this file

Branches

Tags

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