$NetBSD$

--- Makefile.in.orig	2008-05-21 18:18:18.000000000 -0400
+++ Makefile.in
@@ -45,7 +45,8 @@ mandir = @mandir@
 all: otf2bdf
 
 otf2bdf: $(OBJS)
-	$(CC) $(STATIC) $(LDFLAGS) -o otf2bdf $(OBJS) $(LIBS)
+	$(LIBTOOL) --mode=link \
+		$(CC) $(LDFLAGS) -o otf2bdf $(OBJS:.o=.lo) $(LIBS)
 
 clean:
 	$(RM) -f *.o *BAK *CKP *~ a.out core
@@ -57,15 +58,18 @@ distclean: clean
 	$(RM) -f otf2bdf config.* Makefile
 
 .c.o:
-	$(CC) $(CFLAGS) $(INCS) -c $< -o $@
+	$(LIBTOOL) --mode=compile --tag=CC \
+		$(CC) $(CFLAGS) $(INCS) -prefer-pic -c $< 
 
 install: otf2bdf
-	$(MKINSTALLDIRS) $(bindir) $(mandir)/man1
-	$(CP) otf2bdf $(bindir)/otf2bdf
-	$(CP) otf2bdf.man $(mandir)/man1/otf2bdf.1
+	$(BSD_INSTALL_PROGRAM_DIR) $(DESTDIR)$(bindir) 
+	$(BSD_INSTALL_MAN_DIR) $(DESTDIR)$(mandir)/man1
+	$(LIBTOOL) --mode=install \
+		$(BSD_INSTALL_PROGRAM) otf2bdf $(DESTDIR)$(bindir)/otf2bdf
+	$(BSD_INSTALL_MAN) otf2bdf.man $(DESTDIR)$(mandir)/man1/otf2bdf.1
 
 uninstall:
-	$(RM) -f $(bindir)/otf2bdf
-	$(RM) -f $(mandir)/man1/otf2bdf.1
+	$(RM) -f $(DESTDIR)$(bindir)/otf2bdf
+	$(RM) -f $(DESTDIR)$(mandir)/man1/otf2bdf.1
 
 # end of Makefile
