From: Filipe Brandenburger Date: Mon, 11 May 2015 19:31:59 +0000 (-0700) Subject: build-sys: use proper dependencies on libproc.la X-Git-Tag: v3.3.11~54^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5cabea840949ae7df36799b9bd1f740c07a51191;p=procps-ng build-sys: use proper dependencies on libproc.la Use LDADD or *_LDADD instead of AM_LDFLAGS to refer to libproc.la. Otherwise, parallel builds will break as there is no explicit dependency to ensure the library is built before the binaries that try to link to it. v2: Added empty rules lib_test_*_LDADD to remove the dependency on libproc which is not used by the lib/test_* binaries. Tested by running `make -jNN` repeatedly for different levels of parallelism to ensure the build works. Also checked that `make check` and `make distcheck` still work as expected. Also made sure that a parallel make invocation works with `make -j distcheck`. Reported-by: Jim Warner Signed-off-by: Filipe Brandenburger --- diff --git a/Makefile.am b/Makefile.am index b174f00a..124c18dc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,7 +14,7 @@ SUBDIRS = \ testsuite AM_CFLAGS = -Iproc -AM_LDFLAGS = ./proc/libprocps.la +LDADD = ./proc/libprocps.la transform = s/pscommand/ps/; $(program_transform_name) @@ -93,16 +93,16 @@ dist_man_MANS += \ watch.1 \ top/top.1 slabtop_SOURCES = slabtop.c lib/strutils.c lib/fileutils.c -slabtop_LDADD = @NCURSES_LIBS@ +slabtop_LDADD = $(LDADD) @NCURSES_LIBS@ watch_SOURCES = watch.c lib/strutils.c lib/fileutils.c -watch_LDADD = @WATCH_NCURSES_LIBS@ +watch_LDADD = $(LDADD) @WATCH_NCURSES_LIBS@ top_top_SOURCES = \ top/top.h \ top/top.c \ top/top_nls.h \ top/top_nls.c \ lib/fileutils.c -top_top_LDADD = @NCURSES_LIBS@ $(DL_LIB) +top_top_LDADD = $(LDADD) @NCURSES_LIBS@ $(DL_LIB) dist_procpsng_DATA += \ top/README.top endif @@ -220,8 +220,11 @@ ps_pscommand_SOURCES = \ noinst_PROGRAMS = lib/test_strutils lib/test_fileutils lib/test_nsutils lib_test_strutils_SOURCES = lib/test_strutils.c lib/strutils.c +lib_test_strutils_LDADD = lib_test_fileutils_SOURCES = lib/test_fileutils.c lib/fileutils.c +lib_test_fileutils_LDADD = lib_test_nsutils_SOURCES = lib/test_nsutils.c lib/nsutils.c +lib_test_nsutils_LDADD = if EXAMPLE_FILES sysconf_DATA = sysctl.conf