From 088d5ac05eec54940d07226d57f771ed0d0a687b Mon Sep 17 00:00:00 2001 From: Thanos Makatos Date: Wed, 6 Apr 2016 14:06:29 +0300 Subject: [PATCH] compile 3rd party emitters into static lib before creating shared lib This patch adds an additional step in the compilation of 3rd party emitters: we first create the static library and then create the shared library. This is necessary in order to build the emitters into the static binary, which is implemented in a subsequent patch. --- contrib/Makefile.in | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/contrib/Makefile.in b/contrib/Makefile.in index 1df15ec..0b6c28f 100644 --- a/contrib/Makefile.in +++ b/contrib/Makefile.in @@ -1,20 +1,24 @@ +PLUGIN_LIBS= \ + contrib/thin_sexp_emitter.a \ + contrib/tmakatos_emitter.a \ + contrib/ewheeler_emitter.a + PLUGINS=\ contrib/thin_sexp_emitter.so \ contrib/tmakatos_emitter.so \ contrib/ewheeler_emitter.so -contrib: $(PLUGINS) +contrib: $(PLUGINS) $(PLUGIN_LIBS) -contrib/thin_sexp_emitter.so: contrib/thin_sexp_emitter.o +contrib/%.o: contrib/%.cc + $(V)echo " [CC] $@" + $(V)$(CC) $^ -o $@ + +contrib/%.a: contrib/%.o + $(V)echo " [AR] $@" + $(V)ar rcs $@ $^ + +contrib/%.so: contrib/%.a $(V)echo " [LD] $@" - $(V)$(CC) -shared -Wl,-soname,thin_sexp_emitter.so -o $@ $< - -contrib/tmakatos_emitter.so: contrib/tmakatos_emitter.o - $(V)echo " [LD] $@" - $(V)$(CC) -shared -Wl,-soname,tmakatos_emitter.so -o $@ $< - -contrib/ewheeler_emitter.so: contrib/ewheeler_emitter.o - $(V)echo " [LD] $@" - $(V)$(CC) -shared -Wl,-soname,ewheeler_emitter.so -o $@ $< - + $(V)$(CC) -shared -Wl,-soname,$@ -o $@ $<