tools: fix out-of-tree builds
authorThierry Reding <treding@nvidia.com>
Mon, 6 Mar 2017 22:27:41 +0000 (23:27 +0100)
committerBartosz Golaszewski <bartekgola@gmail.com>
Tue, 7 Mar 2017 10:04:08 +0000 (11:04 +0100)
When building out of tree, the config.h header file and the libgpiod.la
file are generated in the build rather than the source directory.

While at it, link to libgpiod.la directly rather than via the -L and -l
linker options to enable extra libtool magic.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
src/tools/Makefile.am

index 13626d26020dc4a1b9f9bc5dfa411694788261fd..a1fe0b0644dee06c502856b229b0e64ff9b6b4c2 100644 (file)
@@ -6,10 +6,9 @@
 # as published by the Free Software Foundation.
 #
 
-AM_CFLAGS = -I$(top_srcdir)/include/ -include $(top_srcdir)/config.h
+AM_CFLAGS = -I$(top_srcdir)/include/ -include $(top_builddir)/config.h
 AM_CFLAGS += -Wall -Wextra -g
-LDADD = -lgpiod -L$(top_srcdir)/src/lib
-DEPENDENCIES = libgpiod.la
+LDADD = ../lib/libgpiod.la
 
 bin_PROGRAMS = gpiodetect gpioinfo gpioget gpioset gpiomon gpiofind