[BACK]Return to Makefile.SH CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / pari / config

Annotation of OpenXM_contrib/pari/config/Makefile.SH, Revision 1.1.1.1

1.1       maekawa     1: file=$objdir/Makefile
                      2:
                      3: if test ! -s $src_dir/kernel/$asmarch/Makefile.SH; then
                      4:   echo "No Makefile for asmarch $asmarch !" >&2; fi
                      5:
                      6: echo Extracting $file
                      7: rm -f $file
                      8:
                      9: # Path to directories
                     10: case "$src_dir"    in /*) src=$src_dir ;;    *) src=../$src_dir ;; esac
                     11: case "$data_dir"   in /*) data=$data_dir ;;  *) data=../$data_dir ;; esac
                     12: case "$doc_dir"    in /*) doc=$doc_dir ;;    *) doc=../$doc_dir ;; esac
                     13: case "$emacs_dir"  in /*) emx=$emacs_dir ;;  *) emx=../$emacs_dir ;; esac
                     14: case "$config_dir" in /*) cfg=$config_dir ;; *) cfg=../$config_dir ;; esac
                     15:
                     16: # File lists
                     17: kernel="kernel mp"
                     18: inline="mpinl"
                     19: khlist="pariinl"
                     20: . $src_dir/kernel/$asmarch/Makefile.SH
                     21:
                     22: graph="plot plotport"
                     23: gp="gp gp_init gp_rl highlvl whatnow"
                     24: case "$osname" in
                     25:   cygwin*) graphdyn="plot-dyn plotport-dyn";
                     26:            gpdyn="gp-dyn gp_init-dyn gp_rl-dyn";;
                     27: esac
                     28:
                     29: language=`ls $src_dir/language/*.c | sed 's,.*/\(.*\)\.c,\1,'`
                     30: basemath=`ls $src_dir/basemath/*.c | sed 's,.*/\(.*\)\.c,\1,'`
                     31: modules=`ls $src_dir/modules/*.c   | sed 's,.*/\(.*\)\.c,\1,'`
                     32:
                     33: if test m68k = "$asmarch"; then hlist=pari68k; else hlist=pariport; fi
                     34: hlist="pari paritype paricast paricom parierr parigen paristio parisys $hlist"
                     35:
                     36: HEADERS=''
                     37: for f in $khlist; do
                     38:   HEADERS="$HEADERS $f.h";
                     39: done
                     40: for f in $hlist; do
                     41:   HEADERS="$HEADERS $src/headers/$f.h";
                     42: done
                     43:
                     44: # We don't want to recompile everything when only changing a prototype
                     45: hlist="$hlist paridecl"
                     46:
                     47: OBJS=''
                     48: for f in $kernel $basemath $modules $language; do
                     49:   OBJS="$OBJS $f.o"
                     50: done
                     51: OBJSGP=''
                     52: OBJSDGP=''
                     53: for f in $gp $graph; do
                     54:   OBJSGP="$OBJSGP $f.o"
                     55:   OBJSDGP="$OBJSDGP $f-dyn.o"
                     56: done
                     57: OINLINE=''
                     58: for f in $inline; do
                     59:   if test -n "$__gnuc__" -a "$optimization" != debugging; then
                     60:     OINLINE="$OINLINE $f.o"
                     61:   else
                     62:     OBJS="$OBJS $f.o"
                     63:   fi
                     64: done
                     65:
                     66: case "$which_graphic_lib" in
                     67: none)
                     68:   PLOTFILE=plotnull.c
                     69:   PLOTCFLAGS=
                     70:   PLOTLIBS=
                     71:   plotrunpath=
                     72:   ;;
                     73: gnuplot)
                     74:   PLOTFILE=plotgnuplot.c
                     75:   PLOTCFLAGS=
                     76:   GNUPLOT_OBJS="bitmap.o term.o util.o version.o stdfn.o"
                     77:   PLOTLIBS="$gnuplot_libs"
                     78:   plotrunpath=
                     79:   case "$osname" in
                     80:     os2) libgnuplot=$gnuplot/gnuplot.a;;
                     81:     *) libgnuplot=$gnuplot/libgnuplot.a;;
                     82:   esac
                     83:   ;;
                     84: sunview)
                     85:   PLOTFILE=plotsun.c
                     86:   PLOTCFLAGS=
                     87:   PLOTLIBS='-lsuntool -lsunwindow -lpixrect'
                     88:   plotrunpath=
                     89:   ;;
                     90: X11)
                     91:   PLOTFILE=plotX.c
                     92:   PLOTCFLAGS=-I$Xincroot
                     93:   PLOTLIBS="-L$X11 -lX11 $extralib"
                     94:   if test "$osname" = concentrix; then PLOTLIBS="-lX11"; fi
                     95:   plotrunpath=$X11
                     96:   ;;
                     97: esac
                     98:
                     99: case "$runpathprefix" in
                    100:   -R) RUNPTH_FINAL="-R$runpath"
                    101:       if test -n "$plotrunpath"; then
                    102:         RUNPTH_FINAL="$RUNPTH_FINAL -R$plotrunpath"
                    103:       fi
                    104:       RUNPTH="-R$TOP/$objdir $RUNPTH_FINAL";;
                    105:   *-rpath*)
                    106:       tmp="$runpath:$plotrunpath"
                    107:       RUNPTH_FINAL="$runpathprefix $tmp"
                    108:       RUNPTH="$runpathprefix $TOP/$objdir:$tmp";;
                    109: esac
                    110:
                    111: if test -z "$DLLD"; then
                    112:   exec="gp-sta"; static=y
                    113: else
                    114:   exec="gp-sta gp-dyn"
                    115: fi
                    116: doexec="env \"LD_LIBRARY_PATH=.;\$\$LD_LIBRARY_PATH\" $src/test/dotest $sizeof_long"
                    117: if test -z "$emacs"; then
                    118:   install_emacs_files=
                    119:   pari_elc=
                    120: else
                    121:   install_emacs_files=install_emacs_files
                    122:   pari_elc=$emx/pari.elc
                    123: fi
                    124: case "$static" in
                    125:   n) dft=dyn; libdft=lib-dyn;;
                    126:   y) dft=sta; libdft= ;;
                    127: esac
                    128:
                    129: cat > $file << EOT
                    130: # Makefile for Pari/GP -- $pretty
                    131: #
                    132: #  This file was created by Configure. Any change made to it will be
                    133: #  lost when Configure is run.
                    134: #
                    135: SHELL      = $make_sh
                    136:
                    137: AS         = $AS
                    138: ASFLAGS    = $ASFLAGS
                    139:
                    140: CC         = $CC
                    141: CPPFLAGS   = -I. -I$src/headers
                    142: CFLAGS     = $cflags
                    143: LD         = $LD
                    144: LDFLAGS    = $LDFLAGS
                    145: DLLD       = $DLLD
                    146: DLLDFLAGS  = $DLLDFLAGS
                    147: EXTRADLLDFLAGS  = $EXTRADLLDFLAGS
                    148: CPP        = $CPP
                    149:
                    150: RUNPTH       = $RUNPTH
                    151: RUNPTH_FINAL = $RUNPTH_FINAL
                    152: LDDYN        = $LDDYN
                    153: DLCFLAGS     = $DLCFLAGS
                    154: LIBS = -lm $LIBS
                    155: DYNLIBS      = $DYNLIBS
                    156: DYNFLAGS     = $DYNFLAGS
                    157: DYNRELOC     = $DYNRELOC
                    158:
                    159: RM = rm -f
                    160: MV = mv -f
                    161: LN = $ln_s
                    162:
                    163: # Change these installation directories to suit your needs.
                    164:
                    165: LIBDIR = $libdir
                    166: BINDIR = $bindir
                    167: DATADIR= $datadir
                    168: MANDIR = $mandir
                    169: MISCDIR = $miscdir
                    170: INCLUDEDIR = $includedir
                    171:
                    172: INSTALL = $cfg/install
                    173: INSTALL_PROGRAM = \$(INSTALL)
                    174: INSTALL_DATA = \$(INSTALL) -m 644
                    175:
                    176: # Graphic library.
                    177: PLOTFILE   = $PLOTFILE
                    178: PLOTCFLAGS = $PLOTCFLAGS
                    179: PLOTLIBS   = $PLOTLIBS
                    180: GNUPLOT_OBJS = $GNUPLOT_OBJS
                    181: # Try uncommenting this line if you're using X11 and linking fails:
                    182: #  PLOTLIBS=-L$X11 -lX11
                    183:
                    184: EOT
                    185: if test -n "$readline"; then
                    186: cat >> $file << EOT
                    187:
                    188: RLINCLUDE = $RLINCLUDE
                    189: RLLIBS    = $RLLIBS
                    190:
                    191: EOT
                    192: fi
                    193:
                    194: case "$ln_s" in
                    195:   *cp*) ln_objdir=".";;
                    196:   *)    ln_objdir="$objdir"
                    197: esac
                    198:
                    199: cat >> $file << EOT
                    200: TOPLDDYN     = -L$TOP/$objdir \$(RLLIBS)
                    201:
                    202: OBJS   = $OBJS
                    203: OBJSGP = $OBJSGP
                    204: OBJSDGP = $OBJSDGP
                    205: OINLINE = $OINLINE
                    206:
                    207: dft: gp $pari_elc
                    208:        -
                    209:
                    210: gp: gp-$dft ../gp$suffix$exe_suff $libdft
                    211:        -
                    212:
                    213: ../gp$suffix$exe_suff: gp-$dft
                    214:        -\$(RM) \$@
                    215:        -\$(LN) $ln_objdir/gp-$dft$exe_suff \$@
                    216:
                    217: all: $exec lib-sta
                    218:
                    219: lib-sta: libpari.a
                    220: lib-dyn: libpari.$somake
                    221:
                    222: libpari.a: \$(OBJS) \$(OINLINE)
                    223:        -\$(RM) \$@
                    224:        ar r \$@  \$(OBJS) \$(OINLINE)
                    225: EOT
                    226: if test -n "$ranlib"; then
                    227: cat >> $file << EOT
                    228:
                    229: EOT
                    230: fi
                    231: cat >> $file << EOT
                    232:
                    233: gp-sta: \$(OBJS) \$(OBJSGP) \$(GNUPLOT_OBJS)
                    234:        \$(RM) \$@
                    235:        \$(LD) -o \$@ \$(LDFLAGS) \$(OBJS) \$(OBJSGP) \$(GNUPLOT_OBJS) \$(RUNPTH) \$(RLLIBS) \$(PLOTLIBS) \$(LIBS)
                    236: EOT
                    237:
                    238: cat >> $file << EOT
                    239:
                    240: bench: $exec dobench
                    241: test-compat: $exec dotest-compat
                    242: test-graphic: $exec dotest-graphic
                    243:
                    244: cleantest:
                    245:        \$(RM) out.* pari.ps
                    246:
                    247: dobench::
                    248:        @$doexec
                    249: dotest-compat::
                    250:        @$doexec -c
                    251: dotest-graphic::
                    252:        @$doexec -g
                    253:
                    254: clean: cleantest
                    255:        -\$(RM) *.o *.s pariinl.h libpari.* $exec
                    256:
                    257: .headers: $HEADERS
                    258:        @touch \$@
                    259:
                    260: install: install-lib-$dft install-include install-bin install-man install-misc install-data install-doc
                    261:
                    262: install-include:
                    263:        -mkdir -p \$(INCLUDEDIR)
                    264:        \$(INSTALL_DATA) paricfg.h                 \$(INCLUDEDIR)
                    265:        -for i in $khlist; do \\
                    266:           \$(INSTALL_DATA) \$\$i.h                \$(INCLUDEDIR); done
                    267:        -for i in $hlist; do \\
                    268:           \$(INSTALL_DATA) $src/headers/\$\$i.h   \$(INCLUDEDIR); done
                    269:        -\$(RM) \$(INCLUDEDIR)/genpari.h
                    270:        -\$(LN) pari.h \$(INCLUDEDIR)/genpari.h
                    271:
                    272: install-bin: install-bin-$dft
                    273:
                    274: install-bin-dyn: gp-dyn
                    275:        -mkdir -p \$(BINDIR)
                    276:        -\$(RM) \$(BINDIR)/gp-$version \$(BINDIR)/gp$exe_suff
                    277:        -\$(LD) -o \$(BINDIR)/gp-$version \$(LDFLAGS) \$(OBJSGP) \$(RUNPTH_FINAL) \$(TOPLDDYN) \$(LDDYN) \$(PLOTLIBS) \$(LIBS)
                    278:        strip \$(BINDIR)/gp-$version
                    279:        -\$(LN) gp-$version$exe_suff \$(BINDIR)/gp$exe_suff
                    280:
                    281: install-bin-sta: gp-sta
                    282:        -mkdir -p \$(BINDIR)
                    283:        -\$(RM) \$(BINDIR)/gp-$version \$(BINDIR)/gp$exe_suff
                    284:        \$(INSTALL_PROGRAM) gp-sta$exe_suff \$(BINDIR)/gp-$version$exe_suff
                    285:        -\$(LN) gp-$version$exe_suff \$(BINDIR)/gp$exe_suff
                    286: # Can't strip it if we want install() to work on Linux or OSF.
                    287: #      strip \$(BINDIR)/gp-$version
                    288:
                    289: install-man::
                    290:        -mkdir -p \$(MANDIR)
                    291:        \$(INSTALL_DATA) $doc/gphelp.1 \$(MANDIR)
                    292:        \$(INSTALL_DATA) $doc/gp.1 \$(MANDIR)
                    293:        -\$(RM) \$(MANDIR)/pari.1
                    294:        -\$(LN) \$(MANDIR)/gp.1 \$(MANDIR)/pari.1
                    295:
                    296: install-misc: $install_emacs_files
                    297:        -mkdir -p \$(MISCDIR)
                    298:        \$(INSTALL_PROGRAM) $doc/gphelp       \$(BINDIR)
                    299:        \$(INSTALL_DATA)    $doc/translations \$(MISCDIR)
                    300:
                    301: install-doc:
                    302:        -cd $doc; \$(MAKE) all
                    303:        -\$(INSTALL_DATA) $doc/paricfg.tex   \$(MISCDIR)
                    304:        -\$(INSTALL_DATA) $doc/parimacro.tex \$(MISCDIR)
                    305:        -\$(INSTALL_DATA) $doc/usersch1.tex \$(MISCDIR)
                    306:        -\$(INSTALL_DATA) $doc/usersch2.tex \$(MISCDIR)
                    307:        -\$(INSTALL_DATA) $doc/usersch3.tex \$(MISCDIR)
                    308:        -\$(INSTALL_DATA) $doc/usersch4.tex \$(MISCDIR)
                    309:        -\$(INSTALL_DATA) $doc/usersch5.tex \$(MISCDIR)
                    310:        -\$(INSTALL_DATA) $doc/users.dvi    \$(MISCDIR)
                    311:        -\$(INSTALL_DATA) $doc/tutorial.dvi \$(MISCDIR)
                    312:        -\$(INSTALL_DATA) $doc/refcard.dvi  \$(MISCDIR)
                    313:        -\$(INSTALL_DATA) $doc/refcard.ps   \$(MISCDIR)
                    314:
                    315: install-data:
                    316:        -mkdir -p \$(DATADIR)
                    317:        @-for f in $data/*; do \$(INSTALL_DATA)  \$\$f \$(DATADIR); done 2>/dev/null
                    318:
                    319: install-lib-sta: libpari.a
                    320:        -mkdir -p \$(LIBDIR)
                    321:        -\$(RM) \$(LIBDIR)/libpari.a
                    322:        \$(INSTALL_DATA) libpari.a \$(LIBDIR)/libpari.a.$version
                    323:        -\$(LN) libpari.a.$version \$(LIBDIR)/libpari.a
                    324:
                    325: install-lib-dyn: libpari.$somake
                    326:        -mkdir -p \$(LIBDIR)
                    327:        -\$(RM) \$(LIBDIR)/libpari.$sodest
                    328:        \$(INSTALL_DATA) libpari.$sodest \$(LIBDIR)/libpari.$sodest
                    329: EOT
                    330: if test "$somake" != "$sodest"; then
                    331:   cat >> $file << EOT
                    332:        -\$(RM) \$(LIBDIR)/libpari.$somake
                    333:        -\$(LN) libpari.$sodest \$(LIBDIR)/libpari.$somake
                    334:        -\$(RM) \$(LIBDIR)/libpari.$DLSUFFIX
                    335:        -\$(LN) libpari.$sodest \$(LIBDIR)/libpari.$DLSUFFIX
                    336:
                    337: EOT
                    338: fi
                    339:
                    340: if test -z "$DLLD"; then
                    341:   cat >> $file << EOT
                    342:
                    343: libpari.$somake::
                    344:        @echo "Configure could not find a way to build a shared library on this machine."
                    345:
                    346: EOT
                    347: else
                    348:   if test -z "$DYNLIBS"; then
                    349:     cat >> $file << EOT
                    350: gp-dyn: \$(OBJSGP) libpari.$somake \$(GNUPLOT_OBJS)
                    351:        \$(RM) \$@
                    352:        \$(LD) -o \$@ \$(LDFLAGS) \$(OBJSGP) \$(GNUPLOT_OBJS) \$(RUNPTH) \$(TOPLDDYN) \$(LDDYN) \$(PLOTLIBS) \$(LIBS)
                    353:
                    354: libpari.$somake: \$(OBJS) \$(OINLINE)
                    355:        -\$(RM) libpari.$somake
                    356:        \$(DLLD) -o \$@ \$(DLLDFLAGS) \$(OBJS) \$(OINLINE) \$(EXTRADLLDFLAGS)
                    357: EOT
                    358: # CYGWIN32 FIXME: somake & sodest make no difference...
                    359:     if test "$somake" != "$sodest"; then
                    360:       cat >> $file << EOT
                    361:        -\$(RM) libpari.$sodest
                    362:        -\$(MV) libpari.$somake libpari.$sodest
                    363:        -\$(LN) libpari.$sodest libpari.$somake
                    364:        -\$(RM) libpari.$DLSUFFIX
                    365:        -\$(LN) libpari.$sodest libpari.$DLSUFFIX
                    366: EOT
                    367:     fi
                    368:   else
                    369:     cat >> $file << EOT
                    370: gp-dyn: \$(OBJSDGP) libpari.$somake
                    371:        \$(RM) \$@
                    372:        \$(LD) -o \$@ \$(LDFLAGS) \$(OBJSDGP) \$(RUNPTH) \$(TOPLDDYN) \$(LDDYN) \$(PLOTLIBS) \$(LIBS) \$(DYNLIBS)
                    373: EOT
                    374:   fi
                    375: fi
                    376:
                    377: if test -n "$GNUPLOT_OBJS"; then
                    378: cat >> $file << EOT
                    379: \$(GNUPLOT_OBJS):
                    380:        ar x $libgnuplot \$(GNUPLOT_OBJS)
                    381:
                    382: EOT
                    383: fi
                    384:
                    385: if test -n "$emacs"; then
                    386:   cat >> $file << EOT
                    387: $pari_elc: $emx/pari.el
                    388:        @echo "Byte-Compiling pari.el..."
                    389:        -cd $emx; $emacs -batch -l compile
                    390:
                    391: $install_emacs_files: $pari_elc
                    392:        -mkdir -p \$(MISCDIR)
                    393:        -\$(INSTALL_DATA)   $pari_elc           \$(MISCDIR)
                    394:        \$(INSTALL_DATA)    $emx/pari.el        \$(MISCDIR)
                    395:        \$(INSTALL_DATA)    $emx/pariemacs.txt  \$(MISCDIR)
                    396:        \$(INSTALL_DATA)    $emx/with-syntax.el     \$(MISCDIR)
                    397:        \$(INSTALL_DATA)    $emx/pari-translator.el \$(MISCDIR)
                    398: EOT
                    399: fi
                    400:
                    401: if test -s $src_dir/kernel/$asmarch/Makefile.SH; then
                    402:   . $src_dir/kernel/$asmarch/Makefile.SH rules
                    403: else
                    404:   echo "No Makefile for asmarch $asmarch !" >&2
                    405: fi
                    406:
                    407: HUGELINE=
                    408: for dir in basemath modules language gp graph gpdyn graphdyn; do
                    409:   eval list='$'$dir
                    410:   for f in $list; do
                    411:
                    412:   source="$src/$dir/$f.c"
                    413:   depend=
                    414:   cflags=
                    415:   case "$f" in
                    416:   plot)
                    417:     source="$src/graph/\$(PLOTFILE)"
                    418:     cflags="\$(PLOTCFLAGS)"
                    419:     depend="$src/graph/rect.h"
                    420:     ;;
                    421:   gp|gp_rl)
                    422:     cflags="-I$src/language \$(RLINCLUDE)"
                    423:     depend="$src/language/anal.h $src/gp/gp.h ./paricfg.h"
                    424:     ;;
                    425:   gp_init|plotport)
                    426:     cflags="-I$src/graph"
                    427:     depend="$src/graph/rect.h"
                    428:     ;;
                    429:   plot-dyn)
                    430:     source="$src/graph/\$(PLOTFILE)"
                    431:     cflags="\$(DYNFLAGS) \$(PLOTCFLAGS)"
                    432:     depend="$src/graph/rect.h libpari.dll libpari_dll.h libpari_globals.h libpari.dll"
                    433:     ;;
                    434:   gp-dyn|gp_rl-dyn)
                    435:     source=$src\/`echo $dir | sed -e "s/dyn//"`\/`echo $f | cut -f1 -d-`.c
                    436:     cflags="\$(DYNFLAGS) -I$src/language \$(RLINCLUDE)"
                    437:     depend="$src/language/anal.h $src/gp/gp.h ./paricfg.h libpari_dll.h libpari_globals.h libpari.dll"
                    438:     ;;
                    439:   gp_init-dyn|plotport-dyn)
                    440:     source=$src\/`echo $dir | sed -e "s/dyn//"`\/`echo $f | cut -f1 -d-`.c
                    441:     cflags="\$(DYNFLAGS) -I$src/graph"
                    442:     depend="$src/graph/rect.h libpari_dll.h libpari_globals.h libpari.dll"
                    443:     ;;
                    444:   init|es|sumiter)
                    445:     depend="$src/language/anal.h"
                    446:     ;;
                    447:   anal)
                    448:     depend="$src/language/anal.h $src/headers/parinf.h"
                    449:     ;;
                    450:   base1|bibli1|buch2)
                    451:     depend="$src/headers/parinf.h"
                    452:     ;;
                    453:   esac
                    454:
                    455: HUGELINE="$HUGELINE
                    456: $f.o: .headers $depend $source
                    457:        \$(CC) -c \$(CFLAGS) \$(CPPFLAGS) $cflags -o $f.o $source"
                    458:   done
                    459: done
                    460: #to avoid execing too many "cat".
                    461: echo "$HUGELINE" >> $file
                    462:
                    463: if test -n "$DYNFLAGS"; then
                    464:   echo "include Makefile.DLLs" >> $file
                    465:   cp $config_dir/Makefile.DLLs $objdir
                    466: fi

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>