aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGöktürk Yüksek <gokturk@gentoo.org>2016-05-25 08:31:55 -0400
committerGöktürk Yüksek <gokturk@gentoo.org>2016-05-25 08:31:55 -0400
commit07f61719e735f932440e3300da586c873099adc6 (patch)
treef67e8425e1c7d2b0458b371499c0aed4e4e3aa70 /Makefile
parent3e6402456b00e29f659baf26ced10f3d7205cf63 (diff)
downloadimv-07f61719e735f932440e3300da586c873099adc6.tar.gz
Fix the linking order of tests in the Makefile for --as-needed
When '--as-needed' linker flag is added to LDFLAGS, linker strips out the symbols from the libraries needed for the tests due to the order in which the libraries appear on the command line. List the source files before the libraries to fix the linking issue. For more information, see: https://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed#Importance_of_linking_order Signed-off-by: Göktürk Yüksek <gokturk@gentoo.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 7e40bf1..c130dfb 100644
--- a/Makefile
+++ b/Makefile
@@ -48,7 +48,7 @@ $(BUILDDIR)/%.o: src/%.c
$(BUILDDIR)/test_%: test/%.c src/%.c
@echo "BUILDING $@"
- $(MUTE)$(CC) -o $@ -Isrc $(TFLAGS) $(LDFLAGS) -lcmocka $^
+ $(MUTE)$(CC) -o $@ -Isrc $(TFLAGS) $^ $(LDFLAGS) -lcmocka
check: $(BUILDDIR) $(TESTS)
@echo "RUNNING TESTS"