Annotation of OpenXM/src/ox_ntl/Makefile, Revision 1.5
1.5 ! iwane 1: # $OpenXM: OpenXM/src/ox_ntl/Makefile,v 1.4 2003/11/08 12:35:08 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.5 ! iwane 11: OpenXM_HOME=../..
! 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:
29: DISTDIR=$(PWD)/distfile
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:
83: pre-fetch-ntl:
84: @if [ ! -f .pre-fetch-ntl-done ]; then\
85: mkdir -p ${DISTDIR} ${WORK}; \
86: touch .pre-fetch-ntl-done; \
87: fi
88:
89: fetch-ntl: pre-fetch-ntl
90: @if [ ! -f .fetch-ntl-done ]; then \
1.2 ohara 91: if [ ! -f ${DISTDIR}/${DISTFILE} ]; then \
1.4 iwane 92: (cd ${DISTDIR}; wget --no-directories --passive-ftp ftp://$(MASTER_CITES)/pub/OpenXM/misc/1.2.2/$(DISTFILE)) ; \
1.2 ohara 93: fi ; \
1.1 iwane 94: (cd ${WORK}; tar xvzf ${DISTDIR}/${DISTFILE}); \
95: touch .fetch-ntl-done; \
96: fi
97:
98: patch-ntl: fetch-ntl
99: @if [ ! -f .patch-ntl-done ]; then \
100: touch .patch-ntl-done; \
101: fi
1.2 ohara 102:
1.1 iwane 103:
104: build-ntl: patch-ntl
105: @if [ ! -f .build-ntl-done ]; then \
1.5 ! iwane 106: (cd ${WORK}/${DISTFILEDIR}/src; LD_LIBRARY_PATH=${OpenXM_HOME}/lib; export LD_LIBRARY_PATH; ./configure LIBDIR=${NTL_LIBDIR} PREFIX=${PREFIX} ${GMPOPT}; make); \
1.1 iwane 107: touch .build-ntl-done; \
108: fi
109:
110: install-ntl: build-ntl
111: @if [ ! -f .install-ntl-done ]; then \
112: (cd ${WORK}/${DISTFILEDIR}/src; make install); \
113: touch .install-ntl-done; \
114: fi
115:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>