version 1.5, 1999/11/07 12:12:55 |
version 1.14, 2000/01/21 09:33:42 |
|
|
# -*- mode: Makefile; coding: euc-japan -*- |
# -*- mode: Makefile -*- |
# $OpenXM: OpenXM/src/ox_math/Makefile.linux,v 1.4 1999/11/05 08:41:19 ohara Exp $ |
# $OpenXM: OpenXM/src/ox_math/Makefile.linux,v 1.13 2000/01/20 15:28:50 ohara Exp $ |
|
|
# |
|
PREFIX=/usr/local |
PREFIX=/usr/local |
|
OpenXM_HOME=../.. |
|
|
MLINKDIR = ${PREFIX}/mathematica/AddOns/MathLink/DevelopersKits |
MLINKDIR = ${PREFIX}/mathematica/AddOns/MathLink/DevelopersKits |
#SYS = Solaris |
|
SYS = Linux |
SYS = Linux |
ADDONSDIR = ${MLINKDIR}/${SYS}/CompilerAdditions |
ADDONSDIR = ${MLINKDIR}/${SYS}/CompilerAdditions |
MPREP = ${ADDONSDIR}/mprep |
MPREP = ${ADDONSDIR}/mprep |
|
|
# ADDONSDIR = |
GMPSRC = ${OpenXM_HOME}/src/gmp |
|
|
CC = gcc |
|
#GMPSRC = ${OpenXM_HOME}/src/gmp |
|
GMPSRC = ${PREFIX}/lib |
|
#GMPINC = -I${GMPSRC} |
|
GMPINC = -I${PREFIX}/include |
|
|
|
CDEFS = -DDEBUG |
CDEFS = -DDEBUG |
INCDIR = -I${ADDONSDIR} ${GMPINC} |
INCDIR = -I${ADDONSDIR} -I${GMPSRC} -I${OpenXM_HOME}/src/ox_toolkit |
LIBDIR = -L${ADDONSDIR} -L. |
LIBDIR = -L${ADDONSDIR} -L. |
CFLAGS = -g -O2 ${CDEFS} ${INCDIR} ${LIBDIR} |
CFLAGS = -g -O2 ${CDEFS} ${INCDIR} ${LIBDIR} |
|
|
#SOLLIBS = -lsocket -lnsl |
LIBS = -lox -lgmp -lML -lm |
MATHLIBS = -lML -lm |
|
LIBS = -lox -lgmp ${MATHLIBS} ${SOLLIBS} |
|
|
|
LIBOBJS = ox.o parse.o mysocket.o |
BINARIES = ox_math math2ox |
BINARIES = bconv testclient ox_math math2ox |
|
|
|
all: libox.a $(BINARIES) |
all: libgmp.a libox.a ${BINARIES} |
|
|
configure: |
serv1.o serv2.o mlo.o: serv2.h |
@(cd ${OpenXM_HOME}/src; ${MAKE} configure) |
|
@(cd ${OpenXM_HOME}/src/gmp; ./configure; make) |
|
|
|
bconv.o: ox.h oxtag.h parse.h |
|
math2ox.o: ox.h oxtag.h parse.h |
|
mysocket.o: mysocket.h |
|
ox.o: ox.h oxtag.h parse.h mysocket.h |
|
parse.o: ox.h oxtag.h parse.h |
|
serv1.o: ox.h oxtag.h serv2.h |
|
serv2.o: ox.h oxtag.h parse.h serv2.h |
|
testclient.o: ox.h oxtag.h |
|
|
|
libgmp.a: |
libgmp.a: |
@if [ ! -f ${GMPSRC}/libgmp.a ]; then \ |
test -f ${GMPSRC}/libgmp.a || (cd ${GMPSRC}; ./configure; ${MAKE}) |
${MAKE} configure; \ |
ln -s -f ${GMPSRC}/libgmp.a . |
fi |
|
cp -f ${GMPSRC}/libgmp.a . |
|
|
|
libox.a: ${LIBOBJS} libgmp.a |
libox.a: |
|
-rm -f libox.a |
|
(cd ${OpenXM_HOME}/src/ox_toolkit; ${MAKE} libox.a) |
|
ln -s ${OpenXM_HOME}/src/ox_toolkit/libox.a . |
|
|
|
ox_math: serv1.o serv2.o mlo.o libox.a libgmp.a |
|
${CC} ${CFLAGS} -o $@ serv2.o serv1.o mlo.o ${LIBS} |
|
|
|
math2ox: math2ox.o math2.o mlo.o serv2.o libox.a libgmp.a |
|
${CC} ${CFLAGS} -o $@ math2ox.o math2.o serv2.o mlo.o ${LIBS} |
|
|
|
math2.c: math2.tm |
-rm -f $@ |
-rm -f $@ |
ar -rc $@ ${LIBOBJS} |
${MPREP} $? > $@ |
ranlib $@ |
|
|
|
bconv: bconv.o libox.a |
install: install-binary install-document |
${CC} ${CFLAGS} -o $@ bconv.o ${LIBS} |
|
|
|
testclient: testclient.o libox.a |
install-document: |
${CC} ${CFLAGS} -o $@ testclient.o ${LIBS} |
(cd documents; ${MAKE} install-document) |
|
|
ox_math: serv1.o serv2.o libox.a |
install-binary: |
${CC} ${CFLAGS} -o $@ serv2.o serv1.o ${LIBS} |
-if [ -x ${MPREP} ]; then \ |
|
${MAKE} install-binary-real ; \ |
|
fi |
|
|
math2ox: math2ox.o math2.o libox.a |
install-binary-real: ${BINARIES} |
${CC} ${CFLAGS} -o $@ math2ox.o math2.o ${LIBS} |
install -c -m 755 ${BINARIES} ${OpenXM_HOME}/bin/ |
|
(cd lib; ${MAKE} install) |
|
|
sample : sample.o libox.a |
install-for-debug: ${BINARIES} |
${CC} ${CFLAGS} -o $@ sample.o ${LIBS} |
-for i in ${BINARIES}; do \ |
|
ln -s -f ${OpenXM_HOME}/src/ox_math/$$i ${OpenXM_HOME}/bin ; \ |
|
done |
|
|
math2.c: math2.tm |
clean-for-debug: |
-rm -f $@ |
(cd ${OpenXM_HOME}/bin; rm -f ${BINARIES}) |
${MPREP} $? > $@ |
|
|
|
install-openXM-bin: $(BINARIES) |
clean-binary: clean-for-debug |
install -c -m 755 $(BINARIES) ${OpenXM_HOME}/bin/ |
|
|
|
clean: |
clean: |
-rm -f *.o *~ libox.a libgmp.a math2.c |
-rm -f *.o *~ libox.a libgmp.a math2.c ox_math math2ox |
-rm -f bconv testclient ox_math math2ox |
|
-rm -f sample |
|