monotone

monotone Mtn Source Tree

Root/Makefile.am

1# Copyright (C) 2003 Graydon Hoare <graydon@pobox.com>
2#
3# This program is made available under the GNU GPL version 2.0 or
4# greater. See the accompanying file COPYING for details.
5#
6# This program is distributed WITHOUT ANY WARRANTY; without even the
7# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8# PURPOSE.
9
10# Makefile for monotone
11
12AUTOMAKE_OPTIONS = subdir-objects -Wno-portability
13ACLOCAL_AMFLAGS = -I m4
14
15SUBDIRS = doc
16
17CMD_SOURCES =\
18src/cmd.hh src/cmd.cc src/cmd_netsync.cc src/cmd_list.cc \
19src/cmd_packet.cc src/cmd_key_cert.cc src/cmd_merging.cc \
20src/cmd_db.cc src/cmd_diff_log.cc src/cmd_ws_commit.cc \
21src/cmd_othervcs.cc src/cmd_automate.cc src/cmd_files.cc\
22src/cmd_conflicts.cc
23
24SANITY_CORE_SOURCES =\
25src/sanity.cc src/sanity.hh src/quick_alloc.hh src/vector.hh \
26src/base.hh src/simplestring_xform.cc src/simplestring_xform.hh\
27src/constants.cc src/constants.hh src/numeric_vocab.hh\
28src/platform.hh src/origin_type.hh
29
30LUAEXT_SOURCES = \
31src/vocab.hh src/vocab.cc src/vocab_terms.hh\
32src/vocab_macros.hh src/vocab_cast.hh src/charset.cc\
33src/charset.hh src/paths.cc src/paths.hh src/interner.hh\
34src/hash_map.hh src/vocab_hash.hh src/luaext_mkstemp.cc\
35src/luaext_parse_basic_io.cc src/luaext_guess_binary.cc\
36src/luaext_platform.cc src/luaext_globish.cc src/lua.cc\
37src/lua.hh src/mkstemp.cc src/file_io.cc src/file_io.hh\
38src/globish.cc src/globish.hh src/basic_io.cc src/basic_io.hh\
39src/char_classifiers.hh
40
41MOST_SOURCES = \
42$(SANITY_CORE_SOURCES) $(LUAEXT_SOURCES)\
43src/platform-wrapped.hh src/rev_types.hh src/mtn-sanity.cc\
44src/mtn-sanity.hh src/ui.cc src/ui.hh src/app_state.cc\
45src/app_state.hh src/automate_ostream.hh\
46src/automate_ostream_demuxed.hhsrc/automate_reader.hh\
47src/automate_reader.cc src/automate_stdio_helpers.hh\
48src/botan_pipe_cache.hhsrc/cache_logger.hh src/cache_logger.cc\
49src/commands.cc src/commands.hh $(CMD_SOURCES)\
50src/diff_output.cc src/diff_output.hh\
51src/lua_hooks.cc src/lua_hooks.hh \
52src/transforms.cc src/transforms.hh\
53src/update.cc src/update.hh\
54src/work.cc src/migrate_work.cc src/work.hh\
55src/cert.cc src/cert.hh\
56src/cow_trie.hh\
57src/project.cc src/project.hh\
58src/outdated_indicator.cc src/outdated_indicator.hh\
59src/database.cc src/database.hh\
60src/key_store.cc src/key_store.hh\
61src/ssh_agent.cc src/ssh_agent.hh\
62src/keys.cc src/keys.hh\
63src/packet.cc src/packet.hh\
64src/key_packet.cc src/key_packet.hh\
65src/rcs_file.cc src/rcs_file.hh\
66src/xdelta.cc src/xdelta.hh\
67src/migration.hh src/migrate_schema.cc src/migrate_ancestry.cc\
68src/refiner.cc src/refiner.hh\
69src/enumerator.cc src/enumerator.hh\
70src/netsync.hh src/netsync.cc \
71src/network/automate_session.hh src/network/automate_session.cc\
72src/network/connection_info.hh src/network/connection_info.cc\
73src/network/listener_base.hh src/network/listener_base.cc\
74src/network/listener.hh src/network/listener.cc\
75src/network/make_server.hh src/network/make_server.cc\
76src/network/netsync_session.hh src/network/netsync_session.cc\
77src/network/reactable.hh src/network/reactable.cc\
78src/network/reactor.hh src/network/reactor.cc\
79src/network/session.hh src/network/session.cc\
80src/network/session_base.hh src/network/session_base.cc\
81src/network/wrapped_session.hh src/network/wrapped_session.cc\
82src/netxx_pipe.cc src/netxx_pipe.hh\
83src/netcmd.cc src/netcmd.hh\
84src/merkle_tree.cc src/merkle_tree.hh \
85src/lcs.cc src/lcs.hh\
86src/rcs_import.cc src/rcs_import.hh\
87src/git_change.cc src/git_change.hh src/git_export.cc\
88src/git_export.hh\
89src/revision.cc src/ancestry.cc src/revision.hh\
90src/cset.cc src/cset.hh\
91src/roster.cc src/roster.hh \
92src/mt_version.cc src/mt_version.hh\
93src/automate.cc\
94src/database_check.cc\
95src/epoch.cc src/epoch.hh\
96src/gzip.cc src/gzip.hh\
97src/inodeprint.cc src/inodeprint.hh\
98src/selectors.cc src/selectors.hh\
99src/annotate.cc src/annotate.hh\
100src/restrictions.cc src/restrictions.hh\
101src/hmac.cc src/hmac.hh\
102src/string_queue.hh\
103src/maybe_workspace_updater.cc src/maybe_workspace_updater.hh\
104src/merge_roster.cc src/merge_conflict.cc src/merge_roster.hh\
105src/merge_content.cc src/merge_3way.cc src/merge_content.hh\
106src/legacy.cc src/legacy.hh src/uri.cc src/uri.hh\
107src/graph.cc src/graph.hh\
108src/roster_delta.cc src/roster_delta.hh\
109src/sha1.cc\
110src/pcrewrap.cc src/pcrewrap.hh\
111src/rev_height.cc src/rev_height.hh\
112src/rev_output.cc src/rev_output.hh\
113src/asciik.cc src/asciik.hh\
114src/dates.cc src/dates.hh src/date_format.hh\
115\
116src/lru_writeback_cache.hh src/hybrid_map.hh src/lazy_rng.hh\
117\
118src/cleanup.hh src/cycle_detector.hh src/adler32.hh\
119src/netio.hh src/gettext.h\
120src/package_revision.cc src/package_full_revision.cc\
121src/option.cc src/option.hh src/options.cc src/options.hh\
122src/options_list.hh src/options_applicator.hh\
123src/options_applicator.cc src/option_reset_info.hh\
124src/specialized_lexical_cast.cc src/lexical_cast.hh\
125src/parallel_iter.hh src/safe_map.hh src/pch.hh\
126src/current_exception.hh
127
128NETXX_SOURCES =\
129src/netxx/accept.cxx src/netxx/accept.h src/netxx/address.cxx\
130src/netxx/common.h src/netxx/compat.h src/netxx/datagram.cxx\
131src/netxx/datagramserver.cxx src/netxx/osutil.cxx\
132src/netxx/osutil.h src/netxx/peer.cxx src/netxx/probe.cxx \
133src/netxx/probe_impl.h src/netxx/probe_select.cxx \
134src/netxx/recvfrom.cxx src/netxx/recvfrom.h src/netxx/resolve.h\
135src/netxx/serverbase.cxx src/netxx/serverbase.h\
136src/netxx/sockaddr.cxx src/netxx/sockaddr.h\
137src/netxx/socket.cxx src/netxx/socket.h src/netxx/sockopt.cxx \
138src/netxx/stream.cxx src/netxx/streambase.cxx \
139src/netxx/streamserver.cxx src/netxx/address.h \
140src/netxx/datagram.h src/netxx/datagramserver.h \
141src/netxx/netbuf.h src/netxx/netxx.h src/netxx/peer.h \
142src/netxx/probe.h src/netxx/probeinfo.h src/netxx/sockopt.h \
143src/netxx/stream.h src/netxx/streambase.h \
144src/netxx/streamserver.h src/netxx/timeout.h src/netxx/types.h
145
146BOOST_SANDBOX_SOURCES =\
147src/boost/circular_buffer_adaptor.hpp\
148src/boost/circular_buffer_base.hpp\
149src/boost/circular_buffer_fwd.hpp\
150src/boost/circular_buffer.hpp
151
152UNIX_PLATFORM_SOURCES =\
153src/unix/read_password.cc src/unix/get_system_flavour.cc\
154src/unix/process.cc src/unix/terminal.cc src/unix/inodeprint.cc\
155src/unix/fs.cc src/unix/make_io_binary.cc\
156src/unix/os_strerror.cc src/unix/cputime.cc \
157src/unix/ssh_agent_platform.cc src/unix/ssh_agent_platform.hh\
158src/unix/parse_date.cc
159
160WIN32_PLATFORM_SOURCES =\
161src/win32/read_password.cc src/win32/get_system_flavour.cc\
162src/win32/process.cc src/win32/terminal.cc\
163src/win32/inodeprint.ccsrc/win32/fs.cc \
164src/win32/make_io_binary.cc src/win32/os_strerror.cc\
165src/win32/cputime.cc src/win32/ssh_agent_platform.cc\
166src/win32/ssh_agent_platform.hh src/win32/parse_date.cc
167
168# these files (part of the main program) contain code subject to unit testing
169
170UNIT_TESTEES =\
171src/basic_io.cc src/charset.cc src/commands.cc src/cset.cc \
172src/git_change.cc src/globish.cc src/graph.cc src/merge_3way.cc\
173src/merge_roster.cc src/mkstemp.cc src/netcmd.cc \
174src/netxx_pipe.cc src/option.cc src/outdated_indicator.cc\
175src/pcrewrap.cc src/refiner.cc src/restrictions.cc\
176src/revision.cc src/simplestring_xform.cc src/transforms.cc \
177src/uri.cc src/vocab.cc src/xdelta.cc
178
179# these files contain the actual unit tests
180# yes, we have to list them all explicitly, with directory prefix, or
181# automake gets very confused
182UNIT_TESTERS =\
183test/unit/tests/basic_io.cc test/unit/tests/charset.cc\
184test/unit/tests/commands.cc test/unit/tests/cset.cc\
185test/unit/tests/git_change.cc test/unit/tests/globish.cc\
186test/unit/tests/graph.cc test/unit/tests/merge_3way.cc\
187test/unit/tests/merge_roster.cc test/unit/tests/mkstemp.cc\
188test/unit/tests/netcmd.cc test/unit/tests/netxx_pipe.cc\
189test/unit/tests/option.cc test/unit/tests/outdated_indicator.cc\
190test/unit/tests/pcrewrap.cc test/unit/tests/refiner.cc \
191test/unit/tests/restrictions.cc test/unit/tests/revision.cc\
192test/unit/tests/simplestring_xform.cc test/unit/tests/transforms.cc\
193test/unit/tests/uri.cc test/unit/tests/vocab.cc\
194test/unit/tests/xdelta.cc test/unit/tests/numeric_vocab.cc\
195test/unit/tests/sha1.cc test/unit/tests/string_queue.cc\
196test/unit/unit_tester.cc
197
198# these files contain unit tests that need access to private interfaces
199# of the code under test, so they #include the code under test. thus,
200# to avoid multiple-definition errors, for these files the code under
201# test is not part of UNIT_TESTEES.
202
203UNIT_TESTERS_PRIV =\
204test/unit/tests/dates.cc test/unit/tests/key_packet.cc \
205test/unit/tests/packet.cc test/unit/tests/paths.cc \
206test/unit/tests/rev_height.cc test/unit/tests/roster.cc
207
208# these files do not contain unit tests, but are required for unit testing
209# note that some are and some aren't part of the main program
210UNIT_TEST_SUPPORT =\
211src/constants.cc src/file_io.cc src/gzip.cc src/hmac.cc \
212src/lcs.cc src/merkle_tree.cc src/roster_delta.cc \
213src/sanity.cc src/specialized_lexical_cast.cc\
214test/unit/randomfile.hh test/unit/unit_tests.hh\
215test/unit/randomizer.hh test/unit/randomizer.cc\
216test/unit/roster_tests.hh
217
218# primaries
219
220bin_PROGRAMS = mtn
221mtn_SOURCES = $(MOST_SOURCES) src/monotone.cc
222nodist_mtn_SOURCES = src/std_hooks.cc src/schema.cc
223
224noinst_PROGRAMS = util/txt2c
225util_txt2c_SOURCES = util/txt2c.cc
226
227EXTRA_PROGRAMS =
228
229bin_SCRIPTS = mtnopt
230dist_bin_SCRIPTS = extra/bin/mtn-cleanup
231noinst_SCRIPTS = extra/building/dump-test-logs.sh
232
233check_PROGRAMS = test/bin/unit_tester test/bin/tester test/bin/check_net
234test_bin_unit_tester_SOURCES = $(UNIT_TESTERS) $(UNIT_TESTERS_PRIV) \
235$(UNIT_TESTEES) $(UNIT_TEST_SUPPORT)
236test_bin_tester_SOURCES = test/src/tester.cc test/src/tester-plaf.hh src/transforms.cc src/gzip.cc \
237$(SANITY_CORE_SOURCES) $(LUAEXT_SOURCES) src/pcrewrap.cc \
238src/specialized_lexical_cast.cc
239nodist_test_bin_tester_SOURCES = test/src/testlib.cc
240
241noinst_LIBRARIES = src/libplatform.a src/lib3rdparty.a
242src_libplatform_a_SOURCES = src/platform.hh
243src_lib3rdparty_a_SOURCES = $(BOOST_SANDBOX_SOURCES) \
244 $(NETXX_SOURCES)
245
246bashcompdir = $(sysconfdir)/bash_completion.d
247bashcomp_DATA = extra/shell/monotone.bash_completion
248
249monotonedir = $(datadir)/monotone
250
251mtnhooksdir = $(monotonedir)/hooks
252dist_mtnhooks_DATA = \
253extra/mtn-hooks/authorize_remote_automate.lua\
254extra/mtn-hooks/get_passphrase_from_file.lua\
255extra/mtn-hooks/monotone-buildbot.lua\
256extra/mtn-hooks/monotone-ciabot.lua\
257extra/mtn-hooks/monotone-cluster-push.lua\
258extra/mtn-hooks/monotone-cvs-ignore.lua\
259extra/mtn-hooks/monotone-mail-notify.lua
260
261mtnscriptsdir = $(monotonedir)/scripts
262dist_mtnscripts_SCRIPTS = \
263extra/mtn-hooks/monotone-ciabot.py\
264extra/mtn-hooks/monotone-mail-notify
265
266# Some of the smaller programs do not have --help or --version,
267# make them exempt of the check for those. This specially applies
268# to programs intended to be called by mtn hooks, for which these
269# options aren't necessary.
270# NOTE: in the expansion of this variable, each filename MUST be
271# surrounded by one space before and after. Having a tab between
272# two file names will guarantee that they won't be exempt. This
273# is really a small but serious bug in the automake templates.
274# backslash+newline+whitespace will be reinterpreted as whitespace
275# by make.
276AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = \
277extra/bin/mtn-cleanup extra/mtn-hooks/monotone-ciabot.py \
278extra/mtn-hooks/monotone-mail-notify
279
280# flags
281
282# sets DEFS for just this object (autoconf's -DHAVE_CONFIG_H is useless)
283# the variable prevents this from overriding automake's unix/fs.o rule
284DEFS =
285UNIX=src/unix/
286$(UNIX)fs.$(OBJEXT) : DEFS += -DLOCALEDIR="\"$(localedir)\""
287
288if BUILD_PCH
289
290PCH_SOURCE = $(srcdir)/pch.hh
291# the .gch file only will be seen if it's in the same dir as the .hh file,
292# so need to copy it for separate build directories
293PCH_BUILD = pch-build.hh
294PCH_FLAGS = -Winvalid-pch -include $(PCH_BUILD)
295PCH_FILE = $(PCH_BUILD).gch
296sinclude $(PCH_FILE).dep
297
298*.o *.lo *.obj: $(PCH_FILE)
299
300$(PCH_BUILD): $(PCH_SOURCE)
301cp $(PCH_SOURCE) $(PCH_BUILD)
302
303$(PCH_FILE): $(PCH_BUILD)
304$(MAKE) PCH_FLAGS= pch-file
305
306pch-file:
307$(CXXCOMPILE) -x c++-header $(PCH_BUILD) -o $(PCH_FILE) \
308-MT $(PCH_FILE) -MD -MP -MF "./$(PCH_FILE).Tdep" \
309&& mv "./$(PCH_FILE).Tdep" "./$(PCH_FILE).dep" \
310|| rm "./$(PCH_FILE).Tdep"
311endif
312AM_CXXFLAGS = $(PCH_FLAGS)
313
314SUFFIXES = .gch .merged.po .gmo
315
316AM_CPPFLAGS = $(intl_CFLAGS) $(pcre_CFLAGS) $(botan_CFLAGS)\
317 $(lua_CFLAGS) $(sqlite3_CFLAGS) $(idn_CFLAGS)
318
319LDADD = src/libplatform.a src/lib3rdparty.a $(intl_LIBS) $(pcre_LIBS)\
320$(botan_LIBS) $(lua_LIBS) $(sqlite3_LIBS) $(idn_LIBS)
321
322if WIN32_PLATFORM
323 src_libplatform_a_SOURCES += $(WIN32_PLATFORM_SOURCES)
324 mtn_SOURCES += src/win32/main.cc
325 test_bin_tester_SOURCES += test/src/win32/tester-plaf.cc
326 test_bin_check_net_SOURCES = test/src/win32/tester-check-net.cc
327 AM_CPPFLAGS += -DWIN32
328 LDADD += -lshfolder -lws2_32 -liconv -liphlpapi
329else
330 src_libplatform_a_SOURCES += $(UNIX_PLATFORM_SOURCES)
331 mtn_SOURCES += src/unix/main.cc
332 test_bin_tester_SOURCES += test/src/unix/tester-plaf.cc
333 test_bin_check_net_SOURCES = test/src/unix/tester-check-net.cc
334endif
335
336if MISSING_INET_PTON
337 src_lib3rdparty_a_SOURCES += src/netxx/inet_pton.cxx src/netxx/inet_pton.h
338 AM_CPPFLAGS += -DNETXX_NO_PTON
339endif
340
341if MISSING_INET_NTOP
342 src_lib3rdparty_a_SOURCES += src/netxx/inet_ntop.cxx src/netxx/inet_ntop.h
343 AM_CPPFLAGS += -DNETXX_NO_NTOP
344endif
345
346if MISSING_GETADDRINFO
347 src_lib3rdparty_a_SOURCES += src/netxx/resolve_gethostbyname.cxx \
348 src/netxx/resolve_getservbyname.cxx
349else
350 src_lib3rdparty_a_SOURCES += src/netxx/resolve_getaddrinfo.cxx
351endif
352
353if MISSING_INET6
354 AM_CPPFLAGS += -DNETXX_NO_INET6
355endif
356
357# extra files
358
359contribdir = $(docdir)/contrib
360contrib_prefix = contrib
361contrib_data = $(shell cd $(srcdir); find $(contrib_prefix) | sed -e 's,^\./,,')
362
363examplesdir = $(docdir)/examples
364examples_prefix = examples
365examples_data =\
366examples/000README.txt\
367examples/mirror.rc examples/push.rc examples/read-permissions\
368examples/write-permissions\
369\
370examples/server-setup/README examples/server-setup/serverrc\
371examples/server-setup/monotone.init\
372examples/server-setup/monotone.run\
373\
374examples/user-setup/README examples/user-setup/monotonerc
375
376EXTRA_DIST =\
377HACKING INSTALL INSTALL_windows_cygwin.txt\
378INSTALL_windows_mingw.txt INSTALL_windows_msvc.txt UPGRADE\
379util/audit-includes util/do-editor-vars.sh\
380$(wildcard $(srcdir)/m4/*.m4)\
381\
382src/schema.sql src/unix/README src/std_hooks.lua\
383src/util/mtnopt.in\
384\
385test/common\
386test/func test/func-testsuite.lua\
387test/tester test/tester-testsuite.lua\
388$(wildcard $(srcdir)/test/unit/*.cc)\
389$(wildcard $(srcdir)/test/unit/*.hh)\
390$(wildcard $(srcdir)/test/unit/tests/*.cc)\
391test/unit-testsuite.lua\
392test/extra test/extra-testsuite.lua\
393test/src/testlib.lua\
394\
395src/package_revision.txt src/package_full_revision_dist.txt\
396\
397extra/README extra/building/dump-test-logs.sh.in\
398extra/shell/monotone.bash_completion.in\
399extra/shell/monotone_gen_bash_completion_table.pl\
400\
401innosetup/README.txt\
402innosetup/monotone.iss.in innosetup/modpath.iss \
403innosetup/monotone.bmp innosetup/dlls.sh\
404\
405mac/readme-mac.txt mac/package-intro.rtf\
406mac/monotone.pmproj mac/monotone-pkg-logo.gif\
407\
408cygport/README.txt\
409cygport/monotone.cygwin.patch\
410cygport/monotone.cygport\
411\
412notes/release-checklist.txt\
413notes/README.testing notes/tester.txt notes/testsuite.txt\
414\
415visualc/monotone.sln\
416visualc/monotone.vcproj visualc/botan.vcproj visualc/lua.vcproj\
417visualc/netxx.vcproj visualc/pcre.vcproj visualc/sqlite3.vcproj\
418visualc/stringprep.vcproj visualc/txt2c.vcproj\
419visualc/tester.vcproj visualc/unit_tester.vcproj\
420visualc/runtests.bat\
421visualc/config.h visualc/mt-stdint.h visualc/stdint.h\
422visualc/unistd.h\
423visualc/unknown_package.txt\
424\
425$(contrib_data) $(examples_data)
426
427# Message translation support
428# INST_LINGUAS is set by configure, based on the po/LINGUAS file and
429# the user's LINGUAS env. variable. Additional settings are in
430# po/Makevars.
431#
432# Only the foo.po-update target will overwrite a file in the source
433# po/ directory.
434
435include $(srcdir)/po/Makevars
436ALL_POFILES := $(wildcard $(srcdir)/po/*.po)
437ALL_LINGUAS := $(basename $(notdir $(ALL_POFILES)))
438ALL_POREADMES := $(addprefix po/README.,$(ALL_LINGUAS))
439ALL_GMOFILES := $(addprefix po/,$(addsuffix .gmo, $(ALL_LINGUAS)))
440CLEAN_POFILES := $(addprefix po/,$(addsuffix .merged.po, $(ALL_LINGUAS))) \
441 po/$(PACKAGE).pot
442DISTCLEAN_GMOFILES:= $(ALL_GMOFILES)
443
444EXTRA_DIST += $(ALL_POFILES) $(ALL_POREADMES) po/LINGUAS po/README
445
446.PHONY: all-nls install-nls uninstall-nls
447if USE_NLS
448# for installation
449GMOFILES := $(addprefix po/,$(addsuffix .gmo, $(INST_LINGUAS)))
450
451all-nls: $(GMOFILES)
452
453install-nls: all-nls
454@linguas='$(INST_LINGUAS)'; set -e; for lang in $$linguas; do \
455 dir=$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES; \
456 echo " $(MKDIR_P) '$$dir'"; \
457 $(MKDIR_P) $$dir; \
458 echo " $(INSTALL_DATA) po/$$lang.gmo '$$dir/$(PACKAGE).mo'"; \
459 $(INSTALL_DATA) po/$$lang.gmo $$dir/$(PACKAGE).mo; \
460done
461
462uninstall-nls:
463@linguas='$(INST_LINGUAS)'; set -e; for lang in $$linguas; do \
464 echo " rm -f '$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo'"; \
465 rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
466 echo " rmdir '$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES'; \
467 rmdir $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES || :; \
468 echo " rmdir '$(DESTDIR)$(localedir)/$$lang'; \
469 rmdir $(DESTDIR)$(localedir)/$$lang || :; \
470done
471else
472# We need to provide these targets because all-local, install-data-local
473# and uninstall-local expects them as dependencies, further down.
474all-nls:
475@:
476install-nls:
477@:
478uninstall-nls:
479@:
480endif
481
482.PHONY: dist-nls
483if REBUILD_NLS
484po/%.gmo: po/%.merged.po
485$(V_msgfmt)$(MSGFMT) -c --statistics -o $@ $<
486
487po/%.merged.po: $(srcdir)/po/%.po po/$(PACKAGE).pot
488$(V_msgmerge)$(MSGMERGE) $^ -q -o $@
489
490# for translators' use
491UPDATEPOFILES = $(addprefix po/,$(addsuffix .po-update, $(ALL_LINGUAS)))
492
493po/%.po-update: $(srcdir)/po/%.po po/$(PACKAGE).pot
494$(MSGMERGE) --update $^
495
496update-po: $(UPDATEPOFILES)
497
498update-gmo: update-po $(ALL_GMOFILES)
499
500# for the template file
501POTFILES = $(filter-out package_%, $(MOST_SOURCES)) \
502$(UNIX_PLATFORM_SOURCES) $(WIN32_PLATFORM_SOURCES) \
503src/monotone.cc src/std_hooks.lua
504
505po/$(PACKAGE).pot: $(POTFILES)
506[ -d po ] || mkdir -p po
507$(V_xgettext)$(XGETTEXT) -o$@.in -D. -D$(top_srcdir) -cTRANSLATORS: \
508 --copyright-holder='$(COPYRIGHT_HOLDER)' \
509 --msgid-bugs-address='$(PACKAGE_BUGREPORT)' \
510 $(XGETTEXT_PKG_OPTS) $(XGETTEXT_OPTS) \
511 $(POTFILES)
512 YEAR=$(word 1, $(subst -, ,$(BUILD_DATE)))
513sed -e 's/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR./Please see po\/README.<lang> for individual copyrights./' \
514 -e 's/(C) YEAR/(C) 2003 - $(YEAR)/' -e 's/PACKAGE/$(PACKAGE)/' \
515 -e 's/SOME DESCRIPTIVE TITLE/monotone message string catalogue/' < $@.in > $@
516rm $@.in
517
518dist-nls: $(ALL_GMOFILES)
519cp $(ALL_GMOFILES) $(distdir)/po
520else
521
522po/%.gmo: $(srcdir)/po/%.gmo
523cp $< $@
524
525dist-nls:
526@echo "*** Cannot 'make dist' without xgettext" >&2; exit 1
527
528endif
529
530_install_data = \
531list='$(1)'; test -n "$(3)" || list=; \
532for p in $$list; do \
533 if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
534 src="$$d$$p"; \
535 dest="`if [ "$$p" != "$(2)" ]; then echo $$p | sed -e 's,$(2)/,,'; fi`"; \
536 if test -d "$$src"; then \
537 echo " $(MKDIR_P) '$(DESTDIR)$(3)/$$dest'"; \
538 $(MKDIR_P) "$(DESTDIR)$(3)/$$dest" || exit $$?; \
539 else \
540 destd="`dirname $$dest`"; \
541 if ! test -d "$(DESTDIR)$(3)/$$destd"; then \
542 echo " $(MKDIR_P) '$(DESTDIR)$(3)/$$destd'"; \
543 $(MKDIR_P) "$(DESTDIR)$(3)/$$destd" || exit $$?; \
544 fi; \
545 echo " $(INSTALL_DATA) $$src '$(DESTDIR)$(3)/$$dest'"; \
546 $(INSTALL_DATA) $$src "$(DESTDIR)$(3)/$$dest" || exit $$?; \
547 fi; \
548done
549_uninstall_data = \
550list='$(1)'; test -n "$(3)" || list=; \
551dirs_rev=; \
552for p in $$list; do \
553 to_rm="`if [ "$$p" != "$(2)" ]; then echo $$p | sed -e 's,$(2)/,,'; fi`"; \
554 if [ -n "$$to_rm" ]; then \
555 if test -d "$(DESTDIR)$(3)/$$to_rm"; then \
556 dirs_rev="echo '$$to_rm';$${dirs_rev}"; \
557 else \
558 echo " rm -f '$(DESTDIR)$(3)/$$to_rm'"; \
559 rm -f $$src "$(DESTDIR)$(3)/$$to_rm" || exit $$?; \
560 fi; \
561 fi; \
562done; \
563eval "$$dirs_rev" | while read to_rmdir; do \
564 echo " rmdir '$(DESTDIR)$(3)/$$to_rmdir'"; \
565 rmdir "$(DESTDIR)$(3)/$$to_rmdir" || exit $$?; \
566done
567
568install-contrib-data: $(contrib_data)
569@$(call _install_data,$(contrib_data),$(contrib_prefix),$(contribdir))
570uninstall-contrib-data:
571@$(call _uninstall_data,$(contrib_data),$(contrib_prefix),$(contribdir))
572
573install-examples-data: $(examples_data)
574@$(call _install_data,$(examples_data),$(examples_prefix),$(examplesdir))
575uninstall-examples-data:
576@$(call _uninstall_data,$(examples_data),$(examples_prefix),$(examplesdir))
577
578# build an OS X installer
579# requires sudo since packagemaker just looks at directory permissions.
580PKG_INST_ROOT = $(PWD)/$(top_builddir)/pkg_inst_root
581monotone-$(PACKAGE_VERSION).pkg: doc/monotone.pdf doc/html
582sudo rm -rf $(PKG_INST_ROOT)
583rm -rf "$@"
584$(MAKE) install-strip DESTDIR=$(PKG_INST_ROOT)
585mkdir -p $(PKG_INST_ROOT)/Developer/Documentation/monotone
586cp doc/monotone.pdf $(PKG_INST_ROOT)/Developer/Documentation/monotone/
587cp -r doc/html $(PKG_INST_ROOT)/Developer/Documentation/monotone/html
588plutil -convert xml1 -o monotone-xml.pmproj.in $(srcdir)/mac/monotone.pmproj
589sed "s/__MONOTONE_VERSION__/$(PACKAGE_VERSION)/g" \
590< monotone-xml.pmproj.in > monotone-xml.pmproj
591cp $(srcdir)/mac/monotone-pkg-logo.gif $(srcdir)/mac/package-intro.rtf .
592cp $(srcdir)/COPYING COPYING.txt
593chmod -R o-w,g-w,a+rX $(PKG_INST_ROOT)
594sudo chown -R root:wheel $(PKG_INST_ROOT)/usr
595sudo chown -R root:admin $(PKG_INST_ROOT)/Developer
596/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker \
597-build -proj monotone-xml.pmproj -p "$@"
598
599# build an OS X distribution disk image
600dmg: monotone-$(PACKAGE_VERSION).dmg
601
602monotone-$(PACKAGE_VERSION).dmg: monotone-$(PACKAGE_VERSION).pkg
603rm -rf $(top_builddir)/dmg_root "$@"
604mkdir $(top_builddir)/dmg_root
605cp -R $^ $(top_builddir)/dmg_root/
606chmod -R a+rX $(top_builddir)/dmg_root
607hdiutil create -srcfolder "$(top_builddir)/dmg_root" \
608"$@" -format UDZO -scrub -imagekey zlib-level=9 \
609-volname monotone-$(PACKAGE_VERSION)
610
611# build win32 installer using INNO setup
612ISCC=@ISCC@
613
614win32-installer: monotone-$(PACKAGE_VERSION)-setup.exe
615
616monotone-$(PACKAGE_VERSION)-setup.exe: mtn-stripped.exe html info $(ALL_GMOFILES) linguas.iss dlls.iss monotone.iss
617$(ISCC) monotone.iss
618
619mtn-stripped.exe: mtn.exe
620strip $< -o $@
621
622dlls.iss: mtn-stripped.exe ${top_srcdir}/Makefile.am
623rm -f $@
624for DLL in $$( ${top_srcdir}/innosetup/dlls.sh mtn-stripped.exe | xargs cmd //c echo) ; do \
625 echo "Source: \"$$DLL\"; DestDir: \"{app}\"" >> $@ ; \
626done
627
628linguas.iss: ${top_srcdir}/Makefile.am
629rm -rf $@
630for LANG in $(INST_LINGUAS) ; do \
631echo "Source: \"{#BUILDDIR}\\po\\$${LANG}.gmo\"; DestDir: \"{app}\\locale\\$${LANG}\\LC_MESSAGES\"; DestName: \"monotone.mo\"; Flags: ignoreversion" >> $@ ; \
632done
633
634
635# testsuite stuff (could this possibly be more ugly?) To get
636# parallelism, we cannot use Automake's TESTS feature at all. The
637# shell script embedded in the 'check-testers' rule is partially
638# borrowed from automake 1.9's check.am
639
640.PHONY: check-testers
641check-testers: test/tester.status test/unit.status test/func.status test/extra.status
642@all=0; failed=0; error=0; \
643for f in $^; do \
644 all=`expr $$all + 1`; \
645 if test -f $$f; then \
646 s=`cat $$f`; \
647 if test "$$s" = 0; then \
648 :; \
649 elif test "$$s" = 1; then \
650 failed=`expr $$failed + 1`; \
651 else \
652 error=`expr $$error + 1`; \
653 fi; \
654 else \
655 error=`expr $$error + 1`; \
656 fi; \
657done; \
658if test "$$failed" = 0 && test "$$error" = 0; then \
659 exit=0; \
660 report=""; \
661 banner="All $$all test suites passed"; \
662else \
663 exit=1; \
664 report="Please report to $(PACKAGE_BUGREPORT)"; \
665 if test "$$error" = 0; then \
666 banner="$$failed of $$all test suites failed"; \
667 elif test "$$failed" = 0; then \
668 banner="$$error of $$all test suites malfunctioned"; \
669 else \
670 banner="$$failed of $$all test suites failed" \
671 banner="$$banner and $$error malfunctioned"; \
672 fi; \
673fi; \
674rl=`echo $$report | wc -c`; \
675bl=`echo $$banner | wc -c`; \
676if test $$rl -gt $$bl; then \
677 dashes=`echo "$$report" | sed s/./=/g`; \
678else \
679 dashes=`echo "$$banner" | sed s/./=/g`; \
680fi; \
681echo $$dashes; \
682echo $$banner; \
683test -z "$$report" || echo "$$report"; \
684exit $$exit
685
686run_%_tests: Makefile
687$(AM_V_GEN){ echo '#!/bin/sh'; \
688 echo 'export LANG=C'; \
689 echo 'PATH=$(abs_builddir):$(abs_builddir)/test/bin:$$PATH'; \
690 echo '$(top_builddir)/test/bin/tester $(srcdir)/test/$*-testsuite.lua "$$@"';\
691 echo 'echo $$? > $(top_builddir)/test/$*.status'; \
692 echo 'exit 0'; } > $@ && \
693chmod 755 $@
694
695# The leading + causes Make to treat this as a recursive invocation,
696# allowing it to participate in the jobserver protocol.
697test/%.status: run_%_tests test/%-testsuite.lua test/bin/tester$(EXEEXT) FORCE
698+$(AM_V_at)./run_$*_tests
699test/unit.status : test/bin/unit_tester$(EXEEXT)
700test/func.status : mtn$(EXEEXT) test/bin/check_net$(EXEEXT)
701
702# Creates the needed artifacts for manual test execution
703.PHONY: testers
704testers: mtn$(EXEEXT) $(check_PROGRAMS)\
705 run_tester_tests run_func_tests run_unit_tests run_extra_tests
706
707# We want the tests re-run even if the .status files already exist.
708# .PHONY does not work for that (bad interaction with pattern rules),
709# but the FORCE hack does.
710.PHONY: FORCE
711FORCE:
712.PRECIOUS: run_tester_tests run_unit_tests run_func_tests run_extra_tests
713
714# FIXME: if it annoys anybody, we could clean dvi, pdf and info files
715# only in a separate maintainer-clean target as suggested by
716# automake's man page
717.PHONY: mostlyclean-tests
718mostlyclean-tests:
719rm -rf test/work
720@ls test/unit/tests/*/__driver__.lua 2>/dev/null | while read d; do \
721 echo " rm -f '$$d'"; \
722 rm -f $$d; \
723 echo " rmdir '$${d%/*}'"; \
724 rmdir $${d%/*} || :; \
725done
726
727# With the MacOS X toolchain, some stuff may be generated in the form of subdirs
728.PHONY: mostlyclean-util
729mostlyclean-util:
730rm -rf util/txt2c.dSYM
731
732MOSTLYCLEANFILES = mtn.1 \
733run_tester_tests run_func_tests run_unit_tests run_extra_tests \
734test/tester.status test/func.status test/unit.status test/extra.status
735
736# we generate some source files to copy data into the executable
737# note that the only things that should go in BUILT_SRCS are things
738# that need to be generated early on 'make all'; this is _not_ true of
739# generated source files, but it is true for the PCH if used.
740
741# package_revision.txt and package_full_revision_dist.txt are shipped
742# in the distribution, so don't delete them here
743CLEAN_SRCS = $(nodist_mtn_SOURCES) $(nodist_test_bin_tester_SOURCES)\
744src/package_revision.cc src/package_full_revision.cc\
745src/package_revision_raw.txt\
746src/package_full_revision.txt src/package_full_revision_raw.txt
747
748BUILT_SOURCES = $(PCH_FILE) $(PCH_BUILD)
749
750CLEANFILES = $(bin_SCRIPTS) $(noinst_SCRIPTS) $(bashcomp_DATA) \
751$(CLEAN_SRCS) $(CLEAN_POFILES)
752
753DISTCLEANFILES = src/xgettext.opts src/pch-build.hh.gch.dep\
754$(DISTCLEAN_GMOFILES)
755
756# a maintainer might still want to get rid of src/package_revision.txt and
757# src/package_full_revision_dist.txt to rebuild them.
758
759MAINTAINERCLEANFILES = \
760src/package_revision.txt src/package_full_revision_dist.txt
761
762# automake provides no nice way to build a helper program to execute
763# on the build machine, so we need our own rule. almost all the
764# standard flags variables are inappropriate.
765
766util/txt2c$(EXEEXT): util/txt2c.cc
767$(V_bcxx)$(CXX_FOR_BUILD) $(CXXFLAGS) -o $@ $^
768
769# files generated using txt2c
770src/std_hooks.cc: src/std_hooks.lua util/txt2c$(EXEEXT)
771$(V_txt2c)./util/txt2c std_hooks $< $@
772
773src/schema.cc: src/schema.sql util/txt2c$(EXEEXT)
774$(V_txt2c)./util/txt2c schema $< $@
775
776src/package_revision.cc: src/package_revision.txt util/txt2c$(EXEEXT)
777$(V_txt2c)./util/txt2c --strip-trailing package_revision $< $@
778
779src/package_full_revision.cc: src/package_full_revision.txt util/txt2c$(EXEEXT)
780$(V_txt2c)./util/txt2c package_full_revision $< $@
781
782test/src/testlib.cc: test/src/testlib.lua util/txt2c$(EXEEXT)
783$(V_txt2c)./util/txt2c testlib $< $@
784
785# Support for scripts and extras
786do_subst = sed -e 's,[@]PACKAGE_VERSION[@],$(PACKAGE_VERSION),' \
787-e 's,[@]sysconfdir[@],$(sysconfdir),'
788
789mtnopt: src/util/mtnopt.in Makefile
790$(V_subst)$(do_subst) < $< > $@ && chmod +x $@
791
792extra/shell/monotone.bash_completion: extra/shell/monotone.bash_completion.in \
793$(bin_PROGRAMS) extra/shell/monotone_gen_bash_completion_table.pl \
794Makefile
795$(MKDIR_P) extra/shell
796( sed -e '/^[@]generated-command-list[@]$$/,$$d' < $<; \
797 MTN=./mtn$(EXEEXT) \
798 perl $(srcdir)/extra/shell/monotone_gen_bash_completion_table.pl; \
799 sed -e '1,/^[@]generated-command-list[@]$$/d' < $< ) | \
800 $(do_subst) > $@
801
802extra/building/dump-test-logs.sh: extra/building/dump-test-logs.sh.in Makefile
803$(MKDIR_P) extra/building
804$(V_subst)$(do_subst) < $< > $@ && chmod +x $@
805
806# This is phony, so that we always try to rebuild it. If it succeeds
807# in calculating changes, it produces its target; otherwise, its
808# target does not exist.
809.PHONY: src/package_revision_raw.txt
810# if both attempts fail, then we need to remove the empty file that >
811# creates, and also make sure that the shell command exits
812# successfully; the rm -f ensures both
813src/package_revision_raw.txt:
814$(AM_V_GEN)REAL_BLDDIR=$$PWD/$(top_builddir); \
815(cd $(srcdir) && $$REAL_BLDDIR/mtn --root=. automate get_base_revision_id) 2>/dev/null >$@ \
816|| (cd $(srcdir) && mtn --root=. automate get_base_revision_id) 2>/dev/null >$@ \
817|| rm -f $@
818src/package_revision.txt: src/package_revision_raw.txt
819$(AM_V_GEN)set -e; if [ -f $< ]; then \
820 cp $< $@; \
821fi; \
822if [ ! -f $@ -a -f $(srcdir)/$@ ]; then \
823 cp $(srcdir)/$@ $@; \
824fi; \
825[ -f $@ ] || echo "unknown" > $@
826
827# To avoid a dependency loop here, what we do is:
828# calculate changes
829# |
830# package_full_revision_raw.txt
831# | \ <-- add "generated from cached data" text
832# | package_full_revision_dist.txt
833# | /
834# package_full_revision.txt
835
836# See above comment.
837.PHONY: src/package_full_revision_raw.txt
838src/package_full_revision_raw.txt:
839$(AM_V_GEN)REAL_BLDDIR=$$PWD/$(top_builddir); \
840(cd $(srcdir) && $$REAL_BLDDIR/mtn --root=. automate get_current_revision) 2>/dev/null >$@ \
841|| (cd $(srcdir) && mtn --root=. automate get_current_revision) 2>/dev/null >$@ \
842|| rm -f $@
843# See above comment -- the file this depends on may or may not exist.
844# This file, however, must always exist, so that 'make dist' can
845# include it in the tarball it generates. So there are three cases:
846# -- if the raw file does not exist, then
847# -- if the dist file exists, then we leave it alone
848# -- if the dist file does not exist, then we say "unknown"
849# -- if the raw file does exist, then we regenerate the dist file
850src/package_full_revision_dist.txt: src/package_full_revision_raw.txt
851$(AM_V_GEN)set -e; if [ -f $< ]; then \
852 cp -f $< $@ \
853 && (echo ''; \
854 echo ' Generated from data cached in the distribution;'; \
855 echo ' further changes may have been made.') >> $@; \
856fi; \
857if [ ! -f $@ -a -f $(srcdir)/$@ ]; then \
858 cp $(srcdir)/$@ $@; \
859fi; \
860[ -f $@ ] || echo "unknown" > $@
861# The raw file may not exist, but the dist file definitely does; we
862# just take the first dependency that exists.
863src/package_full_revision.txt: src/package_full_revision_raw.txt src/package_full_revision_dist.txt
864$(AM_V_GEN)rm -f $@; \
865for SRC in $^; do \
866 ([ -f $$SRC -a ! -f $@ ] && cp -f $$SRC $@) || true; \
867done
868
869# This is a magic directive copy-and-pasted, then modified, from the
870# automake 1.9 manual, section 13.4, "Checking the distribution".
871# Normally, 'distcheck' does a clean build, and then afterwards runs
872# 'distclean', and 'distclean' is supposed to remove everything that
873# the build created. However, we have some targets
874# (package_revision.txt, package_full_revision_dist.txt) that we
875# distribute, but then always attempt to rebuild optimistically, and
876# then if that fails fall back on the distributed versions. This
877# means that 'distclean' should _not_ remove those files, since they
878# are distributed, yet building the package will generate those files,
879# thus automake thinks that 'distclean' _should_ remove those files,
880# and 'distcheck' gets cranky if we don't. So basically what this
881# line does is tell 'distcheck' to shut up and ignore those two files.
882distcleancheck_listfiles = find . -type f -a ! -name package_revision.txt -a ! -name package_full_revision_dist.txt
883
884# the distcheck-base.hh checks for errors in the use of base.hh.
885# It's being used by distcheck-hook further down.
886.PHONY: distcheck-base.hh
887distcheck-base.hh:
888cd $(srcdir) && $(SHELL) util/audit-includes \
889$(sort $(mtn_SOURCES) $(test_bin_unit_tester_SOURCES) $(test_bin_tester_SOURCES) \
890 $(UNIX_PLATFORM_SOURCES) $(WIN32_PLATFORM_SOURCES) \
891 src/win32/main.cc src/unix/main.cc)
892
893man1_MANS = mtn.1
894dist_man1_MANS = src/util/mtnopt.1 extra/bin/mtn-cleanup.1
895
896# All local variants of automake-supported targets here, depending on all
897# the things we want to do. This is to support multiple things to do in
898# each of them, as dependencies.
899all-local: all-nls
900install-data-local: install-nls \
901install-contrib-data install-examples-data
902uninstall-local: uninstall-nls \
903uninstall-contrib-data uninstall-examples-data
904mostlyclean-local: mostlyclean-tests mostlyclean-util
905check-local: check-testers
906
907# All hooks supported by automake here, depending on all the things we want
908# to hook in. This is to support multiple things into the same hook, as
909# dependencies.
910distcheck-hook: distcheck-base.hh
911dist-hook: dist-nls
912# Kill off any backup files that got pulled in by one of the
913# recursive subdirectory includes in EXTRA_DIST
914# note use of slightly non-portable "-delete" action
915find $(distdir) \( -name '*.bak' -o -name '*.orig' -o -name '*.rej' \
916 -o -name '*~' -o -name '#*#' -o -name '*.swp' \) -delete
917
918mtn.1: mtn$(EXEEXT)
919$(AM_V_GEN)REAL_BLDDIR=$$PWD/$(top_builddir); \
920(cd $(srcdir) && $$REAL_BLDDIR/mtn manpage --norc) 2>/dev/null >$@ || rm -f $@
921
922doc/monotone.dvi: dvi
923doc/monotone.pdf: pdf
924doc/monotone.ps: ps
925doc/html doc/monotone.html: html
926
927# Not really phony, but the only way to make sure we wander into
928# the subdirectory and do the build with dependencies and all.
929.PHONY: doc/monotone.dvi doc/monotone.pdf doc/monotone.ps doc/monotone.html \
930doc/html
931
932# Verbosity goo.
933V_bcxx = $(V_bcxx_$(V))
934V_bcxx_ = $(V_bcxx_$(AM_DEFAULT_VERBOSITY))
935V_bcxx_0 = @echo " BCXX " $@;
936
937V_txt2c = $(V_txt2c_$(V))
938V_txt2c_ = $(V_txt2c_$(AM_DEFAULT_VERBOSITY))
939V_txt2c_0 = @echo " TXT2C " $@;
940
941V_subst = $(V_subst_$(V))
942V_subst_ = $(V_subst_$(AM_DEFAULT_VERBOSITY))
943V_subst_0 = @echo " SUBST " $@;
944
945V_xgettext = $(V_xgettext_$(V))
946V_xgettext_ = $(V_xgettext_$(AM_DEFAULT_VERBOSITY))
947V_xgettext_0 = @echo "XGETTEXT" $@;
948
949V_msgfmt = $(V_msgfmt_$(V))
950V_msgfmt_ = $(V_msgfmt_$(AM_DEFAULT_VERBOSITY))
951V_msgfmt_0 = @echo " MSGFMT" $@;
952
953V_msgmerge = $(V_msgmerge_$(V))
954V_msgmerge_ = $(V_msgmerge_$(AM_DEFAULT_VERBOSITY))
955V_msgmerge_0 = @echo "MSGMERGE" $@;
956
957V_makeinfo = $(V_makeinfo_$(V))
958V_makeinfo_ = $(V_makeinfo_$(AM_DEFAULT_VERBOSITY))
959V_makeinfo_0 = @echo "MAKEINFO" $@;

Archive Download this file

Branches

Tags

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