Commit 252b516e authored by Kenton Varda's avatar Kenton Varda

Fix up Makefile.am.

parent 07b979a3
...@@ -12,9 +12,10 @@ EXTRA_DIST = \ ...@@ -12,9 +12,10 @@ EXTRA_DIST = \
COPYING.txt \ COPYING.txt \
CONTRIBUTORS.txt \ CONTRIBUTORS.txt \
CHANGES.txt \ CHANGES.txt \
$(capnpc_inputs) $(capnpc_inputs) \
$(test_capnpc_inputs)
CLEANFILES = $(capnpc_outputs) test_capnpc_middleman CLEANFILES = $(capnpc_outputs) $(test_capnpc_outputs) capnpc_middleman test_capnpc_middleman
# Deletes all the files generated by autoreconf. # Deletes all the files generated by autoreconf.
MAINTAINERCLEANFILES = \ MAINTAINERCLEANFILES = \
...@@ -39,6 +40,26 @@ MAINTAINERCLEANFILES = \ ...@@ -39,6 +40,26 @@ MAINTAINERCLEANFILES = \
maintainer-clean-local: maintainer-clean-local:
-rm -rf build-aux -rm -rf build-aux
capnpc_inputs = \
src/capnproto/c++.capnp \
src/capnproto/schema.capnp
capnpc_outputs = \
src/capnproto/c++.capnp.c++ \
src/capnproto/c++.capnp.h \
src/capnproto/schema.capnp.c++ \
src/capnproto/schema.capnp.h
# This should depend on $(capnpc_inputs), but then make mysteriously complains
# about a cyclic dependency. I don't know where it is coming from. I rummaged
# around in the generated Makefile a bit but couldn't figure it out. I give
# up. Automake is terrible.
capnpc_middleman:
$(CAPNPC) -oc++ $(capnpc_inputs)
touch capnpc_middleman
$(capnpc_outputs): capnpc_middleman
includecapnpdir = $(includedir)/capnproto includecapnpdir = $(includedir)/capnproto
includecapnp_HEADERS = \ includecapnp_HEADERS = \
...@@ -55,6 +76,8 @@ includecapnp_HEADERS = \ ...@@ -55,6 +76,8 @@ includecapnp_HEADERS = \
src/capnproto/serialize.h \ src/capnproto/serialize.h \
src/capnproto/serialize-packed.h \ src/capnproto/serialize-packed.h \
src/capnproto/generated-header-support.h src/capnproto/generated-header-support.h
nodist_includecapnp_HEADERS = \
src/capnproto/schema.capnp.h
# No dynamic library for now since C++ binary compatibility is hard. # No dynamic library for now since C++ binary compatibility is hard.
# It may make more sense to have every module statically link Cap'n Proto # It may make more sense to have every module statically link Cap'n Proto
...@@ -80,6 +103,8 @@ libcapnproto_a_SOURCES= \ ...@@ -80,6 +103,8 @@ libcapnproto_a_SOURCES= \
src/capnproto/io.c++ \ src/capnproto/io.c++ \
src/capnproto/serialize.c++ \ src/capnproto/serialize.c++ \
src/capnproto/serialize-packed.c++ src/capnproto/serialize-packed.c++
nodist_libcapnproto_a_SOURCES = \
src/capnproto/schema.capnp.c++
# Source files intentionally not included in the dist at this time: # Source files intentionally not included in the dist at this time:
# src/capnproto/serialize-snappy* # src/capnproto/serialize-snappy*
...@@ -87,30 +112,27 @@ libcapnproto_a_SOURCES= \ ...@@ -87,30 +112,27 @@ libcapnproto_a_SOURCES= \
# Tests ============================================================== # Tests ==============================================================
capnpc_inputs = \ test_capnpc_inputs = \
src/capnproto/c++.capnp \
src/capnproto/test.capnp \ src/capnproto/test.capnp \
src/capnproto/test-import.capnp src/capnproto/test-import.capnp
capnpc_outputs = \ test_capnpc_outputs = \
src/capnproto/c++.capnp.c++ \
src/capnproto/c++.capnp.h \
src/capnproto/test.capnp.c++ \ src/capnproto/test.capnp.c++ \
src/capnproto/test.capnp.h \ src/capnproto/test.capnp.h \
src/capnproto/test-import.capnp.c++ \ src/capnproto/test-import.capnp.c++ \
src/capnproto/test-import.capnp.h src/capnproto/test-import.capnp.h
# This should depend on $(capnpc_inputs), but then make mysteriously complains # This should depend on $(test_capnpc_inputs), but then make mysteriously complains
# about a cyclic dependency. I don't know where it is coming from. I rummaged # about a cyclic dependency. I don't know where it is coming from. I rummaged
# around in the generated Makefile a bit but couldn't figure it out. I give # around in the generated Makefile a bit but couldn't figure it out. I give
# up. Automake is terrible. # up. Automake is terrible.
test_capnpc_middleman: test_capnpc_middleman:
$(CAPNPC) -oc++ $(capnpc_inputs) $(CAPNPC) -oc++ $(test_capnpc_inputs)
touch test_capnpc_middleman touch test_capnpc_middleman
$(capnpc_outputs): test_capnpc_middleman $(test_capnpc_outputs): test_capnpc_middleman
BUILT_SOURCES = $(capnpc_outputs) BUILT_SOURCES = $(test_capnpc_outputs) $(capnpc_outputs)
check_PROGRAMS = capnproto-test check_PROGRAMS = capnproto-test
capnproto_test_LDADD = -lgtest -lgtest_main libcapnproto.a capnproto_test_LDADD = -lgtest -lgtest_main libcapnproto.a
...@@ -128,6 +150,6 @@ capnproto_test_SOURCES = \ ...@@ -128,6 +150,6 @@ capnproto_test_SOURCES = \
src/capnproto/serialize-packed-test.c++ \ src/capnproto/serialize-packed-test.c++ \
src/capnproto/test-util.c++ \ src/capnproto/test-util.c++ \
src/capnproto/test-util.h src/capnproto/test-util.h
nodist_capnproto_test_SOURCES = $(capnpc_outputs) nodist_capnproto_test_SOURCES = $(test_capnpc_outputs)
TESTS = capnproto-test TESTS = capnproto-test
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment