2016-03-16 22:40:40 +08:00
|
|
|
include ./Makefile.global
|
|
|
|
|
2016-03-09 02:35:02 +08:00
|
|
|
EXT_DIR = src/pg
|
|
|
|
PYP_DIR = src/py
|
2016-02-19 18:57:13 +08:00
|
|
|
|
|
|
|
.PHONY: install
|
|
|
|
.PHONY: run_tests
|
2016-03-16 01:48:46 +08:00
|
|
|
.PHONY: release
|
|
|
|
.PHONY: deploy
|
2016-02-19 18:57:13 +08:00
|
|
|
|
2016-03-16 01:48:46 +08:00
|
|
|
# Generate and install developmet versions of the extension
|
|
|
|
# and python package.
|
|
|
|
# The extension is named 'dev' with a 'current' alias for easily upgrading.
|
|
|
|
# Requires sudo.
|
2016-03-16 22:40:40 +08:00
|
|
|
install: ## Generate and install development version of the extension; requires sudo.
|
2016-02-19 18:57:13 +08:00
|
|
|
$(MAKE) -C $(PYP_DIR) install
|
|
|
|
$(MAKE) -C $(EXT_DIR) install
|
|
|
|
|
2016-03-16 01:48:46 +08:00
|
|
|
# Run the tests for the installed development extension and
|
|
|
|
# python package
|
2016-03-16 22:40:40 +08:00
|
|
|
test: ## Run the tests for the development version of the extension
|
2016-03-16 01:48:46 +08:00
|
|
|
$(MAKE) -C $(PYP_DIR) test
|
|
|
|
$(MAKE) -C $(EXT_DIR) test
|
|
|
|
|
|
|
|
# Generate a new release into release
|
2016-03-16 22:40:40 +08:00
|
|
|
release: ## Generate a new release of the extension. Only for telease manager
|
2016-03-16 01:48:46 +08:00
|
|
|
$(MAKE) -C $(EXT_DIR) release
|
2016-03-16 22:40:40 +08:00
|
|
|
$(MAKE) -C $(PYP_DIR) release
|
2016-03-16 01:48:46 +08:00
|
|
|
|
|
|
|
# Install the current release.
|
|
|
|
# Requires sudo.
|
2016-03-16 21:38:18 +08:00
|
|
|
# Use the RELEASE_VERSION environment variable to deploy a specific version:
|
|
|
|
# sudo make deploy RELEASE_VERSION=1.0.0
|
2016-03-16 22:40:40 +08:00
|
|
|
deploy: ## Deploy a released extension. Only for release manager. Requires sudo.
|
2016-03-16 01:48:46 +08:00
|
|
|
$(MAKE) -C $(EXT_DIR) deploy
|
2016-03-16 22:40:40 +08:00
|
|
|
$(MAKE) -C $(PYP_DIR) deploy
|
|
|
|
|
|
|
|
# Cleanup development extension script files
|
|
|
|
clean-dev: ## clean up development extension script files
|
|
|
|
rm -f src/pg/$(EXTENSION)--*.sql
|
|
|
|
|
2016-03-16 22:52:47 +08:00
|
|
|
# Cleanup all releases
|
2016-03-16 22:54:39 +08:00
|
|
|
clean-releases: ## clean up all releases
|
2016-03-16 22:52:47 +08:00
|
|
|
rm -rf release/python/*
|
|
|
|
rm -f release/$(EXTENSION)--*.sql
|
|
|
|
rm -f release/$(EXTENSION).control
|
2016-03-16 22:40:40 +08:00
|
|
|
|
|
|
|
# Cleanup current/specific version
|
|
|
|
clean-release: ## clean up current release
|
|
|
|
rm -rf release/python/$(RELEASE_VERSION)
|
|
|
|
rm -f release/$(RELEASE_VERSION)--*.sql
|
|
|
|
|
2016-06-15 00:27:35 +08:00
|
|
|
clean-all: clean-dev clean-release
|
2016-03-16 22:40:40 +08:00
|
|
|
|
|
|
|
help:
|
|
|
|
@IFS=$$'\n' ; \
|
|
|
|
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//'`); \
|
|
|
|
for help_line in $${help_lines[@]}; do \
|
|
|
|
IFS=$$'#' ; \
|
|
|
|
help_split=($$help_line) ; \
|
|
|
|
help_command=`echo $${help_split[0]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
|
|
|
|
help_info=`echo $${help_split[2]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
|
|
|
|
printf "%-30s %s\n" $$help_command $$help_info ; \
|
|
|
|
done
|