Annotation of OpenXM/src/ox_cdd/Makefile, Revision 1.3
1.3 ! noro 1: # $OpenXM: OpenXM/src/ox_cdd/Makefile,v 1.2 2005/05/25 05:06:06 noro Exp $
1.1 noro 2:
3: OpenXM_HOME=../..
4: OpenXM_LIBDIR=../../lib
5: OpenXM_LIB = -L$(OpenXM_LIBDIR) -lox -lgc -lgmp
6: INCLUDES = -I$(OpenXM_HOME)/include
7: PREFIX=${OpenXM_HOME}
8: DISTDIR=${OpenXM_HOME}/../OpenXM_dist
9: RM = /bin/rm
10: MASTER_SITE=ftp://ftp.math.kobe-u.ac.jp/pub/OpenXM/misc/
1.3 ! noro 11: CDDLIB_TB=cddlib-093d.tar.gz
! 12: MVOL_TB=MixedVol.tar.gz
1.1 noro 13: CFLAGS = -g -Wall -finline-functions
1.3 ! noro 14: MVOLINCLUDE=work/MixedVol/SRC
1.1 noro 15:
16: GMPDEF = -DGMPRATIONAL
17:
18: CDD=cddlib-093d
19: CDD_HOME= work/$(CDD)
20:
21: CDD_LIB = -lcdd
1.3 ! noro 22: CDDOBJ = ox_cdd.o cddlib.o
! 23: SRESOBJ = ox_sres.o cddlib.o mvol.o
! 24: LIBS = $(CDD_LIB) $(OpenXM_LIB) -lm
1.1 noro 25:
1.3 ! noro 26: CDDG_LIB = -lcddgmp
! 27: CDDOBJG = ox_cddgmp.o cddlibgmp.o
! 28: SRESOBJG = ox_sresgmp.o cddlibgmp.o mvol.o
! 29: LIBSG = $(CDDG_LIB) $(OpenXM_LIB) -lm
1.1 noro 30:
1.3 ! noro 31: PROG= ox_cdd ox_sres ox_cddgmp ox_sresgmp
1.1 noro 32:
33: all: build
34:
1.3 ! noro 35: components : libs $(PROG)
! 36:
! 37: ox_cdd: $(CDDOBJ)
! 38: $(CC) $(CDDOBJ) $(LIBS) -o $@
1.1 noro 39:
1.3 ! noro 40: ox_cddgmp: $(CDDOBJG)
! 41: g++ $(CDDOBJG) $(LIBSG) -o $@
1.1 noro 42:
1.3 ! noro 43: ox_sres: $(SRESOBJ)
! 44: g++ $(SRESOBJ) $(LIBS) -o $@
! 45:
! 46: ox_sresgmp: $(SRESOBJG)
! 47: g++ $(SRESOBJG) $(LIBSG) -o $@
1.1 noro 48:
49: ox_cdd.o : ox_cdd.c
50: $(CC) $(CFLAGS) $(INCLUDES) -c $<
51:
52: ox_cddgmp.o : ox_cdd.c
53: $(CC) -o ox_cddgmp.o $(CFLAGS) $(GMPDEF) $(INCLUDES) -c $<
54:
1.3 ! noro 55: ox_sres.o : ox_sres.c
! 56: $(CC) $(CFLAGS) $(INCLUDES) -c $<
! 57:
! 58: ox_sresgmp.o : ox_sres.c
! 59: $(CC) -o ox_sresgmp.o $(CFLAGS) $(GMPDEF) $(INCLUDES) -c $<
! 60:
1.1 noro 61: cddlib.o : cddlib.c
62: $(CC) $(CFLAGS) $(INCLUDES) -c $<
63:
64: cddlibgmp.o : cddlib.c
65: $(CC) -o cddlibgmp.o $(CFLAGS) $(GMPDEF) $(INCLUDES) -c $<
66:
1.3 ! noro 67: mvol.o : mvol.cpp
! 68: g++ $(CFLAGS) -I$(MVOLINCLUDE) -c $<
! 69:
1.1 noro 70: libs : ox gc libgmp cdd
71:
1.3 ! noro 72:
1.1 noro 73: ox :
74: -@if test -f $(OpenXM_HOME)/lib/libox.a ; then \
75: true ; \
76: else \
77: ( cd $(OpenXM_HOME)/src/ ; make install-oxtoolkit ) ; \
78: fi
79:
80: gc :
81: -@if test -f $(OpenXM_HOME)/lib/libgc.a ; then \
82: true ; \
83: else \
84: ( cd $(OpenXM_HOME)/src/ ; make install-gc ) ; \
85: fi
86:
87: libgmp :
88: -@if test -f $(OpenXM_HOME)/lib/libgmp.a ; then \
89: true ; \
90: else \
91: ( cd $(OpenXM_HOME)/src/ ; make install-gmp ) ; \
92: fi
93:
94: cdd :
95: -mkdir ${PREFIX}/bin ${PREFIX}/lib
96: @if [ ! -f work/.install_done ]; then \
97: (cd work/${CDD} ; ${MAKE} install) ; \
98: fi
99:
100: clean:
101:
102: distclean: clean
103: rm -f $(OpenXM_HOME)/lib/libox.a
104: rm -f $(OpenXM_HOME)/lib/libgc.a
105: rm -f $(CDD_HOME)/lib-src/libcdd.a
106:
107: fetch:
108: -mkdir work
109: @if [ ! -f work/.fetch_done ]; then \
1.3 ! noro 110: ${OpenXM_HOME}/bin/oxfetch.sh ${MASTER_SITE}${CDDLIB_TB} ${DISTDIR}; \
! 111: ${OpenXM_HOME}/bin/oxfetch.sh ${MASTER_SITE}${MVOL_TB} ${DISTDIR}; \
1.1 noro 112: fi
113: @touch work/.fetch_done
114:
115: extract: fetch
116: @if [ ! -f work/.extract_done ]; then \
1.3 ! noro 117: cat ${DISTDIR}/${CDDLIB_TB} | (cd work ; tar xzvf -) ; \
! 118: cat ${DISTDIR}/${MVOL_TB} | (cd work ; tar xzvf -) ; \
1.1 noro 119: fi
120: @touch work/.extract_done
121:
122: patch: extract
123: @touch work/.patch_done
124:
125: configure: patch
126: @if [ ! -f work/.configure_done ]; then \
127: prefix=`cd ${OpenXM_HOME}; pwd` ; \
128: (cd work/${CDD} ; ./configure CXX=cc --prefix="$$prefix" ) ; \
129: fi
130: @touch work/.configure_done
131:
132: build : configure components
133:
1.3 ! noro 134: install: build
! 135: cp $(PROG) $(PROG) $(PREFIX)/bin
1.2 noro 136: -mkdir $(PREFIX)/lib/asir
1.3 ! noro 137: -for i in $(PROG); do \
! 138: ln -s $(PREFIX)/bin/$$i $(PREFIX)/lib/asir ; \
! 139: done
1.1 noro 140: @touch work/.install_done
141:
142: clean:
143: -$(RM) -rf work
1.3 ! noro 144: -$(RM) -f $(PROG) *.o
1.1 noro 145: -$(RM) *.core
146:
147: distclean: clean
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>