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
455 check_net_SOURCES = win32/tester-check-net.c
456else
457 libplatform_a_SOURCES += $(UNIX_PLATFORM_SOURCES)
458 mtn_SOURCES += unix/main.cc
459 lib3rdparty_a_SOURCES += botan/es_dev.cpp
460 tester_SOURCES += unix/tester-plaf.cc
461 check_net_SOURCES = unix/tester-check-net.c
462endif
463
464if MISSING_INET_PTON
465 lib3rdparty_a_SOURCES += netxx/inet_pton.cxx netxx/inet_pton.h
466 lib3rdparty_a_CPPFLAGS += -DNETXX_NO_PTON
467endif
468
469if MISSING_INET_NTOP
470 lib3rdparty_a_SOURCES += netxx/inet_ntop.cxx netxx/inet_ntop.h
471 lib3rdparty_a_CPPFLAGS += -DNETXX_NO_NTOP
472endif
473
474if MISSING_GETADDRINFO
475 lib3rdparty_a_SOURCES += netxx/resolve_gethostbyname.cxx netxx/resolve_getservbyname.cxx
476else
477 lib3rdparty_a_SOURCES += netxx/resolve_getaddrinfo.cxx
478endif
479
480if MISSING_INET6
481 lib3rdparty_a_CPPFLAGS += -DNETXX_NO_INET6
482endif
483
484# i18n support
485
486SUBDIRS = po
487datadir = @datadir@
488localedir = $(datadir)/locale
489DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
490
491# extra files
492
493PDF_FIGURES= figures/branch-heads.pdf figures/cert.pdf\
494figures/difference-between-versions.pdf\
495figures/file-id-manifest-id.pdf figures/fork.pdf\
496figures/general-workflow.pdf figures/linear-history.pdf\
497figures/local-workflow.pdf figures/manifest.pdf\
498figures/merge.pdf figures/network-workflow.pdf\
499figures/parent-child-hashes.pdf\
500figures/parent-child-names-hashes.pdf figures/parent-child.pdf\
501figures/revision-chaining.pdf figures/revision.pdf\
502figures/statement.pdf figures/three-versions.pdf\
503figures/two-branches.pdf
504
505PNG_FIGURES=$(addprefix $(top_builddir)/figures/,$(notdir $(PDF_FIGURES:.pdf=.png)))
506EPS_FIGURES=$(addprefix $(top_builddir)/figures/,$(notdir $(PDF_FIGURES:.pdf=.eps)))
507TEXI_FRAGMENTS = pcre/pcrepattern.texi pcre/pcresyntax.texi
508
509info_TEXINFOS = monotone.texi
510EXTRA_DIST = $(PDF_FIGURES) $(PNG_FIGURES) INSTALL README.changesets\
511UPGRADE monotone.spec monotone.html texinfo.css schema.sql\
512std_hooks.lua testlib.lua lua-testsuite.lua $(srcdir)/tests\
513tester-testsuite.lua $(srcdir)/tester-tests\
514unit-testsuite.lua package.m4 package_revision.txt\
515package_full_revision_dist.txt $(wildcard $(srcdir)/m4/*.m4)\
516sqlite/keywordhash.h contrib/README contrib/monoprof.sh\
517contrib/monotone-notify.pl contrib/ciabot_monotone.py\
518contrib/monotone.el contrib/monotone-nav.el\
519contrib/monotone.bash_completion\
520contrib/monotone.zsh_completion contrib/mtbrowse.sh\
521contrib/colorize contrib/color-logs.sh contrib/color-logs.conf\
522contrib/get_stdio.pl contrib/ciabot_monotone_hookversion.py\
523contrib/Monotone.pm $(wildcard $(srcdir)/contrib/*.lua)\
524$(wildcard $(srcdir)/examples/*)\
525win32/monotone.iss win32/modpath.iss $(wildcard\
526$(srcdir)/debian/*) mac/monotone-pkg-logo.gif\
527mac/monotone.pmproj mac/package-intro.rtf audit-includes\
528$(TEXI_FRAGMENTS)
529
530MAKEINFOFLAGS=-I $(top_builddir)
531
532monotone.info: monotone.texi version.texi std_hooks.lua $(TEXI_FRAGMENTS)
533
534monotone.pdf: monotone.texi version.texi std_hooks.lua $(TEXI_FRAGMENTS) \
535 $(PDF_FIGURES)
536
537monotone.dvi: monotone.texi version.texi std_hooks.lua $(TEXI_FRAGMENTS) \
538 $(EPS_FIGURES)
539
540#%.eps: %.epsi
541#mv -f $< $@
542#
543#%.epsi: %.ps
544#ps2epsi $< $@
545
546%.eps : %.ps
547ps2eps <$< >$@
548
549$(top_builddir)/figures/%.ps: $(srcdir)/figures/%.pdf
550mkdir -p $(top_builddir)/figures
551#acroread -toPostScript -pairs $< $@
552pdftops $< $@
553
554# build an OS X installer
555# requires sudo since packagemaker just looks at directory permissions.
556PKG_INST_ROOT = $(PWD)/$(top_builddir)/pkg_inst_root
557monotone-$(PACKAGE_VERSION).pkg: monotone.pdf html
558sudo rm -rf $(PKG_INST_ROOT)
559rm -rf "$@"
560$(MAKE) install-strip DESTDIR=$(PKG_INST_ROOT)
561mkdir -p $(PKG_INST_ROOT)/Developer/Documentation/monotone
562cp monotone.pdf $(PKG_INST_ROOT)/Developer/Documentation/monotone/
563cp -r html $(PKG_INST_ROOT)/Developer/Documentation/monotone/html
564plutil -convert xml1 -o monotone-xml.pmproj.in $(srcdir)/mac/monotone.pmproj
565sed "s/__MONOTONE_VERSION__/$(PACKAGE_VERSION)/g" \
566< monotone-xml.pmproj.in > monotone-xml.pmproj
567cp $(srcdir)/mac/monotone-pkg-logo.gif $(srcdir)/mac/package-intro.rtf \
568$(srcdir)/COPYING .
569mv COPYING COPYING.txt
570chmod -R o-w,g-w,a+rX $(PKG_INST_ROOT)
571sudo chown -R root:wheel $(PKG_INST_ROOT)/usr
572sudo chown -R root:admin $(PKG_INST_ROOT)/Developer
573/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker \
574-build -proj monotone-xml.pmproj -p "$@"
575
576# build an OS X distribution disk image
577dmg: monotone-$(PACKAGE_VERSION).dmg
578
579monotone-$(PACKAGE_VERSION).dmg: monotone-$(PACKAGE_VERSION).pkg
580rm -rf $(top_builddir)/dmg_root "$@"
581mkdir $(top_builddir)/dmg_root
582cp -R $^ $(top_builddir)/dmg_root/
583chmod -R a+rX $(top_builddir)/dmg_root
584hdiutil create -srcfolder "$(top_builddir)/dmg_root" \
585"$@" -format UDZO -scrub -imagekey zlib-level=9 \
586-volname monotone-$(PACKAGE_VERSION)
587
588# testsuite stuff (could this possibly be more ugly?) To get
589# parallelism, we cannot use Automake's TESTS feature at all. The
590# shell script embedded in the 'check-local' rule is partially
591# borrowed from automake 1.9's check.am
592
593check-local: tester_tests.status unit_tests.status lua_tests.status
594@all=0; failed=0; error=0; \
595for f in $^; do \
596 all=`expr $$all + 1`; \
597 if test -f $$f; then \
598 s=`cat $$f`; \
599 if test "$$s" = 0; then \
600 :; \
601 elif test "$$s" = 1; then \
602 failed=`expr $$failed + 1`; \
603 else \
604 error=`expr $$error + 1`; \
605 fi; \
606 else \
607 error=`expr $$error + 1`; \
608 fi; \
609done; \
610if test "$$failed" = 0 && test "$$error" = 0; then \
611 exit=0; \
612 report=""; \
613 banner="All $$all test suites passed"; \
614else \
615 exit=1; \
616 report="Please report to $(PACKAGE_BUGREPORT)"; \
617 if test "$$error" = 0; then \
618 banner="$$failed of $$all test suites failed"; \
619 elif test "$$failed" = 0; then \
620 banner="$$error of $$all test suites malfunctioned"; \
621 else \
622 banner="$$failed of $$all test suites failed" \
623 banner="$$banner and $$error malfunctioned"; \
624 fi; \
625fi; \
626rl=`echo $$report | wc -c`; \
627bl=`echo $$banner | wc -c`; \
628if test $$rl -gt $$bl; then \
629 dashes=`echo "$$report" | sed s/./=/g`; \
630else \
631 dashes=`echo "$$banner" | sed s/./=/g`; \
632fi; \
633echo $$dashes; \
634echo $$banner; \
635test -z "$$report" || echo "$$report"; \
636exit $$exit
637
638run_%_tests: Makefile
639{ echo '#!/bin/sh'; \
640 echo 'PATH=$(top_builddir):$$PATH'; \
641 echo '$(top_builddir)/tester $(srcdir)/$*-testsuite.lua "$$@"'; \
642 echo 'echo $$? > $*_tests.status'; \
643 echo 'exit 0'; } > $@
644chmod 755 $@
645
646# The leading + causes Make to treat this as a recursive invocation,
647# allowing it to participate in the jobserver protocol.
648%_tests.status: run_%_tests %-testsuite.lua tester$(EXEEXT) FORCE
649+./run_$*_tests
650
651unit_tests.status : unit_tester$(EXEEXT)
652lua_tests.status : mtn$(EXEEXT) check_net$(EXEEXT)
653check_PROGRAMS = unit_tester tester check_net
654
655# We want the tests re-run even if the .status files already exist.
656# .PHONY does not work for that (bad interaction with pattern rules),
657# but the FORCE hack does.
658.PHONY: check-local FORCE
659FORCE:
660.PRECIOUS: run_tester_tests run_unit_tests run_lua_tests
661
662mostlyclean-local:
663rm -rf tester_dir unit-tests html
664
665DISTCLEANFILES = mt-stdint.h xgettext.opts pch-build.hh.gch.dep\
666run_tester_tests run_unit_tests run_lua_tests\
667tester_tests.status unit_tests.status lua_tests.status
668
669# distcheck stuff
670
671DISTCHECK_CONFIGURE_FLAGS = \
672--with-bundled-sqlite \
673--with-bundled-lua
674
675# note: these targets are all in srcdir; they are *not* built during
676# the VPATH build part of distcheck (with non-writable source
677# directory) but only during the initial dist stage.
678
679$(srcdir)/package.m4: $(top_srcdir)/configure.ac
680{ \
681 echo '# Signature of the current package.'; \
682 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
683 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
684 echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
685 echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
686 echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
687} >$(srcdir)/package.m4
688
689# we generate some source files to copy data into the executable
690# note that the only things that should go in BUILT_SOURCES are things
691# that need to be generated early on 'make all'; this is _not_ true of
692# generated source files, but it is true for the PCH if used.
693
694# package_revision.txt and package_full_revision_dist.txt are shipped
695# in the distribution, so don't delete them here
696CLEAN_SOURCES = std_hooks.c testlib.c schema.c \
697package_revision.c package_full_revision.c \
698package_revision_raw.txt \
699package_full_revision.txt package_full_revision_raw.txt
700
701BUILT_SOURCES = $(PCH_FILE) $(PCH_BUILD)
702
703CLEANFILES = $(BUILT_SOURCES) $(CLEAN_SOURCES) $(EPS_FIGURES)
704
705txt2c: txt2c.cc
706$(CXX) $(CXXFLAGS) -o $@ $<
707chmod 0755 $@$(EXEEXT)
708
709# FIXME: should use stamp files.
710%.c: %.sql txt2c
711./txt2c $(TXT2CFLAGS) --no-static $< $(*F) >$@.tmp
712cmp -s $@.tmp $@ || mv -f $@.tmp $@
713rm -f $@.tmp
714
715%.c: %.lua txt2c
716./txt2c $(TXT2CFLAGS) --no-static $< $(*F) >$@.tmp
717cmp -s $@.tmp $@ || mv -f $@.tmp $@
718rm -f $@.tmp
719
720%.c: %.txt txt2c
721./txt2c $(TXT2CFLAGS) --no-static $< $(*F) >$@.tmp
722cmp -s $@.tmp $@ || mv -f $@.tmp $@
723rm -f $@.tmp
724
725# This construct causes --strip-trailing to be applied only when
726# generating package_revision.c.
727TXT2CFLAGS =
728package_revision.c : TXT2CFLAGS = --strip-trailing
729
730# This is phony, so that we always try to rebuild it. If it succeeds
731# in calculating changes, it produces its target; otherwise, its
732# target does not exist.
733.PHONY: package_revision_raw.txt
734# if both attempts fail, then we need to remove the empty file that >
735# creates, and also make sure that the shell command exits
736# successfully; the rm -f ensures both
737package_revision_raw.txt:
738REAL_BLDDIR=$$PWD/$(top_builddir); \
739(cd $(srcdir) && $$REAL_BLDDIR/mtn --root=. automate get_base_revision_id) 2>/dev/null >$@ \
740|| (cd $(srcdir) && mtn --root=. automate get_base_revision_id) 2>/dev/null >$@ \
741|| rm -f $@
742package_revision.txt: package_revision_raw.txt
743if [ -f $< ]; then \
744 cp $< $@; \
745fi
746if [ ! -f $@ -a -f $(srcdir)/$@ ]; then \
747 cp $(srcdir)/$@ $@; \
748fi
749[ -f $@ ] || echo "unknown" > $@
750
751# To avoid a dependency loop here, what we do is:
752# calculate changes
753# |
754# package_full_revision_raw.txt
755# | \ <-- add "generated from cached data" text
756# | package_full_revision_dist.txt
757# | /
758# package_full_revision.txt
759
760# See above comment.
761.PHONY: package_full_revision_raw.txt
762package_full_revision_raw.txt:
763REAL_BLDDIR=$$PWD/$(top_builddir); \
764(cd $(srcdir) && $$REAL_BLDDIR/mtn --root=. automate get_revision) 2>/dev/null >$@ \
765|| (cd $(srcdir) && mtn --root=. automate get_revision) 2>/dev/null >$@ \
766|| rm -f $@
767# See above comment -- the file this depends on may or may not exist.
768# This file, however, must always exist, so that 'make dist' can
769# include it in the tarball it generates. So there are three cases:
770# -- if the raw file does not exist, then
771# -- if the dist file exists, then we leave it alone
772# -- if the dist file does not exist, then we say "unknown"
773# -- if the raw file does exist, then we regenerate the dist file
774package_full_revision_dist.txt: package_full_revision_raw.txt
775if [ -f $< ]; then \
776 cp -f $< $@ \
777 && (echo ''; \
778 echo ' Generated from data cached in the distribution;'; \
779 echo ' further changes may have been made.') >> $@; \
780fi
781if [ ! -f $@ -a -f $(srcdir)/$@ ]; then \
782 cp $(srcdir)/$@ $@; \
783fi
784[ -f $@ ] || echo "unknown" > $@
785# The raw file may not exist, but the dist file definitely does; we
786# just take the first dependency that exists.
787package_full_revision.txt: package_full_revision_raw.txt package_full_revision_dist.txt
788rm -f $@
789for SRC in $^; do ([ -f $$SRC -a ! -f $@ ] && cp -f $$SRC $@) || true; done
790
791# This is a magic directive copy-and-pasted, then modified, from the
792# automake 1.9 manual, section 13.4, "Checking the distribution".
793# Normally, 'distcheck' does a clean build, and then afterwards runs
794# 'distclean', and 'distclean' is supposed to remove everything that
795# the build created. However, we have some targets
796# (package_revision.txt, package_full_revision_dist.txt) that we
797# distribute, but then always attempt to rebuild optimistically, and
798# then if that fails fall back on the distributed versions. This
799# means that 'distclean' should _not_ remove those files, since they
800# are distributed, yet building the package will generate those files,
801# thus automake thinks that 'distclean' _should_ remove those files,
802# and 'distcheck' gets cranky if we don't. So basically what this
803# line does is tell 'distcheck' to shut up and ignore those two files.
804distcleancheck_listfiles = find . -type f -a ! -name package_revision.txt -a ! -name package_full_revision_dist.txt
805
806# the distcheck-hook checks for errors in the use of base.hh
807distcheck-hook:
808cd $(srcdir) && $(SHELL) audit-includes \
809$(sort $(mtn_SOURCES) $(unit_tester_SOURCES) $(tester_SOURCES) \
810 $(UNIX_PLATFORM_SOURCES) $(WIN32_PLATFORM_SOURCES) \
811 win32/main.cc unix/main.cc)
812
813# automake doesn't build html docs
814
815CHECK_SRCDIR_EQ_BUILDDIR=[ "`cd \"$(srcdir)\"; pwd`" = "`pwd`" -a -f ./monotone.texi ]
816
817.PHONY: apidocs
818apidocs:
819doxygen doxygen.cfg
820
821monotone.html: monotone.texi version.texi $(TEXI_FRAGMENTS) \
822 std_hooks.lua texinfo.css
823if $(CHECK_SRCDIR_EQ_BUILDDIR); then :; else \
824cp -r $(srcdir)/figures .; \
825cp $(srcdir)/texinfo.css .; \
826fi
827makeinfo -I $(srcdir) --no-split --no-headers --output $@ --html $<
828cp $@ $@.bak
829sed -e 's,<head>,<head><link type="text/css" rel="stylesheet" href="texinfo.css" />,' $@.bak >$@
830rm -f $@.bak
831
832html: monotone.texi version.texi std_hooks.lua texinfo.css
833if $(CHECK_SRCDIR_EQ_BUILDDIR); then :; else \
834cp -r $(srcdir)/figures .; \
835fi
836mkdir -p $@
837cp -r $(srcdir)/figures $@
838cp $(srcdir)/texinfo.css $@
839makeinfo -I $(srcdir) --number-sections --html --output $@ $<
840for f in $@/*.html; do \
841cp $$f $$f.bak; \
842sed -e 's,<head>,<head><link type="text/css" rel="stylesheet" href="texinfo.css" />,' $$f.bak >$$f; \
843rm -f $$f.bak; \
844done

Archive Download this file

Branches

Tags

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