From 8ff28ec974acf3f1a8818522bb29991a22e6c137 Mon Sep 17 00:00:00 2001 From: darealshinji Date: Tue, 1 Dec 2015 14:34:08 +0100 Subject: [PATCH] Make dynamic linking easier --- src/Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index 289198c5..adc47951 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,6 @@ # Simple Makefile for Kvazaar HEVC encoder -all: cli lib-shared +all: cli lib-static lib-shared .PHONY: all # Installation locations @@ -259,6 +259,12 @@ TESTS_OBJS = $(TEST_OBJS) $(OBJS) DEPS = $(RELEASE_OBJS:.o=.d) $(DEBUG_OBJS:.o=.d) $(TESTS_OBJS:.o=.d) +ifdef LINK_SHARED +LINKLIB = $(LIBKVAZAAR_SHARED) +else +LINKLIB = $(STATIC) +endif + .PHONY: cli lib-shared lib-static debug tests build_tests cli: $(PROG) lib-shared: $(LIBKVAZAAR_SHARED) @@ -281,7 +287,7 @@ $(DYLIB): LDFLAGS += -dynamiclib \ -compatibility_version $(VER_MAJOR) \ -install_name $(LIBDIR)/$@ -$(PROG): $(MAIN_OBJS) $(STATIC) +$(PROG): $(MAIN_OBJS) $(LINKLIB) $(LD) $^ $(LDFLAGS) $(LIBS) -o $@ $(STATIC): $(OBJS)