diff -Naur jbigkit/libjbig/Makefile jbigkit.oden/libjbig/Makefile
--- jbigkit/libjbig/Makefile	2008-08-30 19:20:52.000000000 +0200
+++ jbigkit.oden/libjbig/Makefile	2009-01-31 20:12:02.000000000 +0100
@@ -3,27 +3,51 @@
 
 # Select an ANSI/ISO C compiler here, GNU gcc is recommended
 CC = gcc
+CFLAGS = -g -O2 -Wall -ansi -pedantic -fPIC # --coverage
+LDFLAGS = 
 
-# Options for the compiler: A high optimization level is suggested
-CFLAGS = -g -O -Wall -ansi -pedantic # --coverage
-
-all: libjbig.a tstcodec tstcodec85
-
-tstcodec: tstcodec.o jbig.o jbig_ar.o
-	$(CC) $(CFLAGS) -o tstcodec $+
-
-tstcodec85: tstcodec85.o jbig85.o jbig_ar.o
-	$(CC) $(CFLAGS) -o tstcodec85 $+
-
-libjbig.a: jbig.o jbig_ar.o
-	rm -f libjbig.a
-	ar rc libjbig.a jbig.o jbig_ar.o
-	-ranlib libjbig.a
-
-libjbig85.a: jbig85.o jbig_ar.o
-	rm -f libjbig85.a
-	ar rc libjbig85.a jbig85.o jbig_ar.o
-	-ranlib libjbig85.a
+prefix=/usr/local
+libdir=$(prefix)/lib
+includedir=$(prefix)/include
+bindir=$(prefix)/bin
+mandir=$(prefix)/share/man
+
+LT_CURRENT=1
+LT_REVISION=0
+LT_AGE=0
+ 
+all: libjbig.la libjbig85.la tstcodec tstcodec85
+
+tstcodec: tstcodec.o libjbig.la
+	libtool --mode=link --tag=CC $(CC) $(CFLAGS) $(LDFLAGS) \
+	-o tstcodec tstcodec.o libjbig.la
+
+tstcodec85: tstcodec85.o libjbig85.la
+	libtool --mode=link --tag=CC $(CC) $(CFLAGS) $(LDFLAGS) \
+	-o tstcodec85 tstcodec85.o libjbig85.la
+
+%.lo: %.c
+	libtool --mode=compile --tag=CC $(CC) $(CFLAGS) -c $*.c
+
+libjbig.la: jbig.lo jbig_ar.lo
+	libtool --mode=link --tag=CC $(CC) $(LDFLAGS) \
+	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+	-o libjbig.la jbig.lo jbig_ar.lo -rpath $(libdir) 
+
+libjbig85.la: jbig85.lo jbig_ar.lo
+	libtool --mode=link --tag=CC $(CC) $(LDFLAGS) \
+	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+	-o libjbig85.la jbig85.lo jbig_ar.lo -rpath $(libdir) 
+
+jbig.lo: jbig.c jbig.h
+jbig85.lo: jbig85.c jbig.h
+
+install:
+	install -m0755 -d $(DESTDIR)$(libdir)
+	install -m0755 -d $(DESTDIR)$(includedir)
+	libtool --mode=install install libjbig.la $(DESTDIR)$(libdir)
+	libtool --mode=install install libjbig85.la $(DESTDIR)$(libdir)
+	install -m0644 jbig85.h jbig_ar.h jbig.h $(DESTDIR)$(includedir)
 
 jbig.o: jbig.c jbig.h jbig_ar.h
 jbig85.o: jbig85.c jbig85.h jbig_ar.h
@@ -46,3 +70,5 @@
 clean:
 	rm -f *.{o,gcda,gcno,gcov} *~ core gmon.out dbg_d\=??.pbm t82test.pbm
 	rm -f tstcodec tstcodec85
+	rm -rf .libs
+	rm -f *.*o *.*a
diff -Naur jbigkit/Makefile jbigkit.oden/Makefile
--- jbigkit/Makefile	2008-08-30 22:40:22.000000000 +0200
+++ jbigkit.oden/Makefile	2009-01-31 20:11:24.000000000 +0100
@@ -10,8 +10,6 @@
 
 CFLAGS = $(CCFLAGS) -I../libjbig
 
-VERSION=2.0
-
 all: lib pbm
 	@echo "Enter 'make test' in order to start some automatic tests."
 
@@ -25,6 +23,10 @@
 	(cd libjbig;  make "CC=$(CC)" "CFLAGS=$(CFLAGS)" test)
 	(cd pbmtools; make "CC=$(CC)" "CFLAGS=$(CFLAGS)" test)
 
+install:
+	make -C libjbig install
+	make -C pbmtools install
+
 clean:
 	rm -f *~ core
 	(cd libjbig; make clean)
