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 `` internal library, while
`helloworld-agent.c` is part of ``.

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 <>
parent bef55a78
......@@ -59,11 +60,17 @@ gdbus_xml = \
helloworld-agent/org.apertis.HelloWorldAgentApp.Agent.TickBoard.xml \
nodist_helloworld_agent_libhelloworld_agent_generated_la_SOURCES = \
gdbus_sources = \
$(gdbus_xml:.xml=.h) \
$(gdbus_xml:.xml=.c) \
BUILT_SOURCES += $(gdbus_sources)
nodist_helloworld_agent_libhelloworld_agent_generated_la_SOURCES = \
$(gdbus_sources) \
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