From 1b2e289952e77d5b57d993362f36c9a4974df78f Mon Sep 17 00:00:00 2001 From: Martin Glueck Date: Sat, 19 Feb 2011 19:55:43 +0100 Subject: [PATCH] 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 --- simavr/Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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) \ -- 2.39.5