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