version 1.2, 2004/07/04 02:31:51 |
version 1.6, 2013/10/18 01:28:52 |
|
|
# $OpenXM: OpenXM/src/ox_ntl/Makefile.in,v 1.1 2003/11/27 14:24:32 iwane Exp $ |
# $OpenXM: OpenXM/src/ox_ntl/Makefile.in,v 1.5 2008/09/19 10:55:40 iwane Exp $ |
# @configure_input@ ### |
# @configure_input@ ### |
|
|
|
# |
|
# build and install NTL |
|
# % make install-ntl |
|
# |
|
# build ox_ntl |
|
# % make |
|
# |
|
|
PROG=ox_ntl |
PROG=ox_ntl |
|
|
|
PROGL=oxsv |
|
PROGL2=liboxsv.so |
|
|
OpenXM_HOME=$(PWD)/../.. |
OpenXM_HOME=$(PWD)/../.. |
PREFIX=$(OpenXM_HOME) |
PREFIX=$(OpenXM_HOME) |
|
|
CXX=@CXX@ |
CXX=@CXX@ |
CC =@CC@ |
CC =@CC@ |
|
|
|
#install_sh = @install_sh@ |
|
install_sh = $(OpenXM_HOME)/src/ox_toolkit/install-sh |
|
|
|
|
RM ?= /bin/rm |
RM ?= /bin/rm |
CP ?= /bin/cp |
CP ?= /bin/cp |
MAKE ?= make |
MAKE ?= make |
LINT ?= lint |
LINT ?= lint |
|
|
|
|
CFLAGS=@OPTFLAG@ @CFLAGS@ @CPPFLAGS@ |
CFLAGS=@OPTFLAG@ @CFLAGS@ @CPPFLAGS@ |
CXXFLAGS=@OPTFLAG@ @CXXFLAGS@ |
CXXFLAGS=@OPTFLAG@ @CXXFLAGS@ |
CPPFLAGS=-I$(PREFIX)/include |
CPPFLAGS=-I$(PREFIX)/include |
Line 29 MASTER_CITES=ftp.math.sci.kobe-u.ac.jp |
|
Line 43 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 |
|
|
LIBS=-L$(LIBDIR) -L$(NTL_LIBDIR) -lntl -lgmp -lox -lgc @LIBS@ |
LIBS=-lgmp -lox -lgc @LIBS@ |
LDFLAGS=@LDFLAGS@ |
LDFLAGS=@LDFLAGS@ -L$(LIBDIR) -L$(NTL_LIBDIR) -L. |
|
|
DISTDIR=$(OpenXM_HOME)/../OpenXM_dist |
DISTDIR=$(OpenXM_HOME)/../OpenXM_dist |
DISTFILEDIR=ntl-5.3.1 |
DISTFILEDIR=ntl-6.0.0 |
DISTFILE=ntl-5.3.1.tar.gz |
DISTFILE=ntl-6.0.0.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 |
GMPOPT=NTL_GMP_LIP=on GMP_PREFIX=$(OpenXM_HOME) GMP_INCDIR=$(OpenXM_HOME)/include GMP_LIBDIR=$(OpenXM_HOME)/lib |
|
|
|
|
# lint |
# lint |
LINT=lint |
LINT=lint |
LINTFLAGS=-I$(PREFIX)/include |
LINTFLAGS=-I$(PREFIX)/include |
|
|
|
|
.SUFFIXES: .cpp .o .c |
.SUFFIXES: .cpp .o .c |
|
|
SRCC=oxserv.c oxstack.c |
SRCC=oxserv.c oxstack.c |
SRCP=main.cpp ntl.cpp ntlconv.cpp cmon.cpp |
SRCP=main.cpp ntl.cpp ntlconv.cpp cmon.cpp |
|
|
OBJC=$(SRCC:.c=.o) $(SRCP:.cpp=.o) |
OBJCC=$(SRCC:.c=.o) |
|
OBJCP=$(SRCP:.cpp=.o) |
|
|
|
|
all: $(PROG) |
all: $(PROG) |
|
|
|
$(PROG): $(OBJCP) $(PROGL2) |
|
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJCP) -o $@ -lntl -l$(PROGL) $(LIBS) |
|
|
$(PROG): $(OBJC) $(LIBDIR)/libox.a $(NTL_LIBDIR)/libntl.a |
$(PROGL2): $(OBJCC) |
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJC) -o $@ $(LIBS) |
$(CC) -shared $(LDFLAGS) $(OBJCC) -o $@ $(LIBS) |
|
strip $(PROGL2) |
|
|
|
|
oxserv.c: oxserv.h oxstack.h |
oxserv.c: oxserv.h oxstack.h |
|
|
oxstack.c: oxstack.h |
oxstack.c: oxstack.h |
Line 80 ntlconv.cpp: ntl.h |
|
Line 94 ntlconv.cpp: ntl.h |
|
|
|
install: all |
install: all |
$(CP) $(PROG) $(PREFIX)/bin |
$(CP) $(PROG) $(PREFIX)/bin |
|
$(CP) $(PROGL2) $(PREFIX)/lib |
|
|
|
install_lib: $(PROGL2) |
|
$(CP) $(PROGL2) $(PREFIX)/lib |
|
|
clean: |
clean: |
-$(RM) -f $(OBJC) $(PROG) ox_ntl_debug oxserv_debug |
-$(RM) -f $(OBJC) $(OBJCC) $(OBJCP) |
|
-$(RM) -f $(PROG) $(PROGL2) ox_ntl_debug oxserv_debug |
-$(RM) -fr $(WORK) |
-$(RM) -fr $(WORK) |
@-$(RM) -f .*-ntl-done |
@-$(RM) -f .*-ntl-done |
|
|
|
|
|
|
fetch-ntl: |
fetch-ntl: |
@if [ ! -f .fetch-ntl-done ]; then \ |
@if [ ! -f .fetch-ntl-done ]; then \ |
$(OpenXM_HOME)/bin/oxfetch.sh ftp://$(MASTER_CITES)/pub/OpenXM/misc/1.2.2/$(DISTFILE) $(DISTDIR); \ |
curl -L -o $(DISTDIR)/$(DISTFILE) http://www.shoup.net/ntl/$(DISTFILE) && \ |
touch .fetch-ntl-done; \ |
touch .fetch-ntl-done; \ |
fi |
fi |
|
|
extract-ntl: fetch-ntl |
extract-ntl: fetch-ntl |
-@mkdir -p $(WORK) |
-@mkdir -p $(WORK) |
@if [ ! -f .extract-ntl-done ]; then \ |
@if [ ! -f .extract-ntl-done ]; then \ |
(cd $(WORK); tar xvzf $(DISTDIR)/$(DISTFILE)); \ |
(cd $(WORK); tar xvzf $(DISTDIR)/$(DISTFILE)) && \ |
touch .extract-ntl-done; \ |
touch .extract-ntl-done; \ |
fi |
fi |
|
|
Line 113 build-ntl: patch-ntl |
|
Line 132 build-ntl: patch-ntl |
|
(cd $(WORK)/$(DISTFILEDIR)/src; \ |
(cd $(WORK)/$(DISTFILEDIR)/src; \ |
export LD_LIBRARY_PATH=$(OpenXM_HOME)/lib; \ |
export LD_LIBRARY_PATH=$(OpenXM_HOME)/lib; \ |
./configure LIBDIR=$(NTL_LIBDIR) PREFIX=$(PREFIX) $(GMPOPT); \ |
./configure LIBDIR=$(NTL_LIBDIR) PREFIX=$(PREFIX) $(GMPOPT); \ |
$(MAKE)); \ |
$(MAKE)) && \ |
touch .build-ntl-done; \ |
touch .build-ntl-done; \ |
fi |
fi |
|
|
install-ntl: build-ntl |
install-ntl: build-ntl |
@if [ ! -f .install-ntl-done ]; then \ |
@if [ ! -f .install-ntl-done ]; then \ |
(cd $(WORK)/$(DISTFILEDIR)/src; $(MAKE) install); \ |
(cd $(WORK)/$(DISTFILEDIR)/src; $(MAKE) install) && \ |
touch .install-ntl-done; \ |
touch .install-ntl-done; \ |
fi |
fi |
|
|
######################################### |
######################################### |
# DEBUG |
# DEBUG |
######################################### |
######################################### |
ox_ntl_debug: ntl.cpp ntl.h ntlconv.cpp |
ox_ntl_debug: ntl.cpp ntl.h ntlconv.cpp cmon.o |
$(CXX) $(CXXFLAGS) -g -D__NTL_DEBUG=1 -L/usr/local/lib -L$(LIBDIR) -L$(NTL_LIBDIR) ntl.cpp ntlconv.o -o $@ -lntl -lgmp -lox -lgc |
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -g -D__NTL_DEBUG=1 $(LDFLAGS) cmon.o ntl.cpp ntlconv.cpp -o $@ -lntl -l$(PROGL) $(LIBS) |
|
|
oxserv_debug: oxserv.h oxserv.c |
oxserv_debug: oxserv.h oxserv.c |
$(CC) $(CFLAGS) $(CPPFLAGS) -g -D__OXSERV_DEBUG=1 -L$(LIBDIR) oxserv.c oxstack.o -o $@ -lox -lgc |
$(CC) $(CFLAGS) $(CPPFLAGS) -g -D__OXSERV_DEBUG=1 $(LDFLAGS) oxserv.c oxstack.o -o $@ $(LIBS) |
|
|
|
|