summaryrefslogtreecommitdiff
blob: 3600481f4c72f85635f02bec124d444ffeaa9136 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
 Makefile | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index bbf0778..1dc6c62 100644
--- a/Makefile
+++ b/Makefile
@@ -4,22 +4,22 @@
 #	On System V machines, RANLIB should be ':'
 #
 SHELL		= /bin/sh
-RANLIB		= :
+#RANLIB		= :
 
-CXX		= gcc -felide-constructors
+CXX		?= g++
 #CXX		= CC
 
 .SUFFIXES:	.cc
 
 .cc.o:
-	$(CXX) $(CCFLAGS) -c $< -o $@
+	$(CXX) $(CXXFLAGS) -fPIC -felide-constructors -c $< -o $@
 
 OPT		= -O
 DEBUG		=
 CCFLAGS		= $(OPT) $(DEBUG)
 LIBRARY		= pdb++
 
-LIBARCH		= lib$(LIBRARY).a
+LIBARCH		= lib$(LIBRARY)
 OBJS		= pdb_read.o pdb_sprntf.o pdb_sscanf.o pdb_chars.o \
 		pdb_type.o pdb++.o pdbinput.o
 SRCS		= pdb_read.cc pdb_sprntf.cc pdb_sscanf.cc pdb_chars.cc \
@@ -30,10 +30,16 @@ all:		$(LIBARCH)
 install:	$(LIBARCH)
 		install -F /usr/local/lib $(LIBARCH)
 
-$(LIBARCH):     $(OBJS)
+$(LIBARCH).a:     $(OBJS)
 		@echo "Loading $(LIBARCH) ... "
-		@ar cru $(LIBARCH) $(OBJS)
-		@$(RANLIB) $(LIBARCH)
+		$(AR) cru $@ $(OBJS)
+		$(RANLIB) $@
+		@echo "done"
+
+$(LIBARCH).so:     $(OBJS)
+		$(CXX) $(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
 		@echo "done"
 
 clean:;		@rm -f $(OBJS)