monotone

monotone Mtn Source Tree

Root/Makefile.am

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

Archive Download this file

Branches

Tags

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