version 1.1, 2003/11/03 03:11:21 |
version 1.7, 2003/11/14 03:20:07 |
|
|
# $OpenXM$ |
# $OpenXM: OpenXM/src/ox_ntl/Makefile,v 1.6 2003/11/12 13:31:45 iwane Exp $ |
# |
# |
# |
# |
# |
# |
|
|
|
|
PROG=ox_ntl |
PROG=ox_ntl |
|
|
|
OpenXM_HOME=${PWD}/../.. |
|
|
CPP=g++ |
CPP=g++ |
CC =gcc |
CC =gcc |
|
|
RM =/bin/rm |
RM =/bin/rm |
CP =/bin/cp |
CP =/bin/cp |
|
|
CFLAGS=-I$(PREFIX)/include |
CFLAGS=-I$(PREFIX)/include |
CPPFLAGS=$(CFLAGS) |
CPPFLAGS=$(CFLAGS) |
|
|
PREFIX=$(OpenXM_HOME) |
PREFIX=$(OpenXM_HOME) |
Line 24 MASTER_CITES=ftp.math.sci.kobe-u.ac.jp |
|
Line 26 MASTER_CITES=ftp.math.sci.kobe-u.ac.jp |
|
NTL_LIBDIR=$(PREFIX)/lib/NTL |
NTL_LIBDIR=$(PREFIX)/lib/NTL |
LIBDIR=$(PREFIX)/lib |
LIBDIR=$(PREFIX)/lib |
|
|
DISTDIR=$(PWD)/distfile |
DISTDIR=${OpenXM_HOME}/../OpenXM_dist |
DISTFILEDIR=ntl-5.3.1 |
DISTFILEDIR=ntl-5.3.1 |
DISTFILE=ntl-5.3.1.tar.gz |
DISTFILE=ntl-5.3.1.tar.gz |
WORK=$(PWD)/work |
WORK=$(PWD)/work |
|
|
|
GMPOPT=NTL_GMP_LIP=on GMP_PREFIX=${OpenXM_HOME} GMP_INCDIR=${OpenXM_HOME}/include GMP_LIBDIR=${OpenXM_HOME}/lib |
|
|
.SUFFIXES: .cpp .o .c |
.SUFFIXES: .cpp .o .c |
|
|
SRCC=oxserv.c |
SRCC=oxserv.c oxstack.c |
SRCP=main.cpp ntl.cpp |
SRCP=main.cpp ntl.cpp ntlconv.cpp |
|
|
OBJC=$(SRCC:.c=.o) $(SRCP:.cpp=.o) |
OBJC=$(SRCC:.c=.o) $(SRCP:.cpp=.o) |
|
|
|
|
$(PROG): $(OBJC) $(LIBDIR)/libox.a $(NTL_LIBDIR)/libntl.a |
$(PROG): $(OBJC) $(LIBDIR)/libox.a $(NTL_LIBDIR)/libntl.a |
$(CPP) $(CPPFLAGS) -L$(LIBDIR) -L$(NTL_LIBDIR) $(OBJC) -o $@ -lntl -lgmp -lox -lgc |
$(CPP) $(CPPFLAGS) -L$(LIBDIR) -L$(NTL_LIBDIR) $(OBJC) -o $@ -lntl -lgmp -lox -lgc |
|
|
oxserv.c: oxserv.h |
|
|
|
main.cpp: oxserv.h ntl.h |
ox_ntl_debug: ntl.cpp ntl.h oxstack.o |
|
$(CPP) $(CPPFLAGS) -g -D__NTL_DEBUG=1 -L/usr/local/lib -L$(LIBDIR) -L$(NTL_LIBDIR) ntl.cpp ntlconv.o oxstack.o -o $@ -lntl -lgmp -lox -lgc |
|
|
|
oxserv_debug: oxserv.h oxserv.c |
|
$(CC) $(CFLAGS) -g -D__OXSERV_DEBUG=1 -L$(LIBDIR) oxserv.c oxstack.o -o $@ -lox -lgc |
|
|
|
cpp.exe: cpp.cpp |
|
$(CPP) $(CPPFLAGS) -g -L/usr/local/lib -L$(LIBDIR) -L$(NTL_LIBDIR) cpp.cpp -o $@ -lntl -lgmp -lox -lgc |
|
|
|
oxserv.c: oxserv.h oxstack.h |
|
|
|
oxstack.c: oxstack.h |
|
|
|
main.cpp: oxserv.h ntl.h oxstack.h |
|
|
ntl.cpp: ntl.h |
ntl.cpp: ntl.h |
|
|
.cpp.o: |
.cpp.o: |
|
|
$(CP) $(PROG) $(PREFIX)/bin |
$(CP) $(PROG) $(PREFIX)/bin |
|
|
clean: |
clean: |
-$(RM) -f $(OBJC) $(PROG) |
-$(RM) -f $(OBJC) $(PROG) ox_ntl_debug oxserv_debug |
-$(RM) -fr ${WORK} |
-$(RM) -fr ${WORK} |
-$(RM) -f .*-ntl-done |
@-$(RM) -f .*-ntl-done |
|
|
|
|
pre-fetch-ntl: |
fetch-ntl: |
@if [ ! -f .pre-fetch-ntl-done ]; then\ |
@if [ ! -f .fetch-ntl-done ]; then \ |
mkdir -p ${DISTDIR} ${WORK}; \ |
${OpenXM_HOME}/bin/oxfetch.sh ftp://${MASTER_CITES}/pub/OpenXM/misc/1.2.2/${DISTFILE} ${DISTDIR}; \ |
touch .pre-fetch-ntl-done; \ |
touch .fetch-ntl-done; \ |
fi |
fi |
|
|
fetch-ntl: pre-fetch-ntl |
extract-ntl: fetch-ntl |
@if [ ! -f .fetch-ntl-done ]; then \ |
-mkdir work |
(cd ${DISTDIR}; wget --passive-ftp ftp://$(MASTER_CITES)/pub/OpenXM/misc/1.2.2/$(DISTFILE)); \ |
@if [ ! -f .extract-ntl-done ]; then \ |
(cd ${WORK}; tar xvzf ${DISTDIR}/${DISTFILE}); \ |
(cd ${WORK}; tar xvzf ${DISTDIR}/${DISTFILE}); \ |
touch .fetch-ntl-done; \ |
touch .extract-ntl-done; \ |
fi |
fi |
|
|
patch-ntl: fetch-ntl |
patch-ntl: extract-ntl |
@if [ ! -f .patch-ntl-done ]; then \ |
@if [ ! -f .patch-ntl-done ]; then \ |
touch .patch-ntl-done; \ |
touch .patch-ntl-done; \ |
fi |
fi |
|
|
|
|
|
|
build-ntl: patch-ntl |
build-ntl: patch-ntl |
@if [ ! -f .build-ntl-done ]; then \ |
@if [ ! -f .build-ntl-done ]; then \ |
(cd ${WORK}/${DISTFILEDIR}/src; ./configure LIBDIR=${NTL_LIBDIR} PREFIX=${PREFIX}; make); \ |
(cd ${WORK}/${DISTFILEDIR}/src; \ |
|
LD_LIBRARY_PATH=${OpenXM_HOME}/lib; \ |
|
export LD_LIBRARY_PATH; \ |
|
./configure LIBDIR=${NTL_LIBDIR} PREFIX=${PREFIX} ${GMPOPT}; make); \ |
touch .build-ntl-done; \ |
touch .build-ntl-done; \ |
fi |
fi |
|
|