summaryrefslogtreecommitdiff
blob: 1fbc0e69350270bdeabede12fe993cc34f074afb (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
--- libircclient-1.7.orig/src/Makefile.in
+++ libircclient-1.7/src/Makefile.in
@@ -1,8 +1,10 @@
 # $Id$
 CC = @CC@
-CFLAGS = -Wall -DIN_BUILDING_LIBIRC @CFLAGS@
+CFLAGS = -fPIC -Wall -DIN_BUILDING_LIBIRC @CFLAGS@
 AR=@AR@ cr
 RANLIB=@RANLIB@
+INSTALL=install
+LN=ln -sf
 INCLUDES=-I../include
 DESTDIR=
 APIVERSION = 1
@@ -15,19 +17,24 @@
 shared: libircclient.so
 shared_mingw: libircclient.dll
 
-install:
-	-mkdir -p $(DESTDIR)@prefix@/include
-	-mkdir -p $(DESTDIR)@libdir@
-	cp ../include/libircclient.h $(DESTDIR)@prefix@/include/libircclient.h
-	cp ../include/libirc_errors.h $(DESTDIR)@prefix@/include/libirc_errors.h
-	cp ../include/libirc_events.h  $(DESTDIR)@prefix@/include/libirc_events.h 
-	cp ../include/libirc_options.h  $(DESTDIR)@prefix@/include/libirc_options.h 
-	cp ../include/libirc_rfcnumeric.h  $(DESTDIR)@prefix@/include/libirc_rfcnumeric.h 
-	cp libircclient.so $(DESTDIR)@libdir@/libircclient.so.$(APIVERSION)
-	ln -fs libircclient.so.$(APIVERSION) $(DESTDIR)@libdir@/libircclient.so
+install: install-headers install-static install-shared
+install-headers:
+	$(INSTALL) -d $(DESTDIR)@prefix@/include
+	$(INSTALL) -m0644 ../include/libircclient.h $(DESTDIR)@prefix@/include/libircclient.h
+	$(INSTALL) -m0644 ../include/libirc_errors.h $(DESTDIR)@prefix@/include/libirc_errors.h
+	$(INSTALL) -m0644 ../include/libirc_events.h  $(DESTDIR)@prefix@/include/libirc_events.h 
+	$(INSTALL) -m0644 ../include/libirc_options.h  $(DESTDIR)@prefix@/include/libirc_options.h 
+	$(INSTALL) -m0644 ../include/libirc_rfcnumeric.h  $(DESTDIR)@prefix@/include/libirc_rfcnumeric.h 
+install-shared:
+	$(INSTALL) -d $(DESTDIR)@libdir@
+	$(INSTALL) -m0755 libircclient.so $(DESTDIR)@libdir@/libircclient.so.$(APIVERSION)
+	$(LN) libircclient.so.$(APIVERSION) $(DESTDIR)@libdir@/libircclient.so
+install-static:
+	$(INSTALL) -d $(DESTDIR)@libdir@
+	$(INSTALL) -m0644 libircclient.a $(DESTDIR)@libdir@/libircclient.a
 
 libircclient.so: libircclient.o
-	$(CC) -shared -s -Wl,-soname,libircclient.so.$(APIVERSION) -o libircclient.so libircclient.o @LIBS@
+	$(CC) $(CFLAGS) -shared -Wl,-soname,libircclient.so.$(APIVERSION) -o libircclient.so libircclient.o $(LDFLAGS) @LIBS@
 
 libircclient.dll: libircclient.o
 	$(CC) -shared -s -o libircclient.dll -Wl,-out-implib,libircclient.lib libircclient.o libircclient.def -lkernel32 -lwsock32 @LIBS@