Annotation of OpenXM/src/ox_ntl/Makefile, Revision 1.7
1.7 ! ohara 1: # $OpenXM: OpenXM/src/ox_ntl/Makefile,v 1.6 2003/11/12 13:31:45 iwane Exp $
1.1 iwane 2: #
3: #
4: #
5: #
6: # wget should be installed for install `NTL'
7: #
8:
9: PROG=ox_ntl
10:
1.6 iwane 11: OpenXM_HOME=${PWD}/../..
1.5 iwane 12:
1.1 iwane 13: CPP=g++
14: CC =gcc
15:
16: RM =/bin/rm
17: CP =/bin/cp
18:
1.4 iwane 19: CFLAGS=-I$(PREFIX)/include
1.1 iwane 20: CPPFLAGS=$(CFLAGS)
21:
22: PREFIX=$(OpenXM_HOME)
23:
24: MASTER_CITES=ftp.math.sci.kobe-u.ac.jp
25:
26: NTL_LIBDIR=$(PREFIX)/lib/NTL
27: LIBDIR=$(PREFIX)/lib
28:
1.7 ! ohara 29: DISTDIR=${OpenXM_HOME}/../OpenXM_dist
1.1 iwane 30: DISTFILEDIR=ntl-5.3.1
31: DISTFILE=ntl-5.3.1.tar.gz
32: WORK=$(PWD)/work
33:
1.3 iwane 34: GMPOPT=NTL_GMP_LIP=on GMP_PREFIX=${OpenXM_HOME} GMP_INCDIR=${OpenXM_HOME}/include GMP_LIBDIR=${OpenXM_HOME}/lib
1.1 iwane 35:
36: .SUFFIXES: .cpp .o .c
37:
1.4 iwane 38: SRCC=oxserv.c oxstack.c
39: SRCP=main.cpp ntl.cpp ntlconv.cpp
1.1 iwane 40:
41: OBJC=$(SRCC:.c=.o) $(SRCP:.cpp=.o)
42:
43:
44: all: $(PROG)
45:
46:
47: $(PROG): $(OBJC) $(LIBDIR)/libox.a $(NTL_LIBDIR)/libntl.a
48: $(CPP) $(CPPFLAGS) -L$(LIBDIR) -L$(NTL_LIBDIR) $(OBJC) -o $@ -lntl -lgmp -lox -lgc
49:
50:
1.4 iwane 51: ox_ntl_debug: ntl.cpp ntl.h oxstack.o
52: $(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
53:
54: oxserv_debug: oxserv.h oxserv.c
55: $(CC) $(CFLAGS) -g -D__OXSERV_DEBUG=1 -L$(LIBDIR) oxserv.c oxstack.o -o $@ -lox -lgc
56:
57: cpp.exe: cpp.cpp
58: $(CPP) $(CPPFLAGS) -g -L/usr/local/lib -L$(LIBDIR) -L$(NTL_LIBDIR) cpp.cpp -o $@ -lntl -lgmp -lox -lgc
59:
60: oxserv.c: oxserv.h oxstack.h
61:
62: oxstack.c: oxstack.h
63:
64: main.cpp: oxserv.h ntl.h oxstack.h
1.1 iwane 65:
66: ntl.cpp: ntl.h
67:
68: .cpp.o:
69: $(CPP) $(CPPFLAGS) -c $< -o $@
70:
71: .c.o:
72: $(CC) $(CFLAGS) -c $< -o $@
73:
74: install: all
75: $(CP) $(PROG) $(PREFIX)/bin
76:
77: clean:
1.4 iwane 78: -$(RM) -f $(OBJC) $(PROG) ox_ntl_debug oxserv_debug
1.1 iwane 79: -$(RM) -fr ${WORK}
1.5 iwane 80: @-$(RM) -f .*-ntl-done
1.1 iwane 81:
82:
1.7 ! ohara 83: fetch-ntl:
! 84: @if [ ! -f .fetch-ntl-done ]; then \
! 85: ${OpenXM_HOME}/bin/oxfetch.sh ftp://${MASTER_CITES}/pub/OpenXM/misc/1.2.2/${DISTFILE} ${DISTDIR}; \
! 86: touch .fetch-ntl-done; \
1.1 iwane 87: fi
88:
1.7 ! ohara 89: extract-ntl: fetch-ntl
! 90: -mkdir work
! 91: @if [ ! -f .extract-ntl-done ]; then \
1.1 iwane 92: (cd ${WORK}; tar xvzf ${DISTDIR}/${DISTFILE}); \
1.7 ! ohara 93: touch .extract-ntl-done; \
1.1 iwane 94: fi
95:
1.7 ! ohara 96: patch-ntl: extract-ntl
1.1 iwane 97: @if [ ! -f .patch-ntl-done ]; then \
98: touch .patch-ntl-done; \
99: fi
1.2 ohara 100:
1.1 iwane 101:
102: build-ntl: patch-ntl
103: @if [ ! -f .build-ntl-done ]; then \
1.6 iwane 104: (cd ${WORK}/${DISTFILEDIR}/src; \
105: LD_LIBRARY_PATH=${OpenXM_HOME}/lib; \
106: export LD_LIBRARY_PATH; \
107: ./configure LIBDIR=${NTL_LIBDIR} PREFIX=${PREFIX} ${GMPOPT}; make); \
1.1 iwane 108: touch .build-ntl-done; \
109: fi
110:
111: install-ntl: build-ntl
112: @if [ ! -f .install-ntl-done ]; then \
113: (cd ${WORK}/${DISTFILEDIR}/src; make install); \
114: touch .install-ntl-done; \
115: fi
116:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>