=================================================================== RCS file: /home/cvs/OpenXM/src/pari/Makefile,v retrieving revision 1.11 retrieving revision 1.29 diff -u -p -r1.11 -r1.29 --- OpenXM/src/pari/Makefile 2000/08/31 06:28:21 1.11 +++ OpenXM/src/pari/Makefile 2021/03/25 03:40:23 1.29 @@ -1,47 +1,85 @@ -# $OpenXM: OpenXM/src/pari/Makefile,v 1.10 2000/02/27 07:26:21 takayama Exp $ +# $OpenXM: OpenXM/src/pari/Makefile,v 1.28 2021/03/25 03:02:40 ohara Exp $ -PARI = ../../../OpenXM_contrib/pari -OpenXM_ROOT = ../../../OpenXM +OpenXM_HOME=../.. +PREFIX=${OpenXM_HOME} +DISTDIR=${OpenXM_HOME}/../OpenXM_dist +RM = /bin/rm +RANLIB=ranlib +#PARI=pari-2.11.4 +PARI=pari-2.13.1 +PATCH_FILE=${PARI}.diff +MASTER_SITE=http://www.math.kobe-u.ac.jp/pub/OpenXM/misc/ +DIST_SUFFIX=.tar.gz +DISTFILES=${PARI}${DIST_SUFFIX} +GALFILES=galdata.tgz galpol.tgz -all: configure - @if [ ! -f ./.make_done ]; then \ - (cd $(PARI) ; make all) \ - fi - @touch ./.make_done +all: build -install: install-lib-bin +fetch: + -mkdir work + @if [ ! -f work/.fetch_done ]; then \ + for i in ${DISTFILES} ${GALFILES}; do \ + ${OpenXM_HOME}/bin/oxfetch.sh ${MASTER_SITE}"$$i" ${DISTDIR}; \ + done; \ + fi + @touch work/.fetch_done -install-lib-bin: all install-lib - (cd $(PARI)/O*-* ; make install-lib-dyn) - (cd $(PARI)/O*-* ; make install-include) - (cd $(PARI)/O*-* ; make install-bin) - (cd $(PARI)/O*-* ; make install-misc) - (cd $(PARI)/O*-* ; make install-man) - (cd $(PARI)/O*-* ; make install-data) +extract: fetch + @if [ ! -f work/.extract_done ]; then \ + cat ${DISTDIR}/${DISTFILES} | (cd work ; tar xzvf -) ; \ + for i in ${GALFILES}; do \ + cat ${DISTDIR}/"$$i" | (cd work/${PARI} ; tar xzvf -) ; \ + done; \ + fi + @touch work/.extract_done -install-doc: all - (cd $(PARI) ; make doc) - @if [ ! -d $(OpenXM_ROOT)/doc/pari ]; then \ - mkdir $(OpenXM_ROOT)/doc/pari ;\ +patch: extract + @if [ ! -f work/.patch_done ]; then \ + if [ -f "${PATCH_FILE}" ]; then \ + cat ${PATCH_FILE} | (cd work/${PARI} ; patch -p1 ) ; \ + fi \ + fi + @touch work/.patch_done + +configure: patch + @if [ ! -f work/.configure_done ]; then \ + prefix=`cd ${OpenXM_HOME}; pwd` ; \ + (cd work/${PARI} ; ./Configure --prefix="$$prefix" ) ; \ fi - -cp $(OpenXM_ROOT)/lib/pari/users.dvi $(OpenXM_ROOT)/doc/pari/users.dvi - -cp $(OpenXM_ROOT)/lib/pari/tutorial.dvi $(OpenXM_ROOT)/doc/pari/tutorial.dvi + @touch work/.configure_done -clean: - @if [ -f ./.make_done ]; then \ - (cd $(PARI) ; make clean) \ +build: configure + @if [ ! -f work/.build_done ]; then \ + d=`cd work/${PARI} ; config/objdir` ; \ + (cd work/${PARI}/$$d ; ${MAKE} lib-sta; ${MAKE} gp) ; \ fi - @rm -f ./.make_done ./.configure_done + @touch work/.build_done -distclean: - @cat BINARIES | xargs -t rm -rf +build-doc: configure + @if [ ! -f work/.build_doc_done ]; then \ + (cd work/${PARI} ; ${MAKE} doc) ; \ + fi + @touch work/.build_doc_done -configure: - @if [ ! -f ./.configure_done ]; then \ - (cd $(PARI) ; ./Configure --prefix=../../../OpenXM) \ +install: build + -mkdir ${PREFIX}/bin ${PREFIX}/lib + @if [ ! -f work/.install_done ]; then \ + d=`cd work/${PARI} ; config/objdir` ; \ + (cd work/${PARI}/$$d ; ${MAKE} install-lib-sta install-include install-lib-dyn install-data) ; \ + ${RANLIB} ${PREFIX}/lib/libpari.a ; \ fi - @touch ./.configure_done + @touch work/.install_done -install-lib: all - (cd $(PARI) ; make install-lib-sta) - ranlib ../../lib/libpari.a +install-doc: build-doc + -mkdir ${PREFIX}/doc/pari + @if [ ! -f work/.install_doc_done ]; then \ + for i in users.dvi tutorial.dvi; do \ + cp work/${PARI}/doc/$$i ${PREDIX}/doc/pari ; \ + done ; \ + fi + @touch work/.install_doc_done + +clean: + -${RM} -rf work + +distclean: clean