diff -Naur jbigkit/pbmtools/Makefile jbigkit.oden/pbmtools/Makefile
--- jbigkit/pbmtools/Makefile	2008-08-26 00:26:39.000000000 +0200
+++ jbigkit.oden/pbmtools/Makefile	2009-01-31 20:11:24.000000000 +0100
@@ -5,37 +5,50 @@
 CC = gcc
 
 # Options for the compiler
-CFLAGS = -g -Wall -ansi -pedantic -I../libjbig # --coverage
+CFLAGS = -g -Wall -ansi -pedantic  -fPIC # --coverage
+CPPFLAGS = -I../libjbig
+LDFLAGS = 
+
+prefix=/usr/local
+libdir=$(prefix)/lib
+includedir=$(prefix)/include
+bindir=$(prefix)/bin
+mandir=$(prefix)/share/man
 
 .SUFFIXES: .1 .5 .txt $(SUFFIXES)
 
 all: pbmtojbg jbgtopbm pbmtojbg85 jbgtopbm85 \
 	pbmtojbg.txt jbgtopbm.txt pbm.txt pgm.txt
 
-pbmtojbg: pbmtojbg.o ../libjbig/libjbig.a
-	$(CC) $(CFLAGS) -o pbmtojbg pbmtojbg.o -L../libjbig -ljbig
-
-jbgtopbm: jbgtopbm.o ../libjbig/libjbig.a
-	$(CC) $(CFLAGS) -o jbgtopbm jbgtopbm.o -L../libjbig -ljbig
-
-pbmtojbg85: pbmtojbg85.o ../libjbig/libjbig85.a
-	$(CC) $(CFLAGS) -o pbmtojbg85 pbmtojbg85.o -L../libjbig -ljbig85
-
-jbgtopbm85: jbgtopbm85.o ../libjbig/libjbig85.a
-	$(CC) $(CFLAGS) -o jbgtopbm85 jbgtopbm85.o -L../libjbig -ljbig85
+pbmtojbg: pbmtojbg.o ../libjbig/libjbig.la
+	libtool --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) \
+	-o pbmtojbg pbmtojbg.o ../libjbig/libjbig.la
+
+jbgtopbm: jbgtopbm.o ../libjbig/libjbig.la
+	libtool --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) \
+	-o jbgtopbm jbgtopbm.o ../libjbig/libjbig.la
+
+pbmtojbg85: pbmtojbg85.o ../libjbig/libjbig85.la
+	libtool --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) \
+	-o pbmtojbg85 pbmtojbg85.o ../libjbig/libjbig85.la
+
+jbgtopbm85: jbgtopbm85.o ../libjbig/libjbig85.la
+	libtool --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) \
+	-o jbgtopbm85 jbgtopbm85.o ../libjbig/libjbig85.la
 
 jbgtopbm.o: jbgtopbm.c ../libjbig/jbig.h
 pbmtojbg.o: pbmtojbg.c ../libjbig/jbig.h
 jbgtopbm85.o: jbgtopbm85.c ../libjbig/jbig85.h
 pbmtojbg85.o: pbmtojbg85.c ../libjbig/jbig85.h
 
-../libjbig/libjbig.a: ../libjbig/jbig.c ../libjbig/jbig.h \
-	../libjbig/jbig_ar.c ../libjbig/jbig_ar.h
-	make -C ../libjbig libjbig.a
-
-../libjbig/libjbig85.a: ../libjbig/jbig85.c ../libjbig/jbig85.h \
-	../libjbig/jbig_ar.c ../libjbig/jbig_ar.h
-	make -C ../libjbig libjbig85.a
+install:
+	install -m0755 -d $(DESTDIR)$(bindir)
+	install -m0755 -d $(DESTDIR)$(mandir)/man1
+	install -m0755 -d $(DESTDIR)$(mandir)/man5
+	libtool --mode=install install pbmtojbg jbgtopbm \
+	pbmtojbg85 jbgtopbm85 $(DESTDIR)$(bindir)
+	install -m0644 pbmtojbg.1 jbgtopbm.1 $(DESTDIR)$(mandir)/man1
+	install -m0644 pbm.5 pgm.5 $(DESTDIR)$(mandir)/man5
 
 test: test82 test85
 
@@ -149,6 +162,7 @@
 	groff -man -Tascii -P -c -P -b -P -u $< >$@
 
 clean:
-	rm -f *.o *~ core pbmtojbg jbgtopbm pbmtojbg85 jbgtopbm85
+	rm -f *.*o *.*a *~ core pbmtojbg jbgtopbm pbmtojbg85 jbgtopbm85
 	rm -f test-*.jbg test-*.pbm test-*.pgm test-*.jbg85 test-*.pbm85
 	rm -f *.gcda *.gcno
+	rm -rf .libs
