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.
This commit is contained in:
Thanos Makatos 2016-04-06 14:06:29 +03:00
parent 3464f005ff
commit 088d5ac05e

View File

@ -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 $@ $<