From 6b52d615a2cdc6626f52f3d88884db776201144d Mon Sep 17 00:00:00 2001 From: Alex Helfet Date: Sun, 26 Mar 2017 15:23:35 +0100 Subject: [PATCH] Add all .capnp files to `make dist` archive. --- Makefile.am | 9 +++++++++ README.md | 5 +++++ compiler/c.capnp | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/Makefile.am b/Makefile.am index be2151b..45ac3ed 100644 --- a/Makefile.am +++ b/Makefile.am @@ -44,6 +44,11 @@ noinst_HEADERS += \ compiler/schema.capnp.h \ compiler/c++.capnp.h +# Don't try to generate any *.capnp files. Otherwise make wants to compile them +# from *.capnp.c and fails. +%.capnp: ; + +# googletest GTEST_LDADD = gtest/googletest/lib/libgtest.la gtest/googletest/lib/libgtest.la: make -C gtest/googletest lib/libgtest.la @@ -65,6 +70,10 @@ noinst_HEADERS += \ compiler/test.capnp.h \ tests/example.capnp.h EXTRA_DIST += \ + compiler/c.capnp \ + compiler/c++.capnp \ + compiler/schema.capnp \ + compiler/test.capnp \ tests/example.capnp capn_test_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_CPPFLAGS) capn_test_CXXFLAGS = -std=gnu++11 -pthread diff --git a/README.md b/README.md index eac0af5..d12cd5d 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,11 @@ You need to compile these runtime library files and link them into your own proj Your include path must contain the runtime library directory [`lib`](lib). Header file [`lib/capnp_c.h`](lib/capnp_c.h) contains the public interfaces of the library. +Using make-based builds, make may try to compile `${x}.capnp` from +`${x}.capnp.c` using its built-in rule for compiling `${y}` from +`${y}.c`. You can either disable make's built-in compile rules or just +this specific case with the no-op rule: `%.capnp: ;`. + For further reference, please see the other unit tests in [`tests`](tests), and header file [`lib/capnp_c.h`](lib/capnp_c.h). The project [`quagga-capnproto`](https://github.com/opensourcerouting/quagga-capnproto) uses `c-capnproto` and contains some good examples, as found with [this github repository search](https://github.com/opensourcerouting/quagga-capnproto/search?utf8=%E2%9C%93&q=capn&type=): diff --git a/compiler/c.capnp b/compiler/c.capnp index 5de7e73..9a0a1d3 100644 --- a/compiler/c.capnp +++ b/compiler/c.capnp @@ -29,6 +29,10 @@ annotation nameinfix @0x85a8d86d736ba637 (file): Text; # to a loop. $nameinfix (recommended parameter: "-gen") inserts its parameter # before the ".c", so the filename becomes "foo-gen.c" # +# Alternatively, add this Makefile rule to disable compiling "foo.capnp.c" -> "foo.capnp": +# %.capnp: ; +# +# # ("foo" is really "foo.capnp", so it's foo.capnp-gen.c) annotation fieldgetset @0xf72bc690355d66de (file): Void;