Skip to content

Instantly share code, notes, and snippets.

@snaga
Created May 14, 2010 08:20
Show Gist options
  • Save snaga/400938 to your computer and use it in GitHub Desktop.
Save snaga/400938 to your computer and use it in GitHub Desktop.
# ----------------------------------------------------------------
# Makefile for building PostgreSQL
#
# Copyright(C) 2010 Satoshi Nagayasu <[email protected]>
# ----------------------------------------------------------------
PREFIX=/usr/local/pgsql90b1
POSTGRES=postgresql-9.0beta1
CONTRIBS=pgbench
all:
@echo "Type \`make build' or \`make install'".
build: build_postgres build_contrib
build_prepare: ${POSTGRES}.tar.bz2
if [ ! -f ${POSTGRES}/configure ]; then \
bzip2 -cd ${POSTGRES}.tar.bz2 | tar xf -; \
fi;
if [ ! -f ${POSTGRES}/src/Makefile.global ]; then \
pushd ${POSTGRES}; \
./configure --prefix=${PREFIX}; \
popd; \
fi;
build_postgres: build_prepare
pushd ${POSTGRES}; \
make; \
make check; \
popd;
build_contrib:
pushd ${POSTGRES}; \
for d in ${CONTRIBS}; \
do pushd contrib/$$d; make; popd; \
done; \
popd;
install: install_postgres install_contrib
install_postgres:
pushd ${POSTGRES}; \
make install; \
popd;
install_contrib:
pushd ${POSTGRES}; \
for d in ${CONTRIBS}; \
do pushd contrib/$$d; make install; popd; \
done; \
popd;
clean:
pushd ${POSTGRES}; \
make clean; \
popd;
distclean:
pushd ${POSTGRES}; \
make distclean; \
popd;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment