summaryrefslogtreecommitdiff
path: root/postgresql_autodoc/Makefile
diff options
context:
space:
mode:
authorguest <guest@f059d3a0-6783-47b7-97ff-1fe0bbf25129>2008-09-23 21:29:27 +0000
committerguest <guest@f059d3a0-6783-47b7-97ff-1fe0bbf25129>2008-09-23 21:29:27 +0000
commitd6fa96b4cd67cf4fa18b5b9b6739f9bc2494a9f4 (patch)
tree00aa9a27acb6b4c8d9868795a5295e9231f1eb20 /postgresql_autodoc/Makefile
initial import
git-svn-id: http://manut.eu/svn/yalp/trunk@1 f059d3a0-6783-47b7-97ff-1fe0bbf25129
Diffstat (limited to 'postgresql_autodoc/Makefile')
-rw-r--r--postgresql_autodoc/Makefile103
1 files changed, 103 insertions, 0 deletions
diff --git a/postgresql_autodoc/Makefile b/postgresql_autodoc/Makefile
new file mode 100644
index 0000000..fdddc1a
--- /dev/null
+++ b/postgresql_autodoc/Makefile
@@ -0,0 +1,103 @@
+# $Header: /cvsroot/autodoc/autodoc/Makefile,v 1.3 2006/05/16 18:57:24 rbt Exp $
+
+TEMPLATES = dia.tmpl dot.tmpl html.tmpl neato.tmpl xml.tmpl zigzag.dia.tmpl
+BINARY = postgresql_autodoc
+CONFIGFILE = config.mk
+
+RELEASE_FILES = Makefile config.mk.in configure \
+ configure.ac $(TEMPLATES) install-sh \
+ postgresql_autodoc.pl
+
+cur-dir := $(shell basename ${PWD})
+REAL_RELEASE_FILES = $(addprefix $(cur-dir)/,$(RELEASE_FILES))
+
+# Global dependencies
+ALWAYS_DEPEND = Makefile configure $(CONFIGFILE)
+
+
+####
+# Test to see if $(CONFIGFILE) has been generated. If so, include it. Otherwise we assume
+# it will be created for us.
+has_configmk := $(wildcard $(CONFIGFILE))
+
+ifeq ($(has_configmk),$(CONFIGFILE))
+include $(CONFIGFILE)
+endif
+
+####
+# ALL
+.PHONY: all
+all: $(ALWAYS_DEPEND) $(BINARY)
+
+####
+# Replace the /usr/bin/env perl with the supplied path
+# chmod to make testing easier
+$(BINARY): postgresql_autodoc.pl $(CONFIGFILE)
+ $(SED) -e "s,/usr/bin/env perl,$(PERL)," \
+ -e "s,@@TEMPLATE-DIR@@,$(datadir)," \
+ postgresql_autodoc.pl > $(BINARY)
+ -chmod +x $(BINARY)
+
+####
+# INSTALL Target
+.PHONY: install uninstall
+install: all $(ALWAYS_DEPEND)
+ $(INSTALL_SCRIPT) -d $(bindir)
+ $(INSTALL_SCRIPT) -d $(datadir)
+ $(INSTALL_SCRIPT) -m 755 $(BINARY) $(bindir)
+ for entry in $(TEMPLATES) ; \
+ do $(INSTALL_SCRIPT) -m 644 $${entry} $(datadir) ; \
+ done
+
+uninstall:
+ -$(RM) $(bindir)/$(BINARY)
+ for entry in $(TEMPLATES) ; \
+ do $(RM) $(datadir)/$${entry} ; \
+ done
+ -rmdir $(datadir)
+ -rmdir $(bindir)
+
+####
+# CLEAN / DISTRIBUTION-CLEAN / MAINTAINER-CLEAN Targets
+.PHONY: clean
+clean: $(ALWAYS_DEPEND)
+ $(RM) $(BINARY)
+
+.PHONY: distribution-clean distclean
+distribution-clean distclean: clean
+ $(RM) $(CONFIGFILE) config.log config.status
+ $(RM) -r autom4te.cache
+ $(RM) $(patsubst %.tmpl,*.%,$(wildcard *.tmpl))
+
+.PHONY: maintainer-clean
+maintainer-clean: distribution-clean
+ $(RM) configure
+
+####
+# Build a release
+#
+# Clean
+# Ensure configure is up to date
+# Commit any pending elements
+# Tar up the results
+.PHONY: release
+release: distribution-clean configure $(RELEASE_FILES)
+ @if [ -z ${VERSION} ] ; then \
+ echo "-------------------------------------------"; \
+ echo "VERSION needs to be specified for a release"; \
+ echo "-------------------------------------------"; \
+ false; \
+ fi
+ cvs2cl
+ -cvs commit
+ cd ../ && tar -czvf postgresql_autodoc-${VERSION}.tar.gz $(REAL_RELEASE_FILES)
+
+####
+# Build and Run configure files when configure or a template is updated.
+configure: configure.ac
+ autoconf
+
+# Fix my makefile, then execute myself
+$(CONFIGFILE) : config.mk.in configure
+ ./configure
+ $(MAKE) $(MAKEFLAGS)