--- a/Makefile
+++ b/Makefile
@@ -3,8 +3,8 @@
 # note this must match version macros in pg_filedump.h
 FD_VERSION=9.6.0
 
-CC=gcc
-CFLAGS=-g -O -Wall -Wmissing-prototypes -Wmissing-declarations
+#CC=gcc
+#CFLAGS=-g -O -Wall -Wmissing-prototypes -Wmissing-declarations
 
 # If working with a PG source directory, point PGSQL_INCLUDE_DIR to its
 # src/include subdirectory.  If working with an installed tree, point to
@@ -12,7 +12,7 @@ CFLAGS=-g -O -Wall -Wmissing-prototypes
 PG_CONFIG=pg_config
 PGSQL_INCLUDE_DIR=$(shell $(PG_CONFIG) --includedir-server)
 PGSQL_LIB_DIR=$(shell $(PG_CONFIG) --libdir)
-
+PGSQL_BIN_DIR=$(shell $(PG_CONFIG) --bindir)
 
 DISTFILES= README.pg_filedump Makefile Makefile.contrib \
 	pg_filedump.h pg_filedump.c
@@ -25,6 +25,10 @@ pg_filedump: pg_filedump.o
 pg_filedump.o: pg_filedump.c
 	${CC} ${CFLAGS} -I${PGSQL_INCLUDE_DIR} pg_filedump.c -c
 
+install: pg_filedump
+	mkdir -p $(DESTDIR)$(PGSQL_BIN_DIR)
+	install pg_filedump $(DESTDIR)$(PGSQL_BIN_DIR)
+
 dist:
 	rm -rf pg_filedump-${FD_VERSION} pg_filedump-${FD_VERSION}.tar.gz
 	mkdir pg_filedump-${FD_VERSION}
