Code

src/Makefile.am: Use "LDADD" for applications, "LIBADD" for the library.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Tue, 13 Jul 2010 14:07:53 +0000 (16:07 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Tue, 13 Jul 2010 14:07:53 +0000 (16:07 +0200)
Use "LDFLAGS" only for "-version-info".

src/Makefile.am

index d4112095a608dcff22e8fc681ca53c0775d50084..bc35a787ae5b1006c21aeb782ce7d24f55843e63 100644 (file)
@@ -21,23 +21,24 @@ lib_LTLIBRARIES = liboping.la
 #   set age to 0. 
 #
 # <http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html>
-liboping_la_LDFLAGS = -version-info @LIBOPING_CURRENT@:@LIBOPING_REVISION@:@LIBOPING_AGE@
+liboping_la_SOURCES = oping.h liboping.c
+
+liboping_la_CPPFLAGS = $(AM_CPPFLAGS)
+liboping_la_LDFLAGS = $(AM_LDFLAGS) -version-info @LIBOPING_CURRENT@:@LIBOPING_REVISION@:@LIBOPING_AGE@
+liboping_la_LIBADD =
 if BUILD_WITH_LIBSOCKET
-liboping_la_LDFLAGS += -lsocket
+liboping_la_LIBADD += -lsocket
 endif
 if BUILD_WITH_LIBXNET
-liboping_la_LDFLAGS += -lxnet
+liboping_la_LIBADD += -lxnet
 endif
 
-liboping_la_SOURCES = oping.h liboping.c
-
 bin_PROGRAMS = oping
 
 oping_SOURCES = oping.c
-oping_LDADD = liboping.la
-oping_LDFLAGS = -lm
+oping_LDADD = liboping.la -lm
 if BUILD_WITH_LIBRT
-oping_LDFLAGS += -lrt
+oping_LDADD += -lrt
 endif
 
 if BUILD_WITH_LIBNCURSES
@@ -45,9 +46,8 @@ bin_PROGRAMS += noping
 
 noping_SOURCES = oping.c
 noping_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_NCURSES=1
-noping_LDADD = liboping.la
-noping_LDFLAGS = -lm -lncurses
+noping_LDADD = liboping.la -lm -lncurses
 if BUILD_WITH_LIBRT
-noping_LDFLAGS += -lrt
+noping_LDADD += -lrt
 endif
 endif # BUILD_WITH_LIBNCURSES