1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
|
#
# Makefile for complete Yorick distribution
# (If this is Makefile.in, run configure first; read INSTALL and README.)
#
# $Id$
#
# @configure_input@
# ------------------------------------------------------------------------
# Variables
SHELL = /bin/sh
MAKE = make
RM = rm -f
MV = mv
SED = sed
Y_SITE = @Y_SITE@
Y_HOME = @Y_HOME@
Y_BINDIR = @Y_BINDIR@
Y_VERSION = @Y_VERSION@
YS_PRE1 = @YS_PRE1@
YS_PRE2 = @YS_PRE2@
YH_PRE1 = @YH_PRE1@
YH_PRE2 = @YH_PRE2@
YH_PRE3 = @YH_PRE3@
# I don't know whether these do what they're supposed to do (for autoconf).
srcdir = @srcdir@
VPATH = @srcdir@
USEDIRS = Gist Browser Yorick MathC Drat
INDDIRS = Gist Browser Yorick
DEPDIRS = MathC Drat
# For Debian and other situations where you need to actually install
# to a different directory than the final "true" installation directory
# -- idea is to do "make" first, then "make install DESTDIR=whatever"
DESTDIR =
# ------------------------------------------------------------------------
# Targets
all::
cd Gist; $(MAKE)
cd Browser; $(MAKE)
cd Yorick; $(MAKE) GISTINCL=-I../Gist GISTLIB=-L../Gist \
YORINCL=-I. YORLIB=-L. CODGER=./codger \
codger startup main.o libyor.a cxx
cd MathC; $(MAKE) GISTINCL=-I../Gist GISTLIB=-L../Gist \
YORINCL=-I../Yorick YORLIB=-L../Yorick CODGER=../Yorick/codger \
startup libyorm.a
cd Drat; $(MAKE) GISTINCL=-I../Gist GISTLIB=-L../Gist \
YORINCL=-I../Yorick YORLIB="-L../MathC -L../Yorick" \
YORMAIN=../Yorick/main.o CODGER=../Yorick/codger
# substitue these on the make command line, e.g.-
# make optimize O_FLAGS="+O4 -aggressive" LD_FLAGS=+O4
G_FLAGS = -g
O_FLAGS = -O
LD_FLAGS = $$(C_OPTIMIZE)
CG_SUBSTITUTE = 's/^C_OPTIMIZE.*/C_OPTIMIZE = $(G_FLAGS)/'
CO_SUBSTITUTE = 's/^C_OPTIMIZE.*/C_OPTIMIZE = $(O_FLAGS)/'
LD_SUBSTITUTE = 's/^LD_OPTIMIZE.*/LD_OPTIMIZE = $(LD_FLAGS)/'
# run this before make all to get -g versions
debug::
for dir in $(USEDIRS); do \
( $(SED) -e $(CG_SUBSTITUTE) $$dir/Makefile >M.1; \
$(SED) -e $(LD_SUBSTITUTE) M.1 >$$dir/Makefile; ); \
done
# run this before make all to get -O versions (this is initial default)
optimize::
for dir in $(USEDIRS); do \
( $(SED) -e $(CO_SUBSTITUTE) $$dir/Makefile >M.1; \
$(SED) -e $(LD_SUBSTITUTE) M.1 >$$dir/Makefile; ); \
done
# ------------------------------------------------------------------------
# Installation (consider check first)
check:
cd Gist; $(MAKE) check
cd Drat; $(MAKE) GISTINCL=-I../Gist GISTLIB=-L../Gist \
YORINCL=-I../Yorick YORLIB="-L../MathC -L../Yorick" \
YORMAIN=../Yorick/main.o CODGER=../Yorick/codger check
install: docs installdirs
$(RM) Yorick/yorick
$(RM) MathC/yorm
for dir in $(USEDIRS); do \
( cd $$dir; \
$(MAKE) DESTDIR=$(DESTDIR) install; ); \
done
uninstall:
for dir in $(USEDIRS); do \
( cd $$dir; \
$(MAKE) DESTDIR=$(DESTDIR) uninstall; ); \
done
$(RM) Maketmpl
$(RM) -r Yorick/startup
$(RM) -r Yorick/gist
$(RM) -r bin
$(RM) -r lib
$(RM) -r h
$(RM) -r contrib
PRE_SITE = $(DESTDIR)$(YS_PRE1) $(DESTDIR)$(YS_PRE2)
PRE_HOME = $(DESTDIR)$(YH_PRE1) $(DESTDIR)$(YH_PRE2) $(DESTDIR)$(YH_PRE3)
installdirs:
./install-sh 0 $(PRE_SITE) $(DESTDIR)$(Y_SITE)
./install-sh 0 $(DESTDIR)$(Y_SITE)/startup
./install-sh 0 $(DESTDIR)$(Y_SITE)/include
./install-sh 0 $(DESTDIR)$(Y_SITE)/gist
./install-sh 0 $(DESTDIR)$(Y_SITE)/doc
./install-sh 0 $(DESTDIR)$(Y_BINDIR)
./install-sh 0 $(PRE_HOME) $(DESTDIR)$(Y_HOME)
./install-sh 0 $(DESTDIR)$(Y_HOME)/lib
./install-sh 0 $(DESTDIR)$(Y_HOME)/h
# The *.doc documents are no longer shipped with the distribution to save
# space. Make them now. If you want to make the emacs info version of
# the manual, you should run makeinfo on yorick.tex in the Yorick/doc
# directory.
docs:
./Drat/drat -batch maked.i
# The contrib directories allow "rank and file" users to make Yorick
# packages generally available without intervention by the proprietor.
contrib:
./install-sh 1 $(Y_SITE)/contrib
./install-sh 1 $(Y_HOME)/lib/contrib
# ------------------------------------------------------------------------
# Cleanup
clean:
$(RM) conftest* *~ *.bak core
for dir in $(USEDIRS); do ( cd $$dir; $(MAKE) clean; ); done
tidy:
$(RM) conftest* *~ *.bak core
for dir in $(USEDIRS); do ( cd $$dir; $(MAKE) tidy; ); done
distclean:
$(RM) Makefile config.* conftest* *~ *.bak core Maketmpl
$(RM) -r Yorick/startup
$(RM) -r Yorick/gist
$(RM) -r bin
$(RM) -r lib
$(RM) -r h
$(RM) -r contrib
for dir in $(DEPDIRS); do ( cd $$dir; $(MAKE) clean; ); done
for dir in $(INDDIRS); do ( cd $$dir; $(MAKE) distclean; ); done
# ------------------------------------------------------------------------
|