## Process this file with automake to produce Makefile.in ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = foreign subdir-objects # Always include gtest in distributions. DIST_SUBDIRS = $(subdirs) # Build gtest before we build Cap'n Proto tests. We don't add gtest to SUBDIRS # because then "make check" would also build and run all of gtest's own tests, # which takes a lot of time and is generally not useful to us. Also, we don't # want "make install" to recurse into gtest since we don't want to overwrite # the installed version of gtest if there is one (and, actually, gtest doesn't # even support "make install" anyway). So we define a rule such that it will # only be built when needed. gtest/lib/libgtest.la: @echo "Making lib/libgtest.a lib/libgtest_main.a in gtest" @cd gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la gtest/lib/libgtest_main.la: gtest/lib/libgtest.la @: # We would like to clean gtest when "make clean" is invoked. But we have to # be careful because clean-local is also invoked during "make distclean", but # "make distclean" already recurses into gtest because it's listed among the # DIST_SUBDIRS. distclean will delete gtest/Makefile, so if we then try to # cd to the directory again and "make clean" it will fail. So, check that the # Makefile exists before recursing. clean-local: @if test -e gtest/Makefile; then \ echo "Making clean in gtest"; \ cd gtest && $(MAKE) $(AM_MAKEFLAGS) clean; \ fi AM_CXXFLAGS = -I$(srcdir)/src -I$(builddir)/src $(PTHREAD_CFLAGS) AM_LDFLAGS = $(PTHREAD_CFLAGS) EXTRA_DIST = \ README.txt \ LICENSE.txt \ $(test_capnpc_inputs) CLEANFILES = $(capnpc_outputs) $(test_capnpc_outputs) capnpc_middleman test_capnpc_middleman # Deletes all the files generated by autoreconf. MAINTAINERCLEANFILES = \ aclocal.m4 \ config.guess \ config.sub \ configure \ depcomp \ install-sh \ ltmain.sh \ Makefile.in \ missing \ mkinstalldirs \ config.h.in \ stamp.h.in \ m4/ltsugar.m4 \ m4/libtool.m4 \ m4/ltversion.m4 \ m4/lt~obsolete.m4 \ m4/ltoptions.m4 maintainer-clean-local: -rm -rf build-aux # gmake defines an implicit rule building n from n.o. Unfortunately, this triggers on our .capnp # files because they generate .capnp.c++ which is compiled to .capnp.o. In addition to being # nonsense, this leads to cyclic dependency issues and could even cause the .capnp files to be # unexpectedly overwritten! We need to cancel the implicit rule by declaring an explicit one. # # I want the hours of my life back that I spent figuring this out. %.capnp: @: # Implicit rules for invoking capnpc. %.capnp.h: %.capnp $(CAPNPC) --src-prefix=$(srcdir) -oc++ -I$(srcdir)/src $^ %.capnp.c++: %.capnp.h @: public_capnpc_inputs = \ src/capnp/c++.capnp \ src/capnp/schema.capnp capnpc_inputs = \ $(public_capnpc_inputs) \ src/capnp/compiler/lexer.capnp \ src/capnp/compiler/grammar.capnp capnpc_outputs = \ src/capnp/c++.capnp.c++ \ src/capnp/c++.capnp.h \ src/capnp/schema.capnp.c++ \ src/capnp/schema.capnp.h \ src/capnp/compiler/lexer.capnp.c++ \ src/capnp/compiler/lexer.capnp.h \ src/capnp/compiler/grammar.capnp.c++ \ src/capnp/compiler/grammar.capnp.h includecapnpdir = $(includedir)/capnp includekjdir = $(includedir)/kj includekjparsedir = $(includekjdir)/parse dist_includecapnp_DATA = $(public_capnpc_inputs) includekj_HEADERS = \ src/kj/common.h \ src/kj/units.h \ src/kj/memory.h \ src/kj/array.h \ src/kj/vector.h \ src/kj/string.h \ src/kj/exception.h \ src/kj/debug.h \ src/kj/arena.h \ src/kj/io.h \ src/kj/tuple.h \ src/kj/function.h \ src/kj/mutex.h \ src/kj/thread.h \ src/kj/main.h includekjparse_HEADERS = \ src/kj/parse/common.h \ src/kj/parse/char.h includecapnp_HEADERS = \ src/capnp/common.h \ src/capnp/blob.h \ src/capnp/endian.h \ src/capnp/layout.h \ src/capnp/orphan.h \ src/capnp/list.h \ src/capnp/message.h \ src/capnp/schema.h \ src/capnp/schema-loader.h \ src/capnp/dynamic.h \ src/capnp/pretty-print.h \ src/capnp/serialize.h \ src/capnp/serialize-packed.h \ src/capnp/generated-header-support.h nodist_includecapnp_HEADERS = \ src/capnp/schema.capnp.h lib_LTLIBRARIES = libcapnp.la libcapnp_la_LIBADD = $(PTHREAD_LIBS) libcapnp_la_LDFLAGS = -release $(VERSION) -export-dynamic -no-undefined libcapnp_la_SOURCES= \ src/kj/common.c++ \ src/kj/units.c++ \ src/kj/memory.c++ \ src/kj/array.c++ \ src/kj/string.c++ \ src/kj/exception.c++ \ src/kj/debug.c++ \ src/kj/arena.c++ \ src/kj/io.c++ \ src/kj/mutex.c++ \ src/kj/thread.c++ \ src/kj/main.c++ \ src/kj/parse/char.c++ \ src/capnp/blob.c++ \ src/capnp/arena.h \ src/capnp/arena.c++ \ src/capnp/layout.c++ \ src/capnp/list.c++ \ src/capnp/message.c++ \ src/capnp/schema.c++ \ src/capnp/schema-loader.c++ \ src/capnp/dynamic.c++ \ src/capnp/stringify.c++ \ src/capnp/serialize.c++ \ src/capnp/serialize-packed.c++ \ src/capnp/compiler/md5.h \ src/capnp/compiler/md5.c++ \ src/capnp/compiler/error-reporter.h \ src/capnp/compiler/error-reporter.c++ \ src/capnp/compiler/lexer.capnp.h \ src/capnp/compiler/lexer.capnp.c++ \ src/capnp/compiler/lexer.h \ src/capnp/compiler/lexer.c++ \ src/capnp/compiler/grammar.capnp.h \ src/capnp/compiler/grammar.capnp.c++ \ src/capnp/compiler/parser.h \ src/capnp/compiler/parser.c++ \ src/capnp/compiler/node-translator.h \ src/capnp/compiler/node-translator.c++ \ src/capnp/compiler/compiler.h \ src/capnp/compiler/compiler.c++ \ src/capnp/compiler/module-loader.h \ src/capnp/compiler/module-loader.c++ nodist_libcapnp_la_SOURCES = \ src/capnp/schema.capnp.c++ \ src/capnp/c++.capnp.c++ bin_PROGRAMS = capnp capnpc-capnp capnp_LDADD = $(PTHREAD_LIBS) libcapnp.la capnp_SOURCES = src/capnp/compiler/capnp.c++ capnpc_capnp_LDADD = $(PTHREAD_LIBS) libcapnp.la capnpc_capnp_SOURCES = src/capnp/compiler/capnpc-capnp.c++ # Source files intentionally not included in the dist at this time: # src/capnp/serialize-snappy* # src/capnp/benchmark/... # src/capnp/compiler/... # Tests ============================================================== test_capnpc_inputs = \ src/capnp/test.capnp \ src/capnp/test-import.capnp test_capnpc_outputs = \ src/capnp/test.capnp.c++ \ src/capnp/test.capnp.h \ src/capnp/test-import.capnp.c++ \ src/capnp/test-import.capnp.h BUILT_SOURCES = $(test_capnpc_outputs) $(capnpc_outputs) check_PROGRAMS = capnp-test capnp_test_LDADD = gtest/lib/libgtest.la gtest/lib/libgtest_main.la libcapnp.la capnp_test_CPPFLAGS = -Igtest/include -I$(srcdir)/gtest/include capnp_test_SOURCES = \ src/kj/common-test.c++ \ src/kj/memory-test.c++ \ src/kj/array-test.c++ \ src/kj/string-test.c++ \ src/kj/exception-test.c++ \ src/kj/debug-test.c++ \ src/kj/arena-test.c++ \ src/kj/units-test.c++ \ src/kj/tuple-test.c++ \ src/kj/function-test.c++ \ src/kj/mutex-test.c++ \ src/kj/parse/common-test.c++ \ src/kj/parse/char-test.c++ \ src/capnp/blob-test.c++ \ src/capnp/endian-test.c++ \ src/capnp/endian-fallback-test.c++ \ src/capnp/endian-reverse-test.c++ \ src/capnp/layout-test.c++ \ src/capnp/message-test.c++ \ src/capnp/schema-test.c++ \ src/capnp/schema-loader-test.c++ \ src/capnp/dynamic-test.c++ \ src/capnp/stringify-test.c++ \ src/capnp/encoding-test.c++ \ src/capnp/orphan-test.c++ \ src/capnp/serialize-test.c++ \ src/capnp/serialize-packed-test.c++ \ src/capnp/test-util.c++ \ src/capnp/test-util.h \ src/capnp/compiler/lexer-test.c++ \ src/capnp/compiler/md5-test.c++ nodist_capnp_test_SOURCES = $(test_capnpc_outputs) TESTS = capnp-test