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 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268
|
#
# Makefile for octave
#
# John W. Eaton
# jwe@bevo.che.wisc.edu
# University of Wisconsin-Madison
# Department of Chemical Engineering
TOPDIR = .
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
include $(TOPDIR)/Makeconf
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_DATA = @INSTALL_DATA@
CONF_DISTFILES = Makefile Makefile.in octMakefile.in Makeconf.in \
configure configure.in config.guess config.sub aclocal.m4 \
acx_blas.m4 acx_lapack.m4 config.h.in install-sh autogen.sh
DISTFILES = $(CONF_DISTFILES) \
BUGS COPYING FLEX.patch INSTALL INSTALL.OCTAVE NEWS \
NEWS.[0-9] PROJECTS README README.Linux README.Windows \
README.MachTen README.kpathsea ROADMAP SENDING-PATCHES \
THANKS move-if-change octave-sh octave-bug.in \
octave-config.in install-octave.in mk-opts.pl mkinstalldirs \
mkoctfile.in texi2dvi ChangeLog ChangeLog.[0-9]
# Complete directory trees to distribute.
DISTDIRS = # plplot
# Subdirectories in which to run `make all'.
SUBDIRS = @PLPLOT_DIR@ @DLFCN_DIR@ \
libcruft liboctave scripts doc examples
ALL_SUBDIRS = $(SUBDIRS) src
# Subdirectories in which to run `make all'.
INSTALL_SUBDIRS = libcruft liboctave src scripts doc examples
# Subdirectories in which to run `make conf-dist'.
CONF_DISTSUBDIRS = src
# Subdirectories in which to run `make dist'.
DISTSUBDIRS_1 = $(sort $(ALL_SUBDIRS) dlfcn test emacs)
DISTSUBDIRS = $(filter-out $(DISTDIRS), $(DISTSUBDIRS_1))
XBINDISTFILES = BUGS COPYING INSTALL INSTALL.OCTAVE NEWS NEWS.[0-9] \
PROJECTS README README.Linux README.Windows README.MachTen \
SENDING-PATCHES THANKS octave-sh install-octave mkinstalldirs \
ChangeLog ChangeLog.[0-9]
BINDISTFILES = $(addprefix $(srcdir)/, $(XBINDISTFILES)) \
octave-bug octave-config config.status config.h VERSION ARCH
# Subdirectories in which to run `make bin-dist'.
BINDISTSUBDIRS = libcruft liboctave src scripts doc emacs examples
# Subdirectories in which to run clean targets.
CLEANSUBDIRS = $(DISTSUBDIRS)
DIRS_TO_MAKE = $(bindir) $(libdir) $(octincludedir)/octave $(fcnfiledir) \
$(octfiledir) $(archlibdir) $(localarchlibdir) $(localverarchlibdir) \
$(shell echo $(localfcnfilepath) | awk -F: '{for (i=1; i<=NF; i++) print $$i}') \
$(shell echo $(localoctfilepath) | awk -F: '{for (i=1; i<=NF; i++) print $$i}')
all: octave-bug octave-config mkoctfile src
.PHONY: all
src: $(SUBDIRS)
$(MAKE) -C $@ all
.PHONY: src
octave-bug: octave-bug.in Makeconf octMakefile
@$(do-subst-config-vals)
chmod a+rx $@
octave-config: octave-config.in Makeconf octMakefile
@$(do-subst-default-vals)
chmod a+rx $@
mkoctfile: mkoctfile.in Makeconf octMakefile
@$(do-subst-config-vals)
chmod a+rx $@
$(SUBDIRS):
$(MAKE) -C $@ all
.PHONY: $(SUBDIRS)
check:
$(MAKE) -C test check
.PHONY: check
octave.info:
$(MAKE) -C doc/interpreter octave.info
.PHONY: octave.info
BUGS INSTALL.OCTAVE:
$(MAKE) -C doc ../$@
.PHONY: BUGS INSTALL.OCTAVE
install install-strip ::
$(top_srcdir)/mkinstalldirs $(addprefix $(DESTDIR), $(DIRS_TO_MAKE))
rm -f $(DESTDIR)$(bindir)/octave-bug
$(INSTALL_SCRIPT) octave-bug $(DESTDIR)$(bindir)/octave-bug-$(version)
$(LN_S) octave-bug-$(version) $(DESTDIR)$(bindir)/octave-bug
rm -f $(DESTDIR)$(bindir)/octave-config
$(INSTALL_SCRIPT) \
octave-config $(DESTDIR)$(bindir)/octave-config-$(version)
$(LN_S) octave-config-$(version) $(DESTDIR)$(bindir)/octave-config
rm -f $(DESTDIR)$(bindir)/mkoctfile
$(INSTALL_SCRIPT) mkoctfile $(DESTDIR)$(bindir)/mkoctfile-$(version)
$(LN_S) mkoctfile-$(version) $(DESTDIR)$(bindir)/mkoctfile
$(INSTALL_DATA) config.h $(DESTDIR)$(octincludedir)/octave/config.h
uninstall::
rm -f $(DESTDIR)$(bindir)/octave-bug
rm -f $(DESTDIR)$(bindir)/octave-bug-$(version)
rm -f $(DESTDIR)$(bindir)/octave-config
rm -f $(DESTDIR)$(bindir)/octave-config-$(version)
rm -f $(DESTDIR)$(bindir)/mkoctfile
rm -f $(DESTDIR)$(bindir)/mkoctfile-$(version)
rm -f $(DESTDIR)$(octincludedir)/octave/config.h
maintainer-clean::
@echo ""
@echo "************************************************************"
@echo "* *"
@echo "* This command is intended for maintainers to use; it *"
@echo "* deletes files that may require special tools to rebuild. *"
@echo "* *"
@echo "************************************************************"
@echo ""
install install-strip uninstall tags TAGS::
$(foreach d, $(INSTALL_SUBDIRS), $(do-subdir-for-command))
.PHONY: install install-strip uninstall tags
clean mostlyclean distclean maintainer-clean::
$(foreach d, $(CLEANSUBDIRS), $(do-subdir-for-command))
.PHONY: clean mostlyclean distclean maintainer-clean
maintainer-clean distclean::
rm -f octMakefile Makefile Makeconf Makefrag.f77 Makerules.f77
rm -f octave-bug octave-config mk-oct-links mkoctfile install-octave
rm -f config.cache config.h config.log config.status
rm -rf autom4te.cache
maintainer-clean::
rm -f configure config.h.in BUGS INSTALL.OCTAVE
# Rules for making a source distribution.
dist-info-files: INSTALL.OCTAVE BUGS
.PHONY: dist-info-files
dist: dist-info-files
echo octave-$(version) > .fname
rm -rf `cat .fname`
mkdir `cat .fname`
ln $(DISTFILES) `cat .fname`
for dir in $(DISTDIRS); do ln -s ../$$dir `cat .fname`; done
for dir in $(DISTSUBDIRS); do \
mkdir `cat .fname`/$$dir; \
$(MAKE) -C $$dir dist; \
done
tar chf `cat .fname`.tar `cat .fname`
rm -rf `cat .fname`
tar xf `cat .fname`.tar
find `cat .fname` \( \( -name RCS -a -type d \) \
-o \( -name CVS -a -type d \) -o \( -name OLD -a -type d \) \
-o \( -name autom4te.cache -a -type d \) \
-o -name "=*" -o -name '*~' -o -name '#*#' -o -name config.log \
-o -name config.status -o -name config.cache -o -name stamp-h \
-o -name klibtool.config -o -name stamp-auto \
-o -name c-auto.h \) -print | xargs rm -rf
rm -f `cat .fname`/test/octave.test/*.m
chmod -R a+rwX `cat .fname`
tar cf `cat .fname`.tar `cat .fname`
rm -rf `cat .fname`
gzip --best --stdout `cat .fname`.tar > `cat .fname`.tar.gz
bzip2 --best --stdout `cat .fname`.tar > `cat .fname`.tar.bz2
date -u > md5sum
md5sum `cat .fname`.tar.gz `cat .fname`.tar.bz2 >> md5sum
touch `cat .fname`.tar.gz `cat .fname`.tar.bz2 md5sum
rm -f .fname
@echo "*******************"
@echo "Tag the CVS archive"
@echo "*******************"
.PHONY: dist
# Rules for making a snapshot.
snapshot-version:
@echo "creating src/version.h"
@gawk '/#define OCTAVE_VERSION[ \t]*/ { \
datestring = strftime("%y%m%d", systime()); \
printf("#define OCTAVE_VERSION \"ss-%s\"\n", datestring); \
next; \
} { print $$0 }' src/version.h > src/version.h.new
@$(top_srcdir)/move-if-change src/version.h.new src/version.h
.PHONY: snapshot-version
snapshot: snapshot-version
$(MAKE) dist
.PHONY: snapshot
# Rules for making a dist of just the stuff needed to run configure.
conf-dist:
echo config-dist-$(version) > .fname
rm -rf `cat .fname`
mkdir `cat .fname`
ln $(CONF_DISTFILES) `cat .fname`
for dir in $(CONF_DISTSUBDIRS); do \
mkdir `cat .fname`/$$dir; \
$(MAKE) -C $$dir conf-dist; \
done
tar chf `cat .fname`.tar `cat .fname`
rm -rf `cat .fname`
gzip --best `cat .fname`.tar
rm -f .fname
.PHONY: conf-dist
# Rules for making a binary distribution.
VERSION:
echo $(version) > VERSION
.PHONY: VERSION
ARCH:
echo $(canonical_host_type) > ARCH
.PHONY: ARCH
binary-dist: VERSION ARCH octave-bug octave-config dist-info-files
echo octave-$(version)-$(canonical_host_type) > .fname
rm -rf `cat .fname`
mkdir `cat .fname`
ln $(BINDISTFILES) `cat .fname`
for dir in $(BINDISTSUBDIRS); do \
mkdir `cat .fname`/$$dir; \
$(MAKE) -C $$dir bin-dist; \
done
tar chf `cat .fname`.tar `cat .fname`
rm -rf `cat .fname`
tar xf `cat .fname`.tar
find `cat .fname` \( \( -name RCS -a -type d \) \
-o \( -name CVS -a -type d \) -o \( -name OLD -a -type d \) \
-o -name "=*" -o -name '*~' -o -name '#*#' -o -name Makefile \
-o -name c-auto.h \) -print | xargs rm -rf
rm -f `cat .fname`/test/octave.test/*.m
chmod -R a+rw `cat .fname`
find `cat .fname` \( -perm 766 -o -perm 676 -o -perm 667 \
-o -perm 776 -o -perm 677 -o -perm 767 \) -print | \
xargs chmod a+x scripts
strip src/octave
tar cf `cat .fname`.tar `cat .fname`
rm -rf `cat .fname`
gzip --best `cat .fname`.tar
rm -f .fname
.PHONY: binary-dist
.NOTPARALLEL:
|