tools: build convenience library
authorThierry Reding <treding@nvidia.com>
Mon, 6 Mar 2017 22:35:36 +0000 (23:35 +0100)
committerBartosz Golaszewski <bartekgola@gmail.com>
Tue, 7 Mar 2017 10:04:22 +0000 (11:04 +0100)
Build a convenience library to avoid having to add the tools-common.c
source file for each of the tools.

This also has the side-effect of fixing 'make distcheck' because the
tools-common.h header file is now included in the source tarball.

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

index a1fe0b0644dee06c502856b229b0e64ff9b6b4c2..68699b597b58f88ff39f21182605ef49251e751d 100644 (file)
@@ -8,18 +8,24 @@
 
 AM_CFLAGS = -I$(top_srcdir)/include/ -include $(top_builddir)/config.h
 AM_CFLAGS += -Wall -Wextra -g
-LDADD = ../lib/libgpiod.la
+
+noinst_LTLIBRARIES = libtools-common.la
+libtools_common_la_SOURCES = \
+       tools-common.c \
+       tools-common.h
+
+LDADD = ../lib/libgpiod.la libtools-common.la
 
 bin_PROGRAMS = gpiodetect gpioinfo gpioget gpioset gpiomon gpiofind
 
-gpiodetect_SOURCES = gpiodetect.c tools-common.c
+gpiodetect_SOURCES = gpiodetect.c
 
-gpioinfo_SOURCES = gpioinfo.c tools-common.c
+gpioinfo_SOURCES = gpioinfo.c
 
-gpioget_SOURCES = gpioget.c tools-common.c
+gpioget_SOURCES = gpioget.c
 
-gpioset_SOURCES = gpioset.c tools-common.c
+gpioset_SOURCES = gpioset.c
 
-gpiomon_SOURCES = gpiomon.c tools-common.c
+gpiomon_SOURCES = gpiomon.c
 
-gpiofind_SOURCES = gpiofind.c tools-common.c
+gpiofind_SOURCES = gpiofind.c