tests: fix out-of-tree builds
authorThierry Reding <treding@nvidia.com>
Tue, 7 Mar 2017 13:39:03 +0000 (14:39 +0100)
committerBartosz Golaszewski <bartekgola@gmail.com>
Wed, 8 Mar 2017 13:39:57 +0000 (14:39 +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>
tests/unit/Makefile.am

index 05197de088b2d241c6cb90890a741ae72ea3ff37..c42286e542d63ab80fe7084dd445d438ae0faa9a 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 -lkmod -ludev
-DEPENDENCIES = libgpiod.la
+LDADD = ../../src/lib/libgpiod.la -lkmod -ludev
 
 check_PROGRAMS = gpiod-unit