bt2: Makefile: track dependencies of native_bt.c
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 10 Sep 2019 15:08:43 +0000 (11:08 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 3 Oct 2019 14:45:10 +0000 (10:45 -0400)
commit329b8da778080cba2433326df283278cca04d538
treef55aa3e4a7e1aa153ef75272732b0cfc6b59ba3d
parent05920081b929a006d378d3df877f943b15112e43
bt2: Makefile: track dependencies of native_bt.c

Building native_bt.c involves including many .h files from include/.
Those dependencies are not tracked by the Makefile, which means that if
you build, modify a .h (which can be simply checking out a different
commit) and build again, native_bt.c won't be re-built (even though it
should).

SWIG has the same kind of features to make dependency tracking easy as
gcc.  The -MD switch generates a bt2/native_bt.d file containing a make
target with all files involved in generating bt2/native_bt.c.  All we
have to do is to include that file in our Makefile.  `-include` is used
so that it's not an error if the file does not exist (which happens the
first time you build).

Change-Id: Iedb187657d42770fa2caeadfa07079351af8a485
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2023
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
src/bindings/python/bt2/Makefile.am
This page took 0.025273 seconds and 4 git commands to generate.