| 
									
										
										
										
											2011-01-18 01:33:27 +00:00
										 |  |  | # View README.pg_filedump first
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-12 16:08:33 +00:00
										 |  |  | # note this must match version macros in pg_filedump.h
 | 
					
						
							| 
									
										
										
										
											2017-10-22 19:46:04 +02:00
										 |  |  | FD_VERSION=10.0 | 
					
						
							| 
									
										
										
										
											2011-11-26 22:14:08 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-12 16:08:33 +00:00
										 |  |  | # If working with a PG source directory, point PGSQL_INCLUDE_DIR to its
 | 
					
						
							|  |  |  | # src/include subdirectory.  If working with an installed tree, point to
 | 
					
						
							|  |  |  | # the server include subdirectory, eg /usr/local/include/postgresql/server
 | 
					
						
							| 
									
										
										
										
											2016-02-02 18:55:04 +01:00
										 |  |  | PG_CONFIG=pg_config | 
					
						
							| 
									
										
										
										
											2016-10-14 11:23:57 +02:00
										 |  |  | PGSQL_CFLAGS=$(shell $(PG_CONFIG) --cflags) | 
					
						
							| 
									
										
										
										
											2016-02-02 18:55:04 +01:00
										 |  |  | PGSQL_INCLUDE_DIR=$(shell $(PG_CONFIG) --includedir-server) | 
					
						
							| 
									
										
										
										
											2016-10-14 11:23:57 +02:00
										 |  |  | PGSQL_LDFLAGS=$(shell $(PG_CONFIG) --ldflags) | 
					
						
							| 
									
										
										
										
											2016-03-24 18:57:55 +01:00
										 |  |  | PGSQL_LIB_DIR=$(shell $(PG_CONFIG) --libdir) | 
					
						
							| 
									
										
										
										
											2016-10-14 11:23:57 +02:00
										 |  |  | PGSQL_BIN_DIR=$(shell $(PG_CONFIG) --bindir) | 
					
						
							| 
									
										
										
										
											2011-01-18 01:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-26 22:14:08 +00:00
										 |  |  | DISTFILES= README.pg_filedump Makefile Makefile.contrib \
 | 
					
						
							| 
									
										
										
										
											2017-01-17 16:01:12 +03:00
										 |  |  | 	pg_filedump.h pg_filedump.c decode.h decode.c stringinfo.c pg_lzcompress.c | 
					
						
							| 
									
										
										
										
											2011-11-26 22:14:08 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-18 01:33:27 +00:00
										 |  |  | all: pg_filedump | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-17 16:01:12 +03:00
										 |  |  | pg_filedump: pg_filedump.o decode.o stringinfo.o pg_lzcompress.o | 
					
						
							|  |  |  | 	${CC} ${PGSQL_LDFLAGS} ${LDFLAGS} -o pg_filedump pg_filedump.o decode.o stringinfo.o pg_lzcompress.o -L${PGSQL_LIB_DIR} -lpgport | 
					
						
							| 
									
										
										
										
											2011-01-18 01:33:27 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | pg_filedump.o: pg_filedump.c | 
					
						
							| 
									
										
										
										
											2016-10-14 11:23:57 +02:00
										 |  |  | 	${CC} ${PGSQL_CFLAGS} ${CFLAGS} -I${PGSQL_INCLUDE_DIR} pg_filedump.c -c | 
					
						
							| 
									
										
										
										
											2011-01-18 01:33:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-17 16:01:12 +03:00
										 |  |  | decode.o: decode.c | 
					
						
							|  |  |  | 	${CC} ${PGSQL_CFLAGS} ${CFLAGS} -I${PGSQL_INCLUDE_DIR} decode.c -c | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | stringinfo.o: stringinfo.c | 
					
						
							|  |  |  | 	${CC} ${PGSQL_CFLAGS} ${CFLAGS} -I${PGSQL_INCLUDE_DIR} stringinfo.c -c | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | pg_lzcompress.o: pg_lzcompress.c | 
					
						
							|  |  |  | 	${CC} ${PGSQL_CFLAGS} ${CFLAGS} -I${PGSQL_INCLUDE_DIR} pg_lzcompress.c -c | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-26 22:14:08 +00:00
										 |  |  | dist: | 
					
						
							|  |  |  | 	rm -rf pg_filedump-${FD_VERSION} pg_filedump-${FD_VERSION}.tar.gz | 
					
						
							|  |  |  | 	mkdir pg_filedump-${FD_VERSION} | 
					
						
							|  |  |  | 	cp -p ${DISTFILES} pg_filedump-${FD_VERSION} | 
					
						
							|  |  |  | 	tar cfz pg_filedump-${FD_VERSION}.tar.gz pg_filedump-${FD_VERSION} | 
					
						
							|  |  |  | 	rm -rf pg_filedump-${FD_VERSION} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-14 11:23:57 +02:00
										 |  |  | install: pg_filedump | 
					
						
							|  |  |  | 	mkdir -p $(DESTDIR)$(PGSQL_BIN_DIR) | 
					
						
							|  |  |  | 	install pg_filedump $(DESTDIR)$(PGSQL_BIN_DIR) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-18 01:33:27 +00:00
										 |  |  | clean: | 
					
						
							| 
									
										
										
										
											2011-01-18 02:28:26 +00:00
										 |  |  | 	rm -f *.o pg_filedump |