From: Martin Glueck Date: Sat, 19 Feb 2011 18:55:43 +0000 (+0100) Subject: Makefile: Add building of shared library on linux X-Git-Tag: v1.0a7~35 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=1b2e289952e77d5b57d993362f36c9a4974df78f;p=sx%2Fsimavr.git Makefile: Add building of shared library on linux Disabled for non linux platform, as it need more work than just a gcc -shared Author: Martin Glueck Edit: Michel Pollet --- diff --git a/simavr/Makefile b/simavr/Makefile index 0d21100..69bfd7c 100644 --- a/simavr/Makefile +++ b/simavr/Makefile @@ -37,7 +37,12 @@ IPATH += ../include IPATH += /opt/local/include LFLAGS = -L/opt/local/lib/ -all: obj libsimavr.a ${target} +all: obj libsimavr.a +# shared library won't work that easily on non-linux +ifeq (${shell uname}, Linux) +all: libsimavr.so +endif +all: ${target} obj/sim_%.o : cores/sim_%.c @gcc $(CFLAGS) -MD \ @@ -53,6 +58,11 @@ libsimavr.a : ${sim_o} @ar cru $@ $^ @ranlib $@ +libsimavr.so : ${cores_o} +libsimavr.so : ${sim_o} + @echo gcc -shared $@ + gcc -shared -o $@ $(LFLAGS) $^ $(LDFLAGS) + ${target} : libsimavr.a ${target} : obj/${target}.o @gcc $(CFLAGS) $(LFLAGS) \