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