Commit a7aef43a authored by Emanuele Aina's avatar Emanuele Aina

Makefile: Add missing dep on the generated DBus header file

The `helloworld-agent.c` source file includes `helloworld-tickboard.h`
which in turn includes the generated
`org.apertis.HelloWorldAgentApp.Agent.TickBoard.h` header file.

However, `gdbus-gen` is only called to generate the TickBoard header when
building the `libhelloworld-agent-generated.la` internal library, while
`helloworld-agent.c` is part of `libhelloworld-agent-internal.la`.

While this used to work by chance, newer Make chooses a different ordering
leading to the error below:

      CC       helloworld-agent/helloworld-agent.o
    In file included from helloworld-agent/helloworld-agent.c:12:
    helloworld-agent/helloworld-tickboard.h:17:10: fatal error: org.apertis.HelloWorldAgentApp.Agent.TickBoard.h: No such file or directory
     #include "org.apertis.HelloWorldAgentApp.Agent.TickBoard.h"
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.

To avoid the issue, add the generated source files to the automake
`BUILT_SOURCES` variable so they get generated before the actual
compilation begins.
Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
parent bef55a78
BUILT_SOURCES =
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_CPPFLAGS = \
......@@ -59,11 +60,17 @@ gdbus_xml = \
helloworld-agent/org.apertis.HelloWorldAgentApp.Agent.TickBoard.xml \
$(NULL)
nodist_helloworld_agent_libhelloworld_agent_generated_la_SOURCES = \
gdbus_sources = \
$(gdbus_xml:.xml=.h) \
$(gdbus_xml:.xml=.c) \
$(NULL)
BUILT_SOURCES += $(gdbus_sources)
nodist_helloworld_agent_libhelloworld_agent_generated_la_SOURCES = \
$(gdbus_sources) \
$(NULL)
helloworld_agent_libhelloworld_agent_generated_la_CFLAGS = $(codegen_cflags)
helloworld-agent/%.c: helloworld-agent/%.xml Makefile
......
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