version 1.1, 2005/05/25 04:42:20 |
version 1.4, 2005/05/25 08:39:07 |
|
|
# $OpenXM$ |
# $OpenXM: OpenXM/src/ox_cdd/Makefile,v 1.3 2005/05/25 06:43:44 noro Exp $ |
|
|
OpenXM_HOME=../.. |
OpenXM_HOME=../.. |
OpenXM_LIBDIR=../../lib |
OpenXM_LIBDIR=../../lib |
Line 8 PREFIX=${OpenXM_HOME} |
|
Line 8 PREFIX=${OpenXM_HOME} |
|
DISTDIR=${OpenXM_HOME}/../OpenXM_dist |
DISTDIR=${OpenXM_HOME}/../OpenXM_dist |
RM = /bin/rm |
RM = /bin/rm |
MASTER_SITE=ftp://ftp.math.kobe-u.ac.jp/pub/OpenXM/misc/ |
MASTER_SITE=ftp://ftp.math.kobe-u.ac.jp/pub/OpenXM/misc/ |
DISTFILES=cddlib-093d.tar.gz |
CDDLIB_TB=cddlib-093d.tar.gz |
|
MVOL_TB=MixedVol.tar.gz |
CFLAGS = -g -Wall -finline-functions |
CFLAGS = -g -Wall -finline-functions |
|
MVOLINCLUDE=work/MixedVol/SRC |
|
|
GMPDEF = -DGMPRATIONAL |
GMPDEF = -DGMPRATIONAL |
|
|
|
|
CDD_HOME= work/$(CDD) |
CDD_HOME= work/$(CDD) |
|
|
CDD_LIB = -lcdd |
CDD_LIB = -lcdd |
OBJ = ox_cdd.o cddlib.o |
CDDOBJ = ox_cdd.o cddlib.o |
PROG = ox_cdd |
SRESOBJ = ox_sres.o cddlib.o mvol.o |
|
LIBS = $(CDD_LIB) $(OpenXM_LIB) -lm |
|
|
CDDGMP_LIB = -lcddgmp |
CDDG_LIB = -lcddgmp |
OBJGMP = ox_cddgmp.o cddlibgmp.o |
CDDOBJG = ox_cddgmp.o cddlibgmp.o |
PROGGMP = ox_cddgmp |
SRESOBJG = ox_sresgmp.o cddlibgmp.o mvol.o |
|
LIBSG = $(CDDG_LIB) $(OpenXM_LIB) -lm |
|
|
LIBS = $(CDD_LIB) $(OpenXM_LIB) -lm |
PROG= ox_cdd ox_sres ox_cddgmp ox_sresgmp |
LIBSGMP = $(CDDGMP_LIB) $(OpenXM_LIB) -lm |
|
|
|
all: build |
all: build |
|
|
components : libs $(PROG) $(PROGGMP) |
components : libs $(PROG) |
|
|
$(PROG): $(OBJ) |
ox_cdd: $(CDDOBJ) |
$(CC) $(OBJ) $(LIBS) -o $@ |
$(CC) $(CDDOBJ) $(LIBS) -o $@ |
|
|
$(PROGGMP): $(OBJGMP) |
ox_cddgmp: $(CDDOBJG) |
g++ $(OBJGMP) $(LIBSGMP) -o $@ |
g++ $(CDDOBJG) $(LIBSG) -o $@ |
|
|
|
ox_sres: $(SRESOBJ) |
|
g++ $(SRESOBJ) $(LIBS) -o $@ |
|
|
|
ox_sresgmp: $(SRESOBJG) |
|
g++ $(SRESOBJG) $(LIBSG) -o $@ |
|
|
ox_cdd.o : ox_cdd.c |
ox_cdd.o : ox_cdd.c |
$(CC) $(CFLAGS) $(INCLUDES) -c $< |
$(CC) $(CFLAGS) $(INCLUDES) -c $< |
|
|
ox_cddgmp.o : ox_cdd.c |
ox_cddgmp.o : ox_cdd.c |
$(CC) -o ox_cddgmp.o $(CFLAGS) $(GMPDEF) $(INCLUDES) -c $< |
$(CC) -o ox_cddgmp.o $(CFLAGS) $(GMPDEF) $(INCLUDES) -c $< |
|
|
|
ox_sres.o : ox_sres.c |
|
$(CC) $(CFLAGS) $(INCLUDES) -c $< |
|
|
|
ox_sresgmp.o : ox_sres.c |
|
$(CC) -o ox_sresgmp.o $(CFLAGS) $(GMPDEF) $(INCLUDES) -c $< |
|
|
cddlib.o : cddlib.c |
cddlib.o : cddlib.c |
$(CC) $(CFLAGS) $(INCLUDES) -c $< |
$(CC) $(CFLAGS) $(INCLUDES) -c $< |
|
|
cddlibgmp.o : cddlib.c |
cddlibgmp.o : cddlib.c |
$(CC) -o cddlibgmp.o $(CFLAGS) $(GMPDEF) $(INCLUDES) -c $< |
$(CC) -o cddlibgmp.o $(CFLAGS) $(GMPDEF) $(INCLUDES) -c $< |
|
|
|
mvol.o : mvol.cpp |
|
g++ $(CFLAGS) -I$(MVOLINCLUDE) -c $< |
|
|
libs : ox gc libgmp cdd |
libs : ox gc libgmp cdd |
|
|
|
|
ox : |
ox : |
-@if test -f $(OpenXM_HOME)/lib/libox.a ; then \ |
-@if test -f $(OpenXM_HOME)/lib/libox.a ; then \ |
true ; \ |
true ; \ |
|
Line 107 distclean: clean |
|
fetch: |
fetch: |
-mkdir work |
-mkdir work |
@if [ ! -f work/.fetch_done ]; then \ |
@if [ ! -f work/.fetch_done ]; then \ |
${OpenXM_HOME}/bin/oxfetch.sh ${MASTER_SITE}${DISTFILES} ${DISTDIR}; \ |
${OpenXM_HOME}/bin/oxfetch.sh ${MASTER_SITE}${CDDLIB_TB} ${DISTDIR}; \ |
|
${OpenXM_HOME}/bin/oxfetch.sh ${MASTER_SITE}${MVOL_TB} ${DISTDIR}; \ |
fi |
fi |
@touch work/.fetch_done |
@touch work/.fetch_done |
|
|
extract: fetch |
extract: fetch |
@if [ ! -f work/.extract_done ]; then \ |
@if [ ! -f work/.extract_done ]; then \ |
cat ${DISTDIR}/${DISTFILES} | (cd work ; tar xzvf -) ; \ |
cat ${DISTDIR}/${CDDLIB_TB} | (cd work ; tar xzvf -) ; \ |
|
cat ${DISTDIR}/${MVOL_TB} | (cd work ; tar xzvf -) ; \ |
fi |
fi |
@touch work/.extract_done |
@touch work/.extract_done |
|
|
patch: extract |
patch: extract |
|
@if [ ! -f work/.patch_done ]; then \ |
|
cd work/${CDD}; patch < ../../cddlib.patch ; \ |
|
fi |
@touch work/.patch_done |
@touch work/.patch_done |
|
|
configure: patch |
configure: patch |
@if [ ! -f work/.configure_done ]; then \ |
@if [ ! -f work/.configure_done ]; then \ |
prefix=`cd ${OpenXM_HOME}; pwd` ; \ |
prefix=`cd ${OpenXM_HOME}; pwd` ; \ |
(cd work/${CDD} ; ./configure CXX=cc --prefix="$$prefix" ) ; \ |
(cd work/${CDD} ; ./configure CXX=cc LDFLAGS=-L$$prefix/lib --prefix="$$prefix" ) ; \ |
fi |
fi |
@touch work/.configure_done |
@touch work/.configure_done |
|
|
build : configure components |
build : configure components |
|
|
install: |
install: build |
cp ox_cdd ox_cddgmp ${PREFIX}/bin |
cp $(PROG) $(PROG) $(PREFIX)/bin |
|
-mkdir $(PREFIX)/lib/asir |
|
-for i in $(PROG); do \ |
|
ln -s $(PREFIX)/bin/$$i $(PREFIX)/lib/asir ; \ |
|
done |
@touch work/.install_done |
@touch work/.install_done |
|
|
clean: |
clean: |
-$(RM) -rf work |
-$(RM) -rf work |
-$(RM) -f $(PROG) $(PROGGMP) $(OBJ) $(OBJGMP) |
-$(RM) -f $(PROG) *.o |
-$(RM) *.core |
-$(RM) *.core |
|
|
distclean: clean |
distclean: clean |