Skip to content

Commit

Permalink
Updated Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
bsloane1650 committed Jul 15, 2013
1 parent 8a10e85 commit ce809ab
Showing 1 changed file with 4 additions and 62 deletions.
66 changes: 4 additions & 62 deletions Makefile
Expand Up @@ -7,22 +7,7 @@ export CONFIG_FILE=${CURDIR}/${CONFIG}
setup1=$(shell mkdir -p /tmp/build-charm)
dest_build=/tmp/build-charm

# gmp source
gmp_version=gmp-5.0.2
gmp_url=http://ftp.gnu.org/gnu/gmp/${gmp_version}.tar.gz
gmp_options=CC="${CC}" CPP="${CPP}" LDFLAGS="${LDFLAGS}" CPPFLAGS="${CPPFLAGS}" ${OSFLAGS}

# pbc source
pbc_version=pbc-0.5.13
pbc_url=http://crypto.stanford.edu/pbc/files/${pbc_version}.tar.gz
pbc_options=CC="${CC}" CPP="${CPP}" LDFLAGS="${LDFLAGS}" CPPFLAGS="${CPPFLAGS}" ${OSFLAGS}
DESTDIR=${prefix}



help:
@echo "make deps - Build the charm dependencies."
@echo "make build - Build the charm framework and install dependencies."
@echo "make source - Create source package."
@echo "make install - Install on local system."
@echo "make clean - Get rid of scratch and byte files."
Expand All @@ -37,54 +22,8 @@ setup:
${setup1}
set +x

.PHONY: build-gmp
build-gmp:
@echo "Building the GMP library"
set -x
if test "${HAVE_LIBGMP}" = "yes" ; then \
echo "GMP installed already."; \
elif [ ! -f ${gmp_version}.tar.gz ]; then \
${wget} ${gmp_url}; \
tar -zxf ${gmp_version}.tar.gz -C ${dest_build}; \
cd ${dest_build}/${gmp_version}; ./configure ${gmp_options} --prefix=${DESTDIR}; \
${MAKE} install; \
echo "GMP install: OK"; \
else \
tar -zxf ${gmp_version}.tar.gz -C ${dest_build}; \
cd ${dest_build}/${gmp_version}; ./configure ${gmp_options} --prefix=${DESTDIR}; \
${MAKE} install; \
echo "GMP install: OK"; \
fi
set +x
sed "s/HAVE_LIBGMP=no/HAVE_LIBGMP=yes/g" ${CONFIG} > ${CONFIG}.new; mv ${CONFIG}.new ${CONFIG}

.PHONY: build-pbc
build-pbc:
@echo "Building the PBC library"
set -x
if test "${HAVE_LIBPBC}" = "yes" ; then \
echo "PBC installed already."; \
elif [ ! -f ${pbc_version}.tar.gz ]; then \
${wget} ${pbc_url}; \
tar -zxf ${pbc_version}.tar.gz -C ${dest_build}; \
cd ${dest_build}/${pbc_version}; ./configure ${pbc_options} --prefix=${DESTDIR}; \
${MAKE} install; \
echo "PBC install: OK"; \
else \
tar -zxf ${pbc_version}.tar.gz -C ${dest_build}; \
cd ${dest_build}/${pbc_version}; ./configure ${pbc_options} --prefix=${DESTDIR}; \
${MAKE} install; \
echo "PBC install: OK"; \
fi
set +x
sed "s/HAVE_LIBPBC=no/HAVE_LIBPBC=yes/g" ${CONFIG} > ${CONFIG}.new; mv ${CONFIG}.new ${CONFIG}

.PHONY: deps
deps: build-gmp build-pbc
@echo "Dependencies build complete."

.PHONY: all
all: setup build-gmp build-pbc
all: setup
@echo "Building the Charm Framework"
${PYTHON} setup.py build ${PYTHONFLAGS} ${PYTHONBUILDEXT}
@echo "Complete"
Expand Down Expand Up @@ -147,5 +86,8 @@ clean:
rm -rf build/ dist/ ${dest_build} MANIFEST
rm ${CONFIG}
find . -name '*.pyc' -delete
find . -name '*.so' -delete
find . -name '*.o' -delete
find . -name '*.dll' -delete


0 comments on commit ce809ab

Please sign in to comment.