aboutsummaryrefslogtreecommitdiffstats
path: root/devel/libds/files/patch-Makefile
blob: 1525642aa9d2fcb7d2256d1303510619ce69b7de (plain) (blame)
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
55
56
57
58
59
--- Makefile.orig   Fri Oct 25 09:21:06 2002
+++ Makefile    Mon Mar 22 13:55:27 2004
@@ -5,8 +5,8 @@
 # Makefile for LibDS 2.0
 #
 
-CC     =  cc
-CCOPTFLAGS = -O2
+CC     ?=  cc
+CCOPTFLAGS = $(CFLAGS)
 
 CCEXTRAFLAGS   = -DStandAlone
 
@@ -15,13 +15,14 @@
 
 INCLUDEFLAGS    = -I$(INCLUDEDIR) -I. -I..
 
-.SUFFIXES: .e .o
+.SUFFIXES: .e .o .So
 
 
 LIBTARGET  = libds
 LIBHEADER  = ds.h
 HEADERS    = 
 OBJ        =  avltree.o hashtbl.o heap.o parray.o queue.o stack.o set.o
+SH_OBJ     =  avltree.So hashtbl.So heap.So parray.So queue.So stack.So set.So
 
 LINC   = -I../include -I../../include
 ARLIB  = $(LIBTARGET).a
@@ -42,7 +43,7 @@
    $(TARGET)
 
 gcc:
-   @-$(MAKE) CC="gcc -pipe" CCWARNFLAGS="-Wall -W -Wshadow \
+   @-$(MAKE) CC=$(CC) CCWARNFLAGS="-Wall -W -Wshadow \
    -Wnested-externs -Wwrite-strings -Wpointer-arith \
    -Wmissing-declarations -Wredundant-decls -Winline \
    -Wstrict-prototypes" SHARED="-shared" release
@@ -52,9 +53,9 @@
 unix:
    @-$(MAKE) CCOPTFLAGS="-O" release
 
-$(ARLIB):   $(OBJ)
+$(ARLIB):   $(OBJ) $(SH_OBJ)
    ar r $(ARLIB) $(OBJ); ranlib $(ARLIB);\
-   ld $(SHARED) -o $(SOLIB) $(OBJ) -lc 
+   ld $(SHARED) -o $(SOLIB) $(SH_OBJ) -lc 
 
 install-dummy:
    install -m 664 -D libds.so /usr/local/lib/libds.so.2.0; \
@@ -66,6 +67,8 @@
    $(CC) $(INCLUDEFLAGS) $(LINC) $(CPPFLAGS) $(CCFLAGS) -c $*.c
 .c.e:
    $(CC) -E $(INCLUDEFLAGS) $(LINC) $(CPPFLAGS) $(CCFLAGS) $*.c > $@
+.c.So:
+   $(CC) $(INCLUDEFLAGS) $(LINC) $(CPPFLAGS) $(CCFLAGS) -fPIC -c $*.c -o $*.So
 
 .PHONY: clean