Annotation of OpenXM/src/ox_ntl/Makefile, Revision 1.2
1.2 ! ohara 1: # $OpenXM: OpenXM/src/ox_ntl/Makefile,v 1.1 2003/11/03 03:11:21 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:
17: CFLAGS=-I$(PREFIX)/include
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:
32:
33: .SUFFIXES: .cpp .o .c
34:
35: SRCC=oxserv.c
36: SRCP=main.cpp ntl.cpp
37:
38: OBJC=$(SRCC:.c=.o) $(SRCP:.cpp=.o)
39:
40:
41: all: $(PROG)
42:
43:
44: $(PROG): $(OBJC) $(LIBDIR)/libox.a $(NTL_LIBDIR)/libntl.a
45: $(CPP) $(CPPFLAGS) -L$(LIBDIR) -L$(NTL_LIBDIR) $(OBJC) -o $@ -lntl -lgmp -lox -lgc
46:
47: oxserv.c: oxserv.h
48:
49: main.cpp: oxserv.h ntl.h
50:
51: ntl.cpp: ntl.h
52:
53: .cpp.o:
54: $(CPP) $(CPPFLAGS) -c $< -o $@
55:
56: .c.o:
57: $(CC) $(CFLAGS) -c $< -o $@
58:
59: install: all
60: $(CP) $(PROG) $(PREFIX)/bin
61:
62: clean:
63: -$(RM) -f $(OBJC) $(PROG)
64: -$(RM) -fr ${WORK}
65: -$(RM) -f .*-ntl-done
66:
67:
68: pre-fetch-ntl:
69: @if [ ! -f .pre-fetch-ntl-done ]; then\
70: mkdir -p ${DISTDIR} ${WORK}; \
71: touch .pre-fetch-ntl-done; \
72: fi
73:
74: fetch-ntl: pre-fetch-ntl
75: @if [ ! -f .fetch-ntl-done ]; then \
1.2 ! ohara 76: if [ ! -f ${DISTDIR}/${DISTFILE} ]; then \
! 77: (cd ${DISTDIR}; wget --no-directories --passive-ftp ftp://$(MASTER_CITES)/pub/OpenXM/misc/1.2.2/$(DISTFILE)) ; \
! 78: fi ; \
1.1 iwane 79: (cd ${WORK}; tar xvzf ${DISTDIR}/${DISTFILE}); \
80: touch .fetch-ntl-done; \
81: fi
82:
83: patch-ntl: fetch-ntl
84: @if [ ! -f .patch-ntl-done ]; then \
85: touch .patch-ntl-done; \
86: fi
1.2 ! ohara 87:
1.1 iwane 88:
89: build-ntl: patch-ntl
90: @if [ ! -f .build-ntl-done ]; then \
91: (cd ${WORK}/${DISTFILEDIR}/src; ./configure LIBDIR=${NTL_LIBDIR} PREFIX=${PREFIX}; make); \
92: touch .build-ntl-done; \
93: fi
94:
95: install-ntl: build-ntl
96: @if [ ! -f .install-ntl-done ]; then \
97: (cd ${WORK}/${DISTFILEDIR}/src; make install); \
98: touch .install-ntl-done; \
99: fi
100:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>