You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/sci-libs/libpdb/files/libpdb-991112-dynlib+flags....

47 lines
1.1 KiB

Makefile | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index 760a427..de7e724 100644
--- a/Makefile
+++ b/Makefile
@@ -8,16 +8,16 @@
# RANLIB should be ':'
#
SHELL = /bin/sh
-RANLIB = :
+#RANLIB = :
NOTHING =
LINTOPT = -o $(NOTHING)
OPT = -O -g
DEBUG =
-CFLAGS = $(OPT) $(DEBUG)
+CFLAGS += -fPIC
LIBRARY = pdb
-LIBARCH = lib$(LIBRARY).a
+LIBARCH = lib$(LIBRARY)
LINTLIB = llib-l$(LIBRARY).ln
OBJS = pdb_read.o pdb_sprntf.o pdb_sscanf.o pdb_write.o pdbrun.o ms.o
SRCS = pdb_read.c pdb_sprntf.c pdb_sscanf.c pdb_write.c pdbrun.c ms.c
@@ -27,10 +27,15 @@ all: $(LIBARCH) $(LINTLIB)
install: $(LIBARCH)
install -F /usr/local/lib $(LIBARCH)
-$(LIBARCH): $(OBJS)
+$(LIBARCH).so: $(OBJS)
+ $(CC) $(LDFLAGS) -shared -Wl,--soname,libpdb.so.0 -o libpdb.so.0.1 $(OBJS)
+ ln -sf libpdb.so.0.1 libpdb.so.0
+ ln -sf libpdb.so.0.1 libpdb.so
+
+$(LIBARCH).a: $(OBJS)
@echo "Loading $(LIBARCH) ... "
- @ar cru $(LIBARCH) $(OBJS)
- @$(RANLIB) $(LIBARCH)
+ $(AR) cru $@ $(OBJS)
+ $(RANLIB) $@
@echo "done"
$(LINTLIB): $(SRCS) $(HDRS)