=================================================================== RCS file: /home/cvs/OpenXM/src/ox_ntl/Attic/Makefile,v retrieving revision 1.6 retrieving revision 1.9 diff -u -p -r1.6 -r1.9 --- OpenXM/src/ox_ntl/Attic/Makefile 2003/11/12 13:31:45 1.6 +++ OpenXM/src/ox_ntl/Attic/Makefile 2003/11/17 12:04:20 1.9 @@ -1,4 +1,4 @@ -# $OpenXM: OpenXM/src/ox_ntl/Makefile,v 1.5 2003/11/12 12:56:05 iwane Exp $ +# $OpenXM: OpenXM/src/ox_ntl/Makefile,v 1.8 2003/11/15 09:06:20 iwane Exp $ # # # @@ -16,9 +16,13 @@ CC =gcc RM =/bin/rm CP =/bin/cp -CFLAGS=-I$(PREFIX)/include +CFLAGS=-I$(PREFIX)/include -g CPPFLAGS=$(CFLAGS) +# WITH_GMP <== for ox_toolkit -- include "gmp.h" +# __GMP_FALE_H__ <== -- dont include "gmp_fake.h" +DEFS=-DWITH_GMP=1 -D__GMP_FAKE_H__ + PREFIX=$(OpenXM_HOME) MASTER_CITES=ftp.math.sci.kobe-u.ac.jp @@ -26,7 +30,7 @@ MASTER_CITES=ftp.math.sci.kobe-u.ac.jp NTL_LIBDIR=$(PREFIX)/lib/NTL LIBDIR=$(PREFIX)/lib -DISTDIR=$(PWD)/distfile +DISTDIR=${OpenXM_HOME}/../OpenXM_dist DISTFILEDIR=ntl-5.3.1 DISTFILE=ntl-5.3.1.tar.gz WORK=$(PWD)/work @@ -36,7 +40,7 @@ GMPOPT=NTL_GMP_LIP=on GMP_PREFIX=${OpenXM_HOME} GMP_IN .SUFFIXES: .cpp .o .c SRCC=oxserv.c oxstack.c -SRCP=main.cpp ntl.cpp ntlconv.cpp +SRCP=main.cpp ntl.cpp ntlconv.cpp cmon.cpp OBJC=$(SRCC:.c=.o) $(SRCP:.cpp=.o) @@ -45,31 +49,26 @@ all: $(PROG) $(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 ${LIBS} -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 +cmon.cpp: ntl.h + ntl.cpp: ntl.h +ntlconv.cpp: ntl.h + .cpp.o: - $(CPP) $(CPPFLAGS) -c $< -o $@ + $(CPP) $(CPPFLAGS) $(DEFS) -c $< -o $@ .c.o: - $(CC) $(CFLAGS) -c $< -o $@ + $(CC) $(CFLAGS) $(DEFS) -c $< -o $@ install: all $(CP) $(PROG) $(PREFIX)/bin @@ -77,25 +76,25 @@ install: all clean: -$(RM) -f $(OBJC) $(PROG) ox_ntl_debug oxserv_debug -$(RM) -fr ${WORK} - @-$(RM) -f .*-ntl-done +distclean: + -$(RM) -f .*-ntl-done -pre-fetch-ntl: - @if [ ! -f .pre-fetch-ntl-done ]; then\ - mkdir -p ${DISTDIR} ${WORK}; \ - touch .pre-fetch-ntl-done; \ - fi -fetch-ntl: pre-fetch-ntl +fetch-ntl: @if [ ! -f .fetch-ntl-done ]; then \ - if [ ! -f ${DISTDIR}/${DISTFILE} ]; then \ - (cd ${DISTDIR}; wget --no-directories --passive-ftp ftp://$(MASTER_CITES)/pub/OpenXM/misc/1.2.2/$(DISTFILE)) ; \ - fi ; \ - (cd ${WORK}; tar xvzf ${DISTDIR}/${DISTFILE}); \ + ${OpenXM_HOME}/bin/oxfetch.sh ftp://${MASTER_CITES}/pub/OpenXM/misc/1.2.2/${DISTFILE} ${DISTDIR}; \ touch .fetch-ntl-done; \ fi -patch-ntl: fetch-ntl +extract-ntl: fetch-ntl + -mkdir ${WORK} + @if [ ! -f .extract-ntl-done ]; then \ + (cd ${WORK}; tar xvzf ${DISTDIR}/${DISTFILE}); \ + touch .extract-ntl-done; \ + fi + +patch-ntl: extract-ntl @if [ ! -f .patch-ntl-done ]; then \ touch .patch-ntl-done; \ fi @@ -106,7 +105,8 @@ build-ntl: patch-ntl (cd ${WORK}/${DISTFILEDIR}/src; \ LD_LIBRARY_PATH=${OpenXM_HOME}/lib; \ export LD_LIBRARY_PATH; \ - ./configure LIBDIR=${NTL_LIBDIR} PREFIX=${PREFIX} ${GMPOPT}; make); \ + ./configure LIBDIR=${NTL_LIBDIR} PREFIX=${PREFIX} ${GMPOPT}; \ + make); \ touch .build-ntl-done; \ fi @@ -115,4 +115,14 @@ install-ntl: build-ntl (cd ${WORK}/${DISTFILEDIR}/src; make install); \ touch .install-ntl-done; \ fi + +######################################### +# DEBUG +######################################### +ox_ntl_debug: ntl.cpp ntl.h ntlconv.cpp oxserv.h + $(CPP) $(CPPFLAGS) -g -D__NTL_DEBUG=1 -L/usr/local/lib -L$(LIBDIR) -L$(NTL_LIBDIR) $(DEFS) ntl.cpp ntlconv.o cmon.o oxserv.o oxstack.o -o $@ -lntl -lgmp -lox -lgc + +oxserv_debug: oxserv.h oxserv.c + $(CC) $(CFLAGS) -g -D__OXSERV_DEBUG=1 -L$(LIBDIR) $(DEFS) oxserv.c oxstack.o -o $@ -lgmp -lox -lgc +