Index: dbf2mysql-1.14a/Makefile
===================================================================
--- dbf2mysql-1.14a.orig/Makefile	2016-03-06 15:45:21.018241016 +0100
+++ dbf2mysql-1.14a/Makefile	2016-03-06 15:46:27.534506932 +0100
@@ -2,31 +2,34 @@
 # Maarten Boekhold (boekhold@cindy.et.tudelft.nl) 1995
 
 # Set this to your C-compiler
-CC=gcc
+#CC=gcc
+
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/buildflags.mk
 
 # set this to your install-program (what does Solaris have
 # in /usr/sbin/install? SYSV install?)
 INSTALL=/usr/bin/install
 
 #AR=/usr/bin/ar
-AR=ar
+#AR=ar
 
 # Set this to whatever your compiler accepts. Nothing special is needed
 #CFLAGS=-g -Wall -pedantic -include /usr/include/mpatrol.h
 #CFLAGS=-g -Wall
-CFLAGS=-O2 -Wall
+CFLAGS+=-O2 -Wall
 
 # Set this to make smaller binaries
-#STRIP=
-STRIP=-s
+STRIP=
+#STRIP=-s
 
 # Set this to your MySQL installation-path
 MYSQLINC=-I/usr/include/mysql
-MYSQLLIB=-L/usr/lib/mysql
+MYSQLLIB=
 
 # Set this to where you want the binary (no man-page yet, don't know
 # how to write them)
-INSTALLDIR=/usr/local/bin
+INSTALLDIR=$(DESTDIR)/usr/bin
 
 # Set this if your system needs extra libraries
 #
@@ -55,11 +58,11 @@
 
 dbf2mysql: dbf2mysql.o libdbf.a
 	$(CC) $(CFLAGS) $(STRIP) -L. $(MYSQLLIB) -o $@ dbf2mysql.o -ldbf \
-		$(EXTRALIBS)
+		$(EXTRALIBS) $(LDFLAGS)
 
 mysql2dbf: mysql2dbf.o libdbf.a
 	$(CC) $(CFLAGS) $(STRIP) -L. $(MYSQLLIB) -o $@ mysql2dbf.o -ldbf \
-		$(EXTRALIBS)
+		$(EXTRALIBS) $(LDFLAGS)
 
 dbf.o: dbf.c dbf.h
 	$(CC) $(CFLAGS) -c -o $@ dbf.c
@@ -74,8 +77,9 @@
 	$(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" $(MYSQLINC) -c -o $@ mysql2dbf.c
 
 install: dbf2mysql
-	$(INSTALL) -m 0755 -s dbf2mysql $(INSTALLDIR)
-	$(INSTALL) -m 0755 -s mysql2dbf $(INSTALLDIR)
+	$(INSTALL) -d -m 0755 $(INSTALLDIR)
+	$(INSTALL) -m 0755 dbf2mysql $(INSTALLDIR)
+	$(INSTALL) -m 0755 mysql2dbf $(INSTALLDIR)
 
 clean:
 	$(RM) $(OBJS) dbf2mysql mysql2dbf
