From 3f70a0292758d242970a6db933f8e57c29c234c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Villemain?= Date: Tue, 6 Dec 2011 22:41:33 +0100 Subject: [PATCH] Add regression files to VPATH build sql/ and expected/ contents are copied to VPATH build (should help debian installcheck) --- ChangeLog | 1 + Makefile | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7f59a8e..df67632 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ - Add checks (make installcheck) - Improve .gitignore - Add a debian/watch file tracking pgfoundry release + - Add regression files to VPATH build 09/07/2011 Cédric Villemain * 1.1.0 - Fix Makefile and remove the dir sql/ (useless and error prone) diff --git a/Makefile b/Makefile index 2ac767a..97188ea 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ BUILD_EXTENSION = $(shell $(PG_CONFIG) --version | grep -qE "8\.|9\.0" && echo n # Default (no Extension support) DATA = $(EXTENSION).sql uninstall_$(EXTENSION).sql REGRESS = $(EXTENSION) -pgf_files := $(DOCS) $(DATA) +pgext_files := $(DOCS) $(DATA) # we need to build with Extension support: ifeq ($(BUILD_EXTENSION),yes) @@ -32,14 +32,22 @@ $(EXTENSION).control: $(EXTENSION).control.in DATA = $(EXTENSION)--unpackaged--$(EXTVERSION).sql $(EXTENSION)--$(EXTVERSION).sql REGRESS = $(EXTENSION).ext EXTRA_CLEAN = $(DATA) $(EXTENSION).control -pgf_files := $(DOCS) +pgext_files := $(DOCS) endif # Workaround for lack of good VPATH support in pgxs for extension/contrib ifdef VPATH -pgf_files_build:= $(addprefix $(CURDIR)/, $(pgf_files)) -all: $(pgf_files_build) -$(pgf_files_build): $(CURDIR)/%: $(VPATH)/% +pgext_files_build:= $(addprefix $(CURDIR)/, $(pgext_files)) +pgext_reg_files:= $(addprefix $(CURDIR)/sql/, $(shell ls $(VPATH)/sql)) +pgext_reg_exp:= $(addprefix $(CURDIR)/expected/, $(shell ls $(VPATH)/expected)) +all: $(pgext_files_build) $(pgext_reg_files) $(pgext_reg_exp) +$(pgext_files_build): $(CURDIR)/%: $(VPATH)/% + cp $< $@ +$(pgext_reg_files): $(CURDIR)/sql/%: $(VPATH)/sql/% + mkdir -p $(dir $(pgext_reg_files)) + cp $< $@ +$(pgext_reg_exp): $(CURDIR)/expected/%: $(VPATH)/expected/% + mkdir -p $(dir $(pgext_reg_exp)) cp $< $@ endif # VPATH -- 2.39.5