From 9334886d1a09991af05b958482f9500f6c6dc17d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Tvrd=C3=ADk?= Date: Wed, 29 Jul 2015 10:41:37 +0200 Subject: [PATCH] Linking: move LDFLAGS at the end of commands Better support gcov $ LDFLAGS="-lgcov" CFLAGS="-fprofile-arcs -ftest-coverage" ./configure --- tools/Makefile.in | 6 +++--- tools/Rules.in | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/Makefile.in b/tools/Makefile.in index 30dd79e5..118f13d0 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -47,13 +47,13 @@ subdir: sysdep/paths.h .dir-stamp .dep-stamp set -e ; for a in $(static-dirs) $(client-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done $(exedir)/bird: $(bird-dep) - $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) + $(CC) -o $@ $^ $(LIBS) $(LDFLAGS) $(exedir)/birdc: $(birdc-dep) - $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(CLIENT_LIBS) + $(CC) -o $@ $^ $(LIBS) $(CLIENT_LIBS) $(LDFLAGS) $(exedir)/birdcl: $(birdcl-dep) - $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) + $(CC) -o $@ $^ $(LIBS) $(LDFLAGS) .dir-stamp: sysdep/paths.h mkdir -p $(static-dirs) $(client-dirs) $(doc-dirs) diff --git a/tools/Rules.in b/tools/Rules.in index c5830443..fe0e8dfa 100644 --- a/tools/Rules.in +++ b/tools/Rules.in @@ -48,10 +48,10 @@ tests_executables := $(notdir $(basename $(tests_sources))) tests: $(tests_executables) %_test.o: $(srcdir)/$(dir-name)/%_test.c - $(CC) $(CFLAGS) $(LDFLAGS) $^ -c -o $@ + $(CC) $(CFLAGS) $^ -c -o $@ $(LDFLAGS) %_test: $(srcdir)/$(dir-name)/%_test.o $(root-rel)test/birdtest.o - $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ + $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) ifdef source