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