summaryrefslogtreecommitdiff
blob: 4f5ab7c0d36e59137046f6399ece2f21cc6889d3 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
diff -uN libixp-0.2.bak/config.mk libixp-0.2/config.mk
--- libixp-0.2.bak/config.mk	2006-12-27 03:59:09.000000000 -0800
+++ libixp-0.2/config.mk	2007-06-24 11:45:59.000000000 -0700
@@ -14,6 +14,7 @@
 # flags
 CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\"
 LDFLAGS = ${LIBS}
+SOFLAGS = -fPIC -shared
 #CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\"
 #LDFLAGS = -g ${LIBS}
 
diff -uN libixp-0.2.bak/Makefile libixp-0.2/Makefile
--- libixp-0.2.bak/Makefile	2006-12-27 03:59:09.000000000 -0800
+++ libixp-0.2/Makefile	2007-06-24 11:45:59.000000000 -0700
@@ -9,18 +9,23 @@
 OBJ = ${SRC:.c=.o}
 OBJIXPC = ${SRCIXPC:.c=.o}
 
-all: options libixp.a ixpc
+all: options libixp.a libixp.so ixpc
 
 options:
 	@echo libixp build options:
 	@echo "CFLAGS   = ${CFLAGS}"
 	@echo "LDFLAGS  = ${LDFLAGS}"
 	@echo "CC       = ${CC}"
+	@echo "SOFLAGS  = ${SOFLAGS}"
 	@echo "LD       = ${LD}"
 
+${OBJIXPC}: 
+	@echo CC ${@:.o=.c}
+	@${CC} -c ${CFLAGS} ${@:.o=.c}
+
 .c.o:
 	@echo CC $<
-	@${CC} -c ${CFLAGS} $<
+	@${CC} ${SOFLAGS} -c ${CFLAGS} $<
 
 ${OBJ}: config.mk ixp.h
 
@@ -29,6 +34,10 @@
 	@${AR} $@ ${OBJ}
 	@${RANLIB} $@
 
+libixp.so: ${OBJ}
+	@echo CC $@
+	@${CC} ${SOFLAGS} -o $@ ${OBJ}
+
 ixpc: ${OBJIXPC}
 	@echo LD $@
 	@${LD} -o $@ ${OBJIXPC} ${LDFLAGS} -lixp
@@ -36,7 +45,7 @@
 
 clean:
 	@echo cleaning
-	@rm -f ixpc libixp.a ${OBJ} ${OBJIXPC} libixp-${VERSION}.tar.gz
+	@rm -f ixpc libixp.a libixp.so ${OBJ} ${OBJIXPC} libixp-${VERSION}.tar.gz
 
 dist: clean
 	@echo creating dist tarball
@@ -55,6 +64,9 @@
 	@mkdir -p ${DESTDIR}${PREFIX}/lib
 	@cp -f libixp.a ${DESTDIR}${PREFIX}/lib
 	@chmod 644 ${DESTDIR}${PREFIX}/lib/libixp.a
+	@cp -f libixp.so ${DESTDIR}${PREFIX}/lib/libixp.so.${VERSION}
+	@chmod 755 ${DESTDIR}${PREFIX}/lib/libixp.so.${VERSION}
+	@ln -s libixp.so.${VERSION} ${DESTDIR}${PREFIX}/lib/libixp.so
 	@echo installing ixpc to ${DESTDIR}${PREFIX}/bin
 	@mkdir -p ${DESTDIR}${PREFIX}/bin
 	@cp -f ixpc ${DESTDIR}${PREFIX}/bin
@@ -67,8 +79,12 @@
 uninstall:
 	@echo removing header file from ${DESTDIR}${PREFIX}/include
 	@rm -f ${DESTDIR}${PREFIX}/include/ixp.h
+
 	@echo removing library file from ${DESTDIR}${PREFIX}/lib
 	@rm -f ${DESTDIR}${PREFIX}/lib/libixp.a
+	@echo removing shared object file from ${DESTDIR}${PREFIX}/lib
+	@rm -f ${DESTDIR}${PREFIX}/lib/libixp.so
+	@rm -f ${DESTDIR}${PREFIX}/lib/libixp.so.${VERSION}
 	@echo removing ipx client from ${DESTDIR}${PREFIX}/bin
 	@rm -f ${DESTDIR}${PREFIX}/bin/ixpc
 	@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1