| 1 |
Description: build shared library |
| 2 |
Upstream only builds a static library, this adds a shared one. |
| 3 |
Author: Sascha Steinbiss <[email protected]> |
| 4 |
Last-Update: 2016-01-08 |
| 5 |
--- a/Makefile |
| 6 |
+++ b/Makefile |
| 7 |
@@ -1,5 +1,5 @@ |
| 8 |
CC= gcc |
| 9 |
|
| 10 |
+CFLAGS= -g -Wall -O2 -fPIC #-fno-inline-functions -fno-inline-functions-called-once |
| 11 |
CPPFLAGS= |
| 12 |
INCLUDES= |
| 13 |
OBJS= kthread.o misc.o \ |
| 14 |
@@ -8,13 +8,14 @@ |
| 15 |
unitig.o mag.o bubble.o ksw.o |
| 16 |
PROG= fml-asm |
| 17 |
LIBS= -lm -lz -lpthread |
| 18 |
+SONUMBER=0 |
| 19 |
|
| 20 |
.SUFFIXES:.c .o |
| 21 |
|
| 22 |
.c.o: |
| 23 |
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $< -o $@ |
| 24 |
|
| 25 |
|
| 26 |
+all:$(PROG) libfml.so.$(SONUMBER) |
| 27 |
|
| 28 |
fml-asm:libfml.a example.o |
| 29 |
$(CC) $(CFLAGS) $^ -o $@ -L. -lfml $(LIBS) |
| 30 |
@@ -22,6 +23,10 @@ |
| 31 |
libfml.a:$(OBJS) |
| 32 |
$(AR) -csru $@ $(OBJS) |
| 33 |
|
| 34 |
+libfml.so.$(SONUMBER): $(OBJS) |
| 35 |
+ $(CC) -shared -o $@ $(OBJS) -fPIC -Wl,-soname,libfml.so.$(SONUMBER) $(LIBS) $(LDFLAGS) |
| 36 |
+ |
| 37 |
+ |
| 38 |
clean: |
| 39 |
rm -fr gmon.out *.o ext/*.o a.out $(PROG) *~ *.a *.dSYM session* |
| 40 |
|