From: Sascha Steinbiss Date: Wed, 4 Jul 2018 21:40:50 +0000 (+0200) Subject: build shared library X-Git-Tag: archive/raspbian/0.1+git20221215.85f159e-1+rpi1~1^2^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=efb71821e3c3cb9b3036b9e3108cb4c926adf9fa;p=fermi-lite.git build shared library Last-Update: 2016-01-08 Upstream only builds a static library, this adds a shared one. Gbp-Pq: Name make_shared_lib --- diff --git a/Makefile b/Makefile index edda713..1e11a07 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ CC= gcc -CFLAGS= -g -Wall -O2 -Wno-unused-function #-fno-inline-functions -fno-inline-functions-called-once +CFLAGS= -g -Wall -O2 -fPIC #-fno-inline-functions -fno-inline-functions-called-once CPPFLAGS= INCLUDES= OBJS= kthread.o misc.o \ @@ -8,13 +8,14 @@ OBJS= kthread.o misc.o \ unitig.o mag.o bubble.o ksw.o PROG= fml-asm LIBS= -lm -lz -lpthread +SONUMBER=0 .SUFFIXES:.c .o .c.o: $(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $< -o $@ -all:$(PROG) +all:$(PROG) libfml.so.$(SONUMBER) fml-asm:libfml.a example.o $(CC) $(CFLAGS) $^ -o $@ -L. -lfml $(LIBS) @@ -22,6 +23,10 @@ fml-asm:libfml.a example.o libfml.a:$(OBJS) $(AR) -csru $@ $(OBJS) +libfml.so.$(SONUMBER): $(OBJS) + $(CC) -shared -o $@ $(OBJS) -fPIC -Wl,-soname,libfml.so.$(SONUMBER) $(LIBS) $(LDFLAGS) + + clean: rm -fr gmon.out *.o ext/*.o a.out $(PROG) *~ *.a *.dSYM session*