view libcruft/Makefile.in @ 8966:1bba53c0a38d

Implement diag + sparse, diag - sparse, sparse + diag, sparse - diag. Date: Mon, 9 Mar 2009 17:45:22 -0400 This does not use the typical sparse-mx-ops generator. I suspect the sematics of elementwise multiplication and division to be rather controversial, so they are not included. If comparison operations are added, the implementation should be shifted over to use the typical generator. The template in Sparse-diag-op-defs.h likely could use const bools rather than functional argument operations. I haven't measured which is optimized more effectively. Also, the Octave binding layer in op-dm-scm.cc likely could use all sorts of macro or template trickery, but it's far easier to let Emacs handle it for now. That would be worth revisiting if further elementwise sparse and diagonal operations are added.
author Jason Riedy <jason@acm.org>
date Mon, 09 Mar 2009 17:49:14 -0400
parents eb63fbe60fab
children 49a0c58a7dcf
line wrap: on
line source

# Makefile for octave's libcruft directory
#
# Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
#               2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 John W. Eaton
#
# This file is part of Octave.
# 
# Octave is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at
# your option) any later version.
# 
# Octave is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
# 
# You should have received a copy of the GNU General Public License
# along with Octave; see the file COPYING.  If not, see
# <http://www.gnu.org/licenses/>.

TOPDIR = ..

srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@

include $(TOPDIR)/Makeconf

INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@

# List of the directories that contain Fortran source.  Simply copying
# a new .f file into one of these directories is sufficient to have it
# added to $(LIBPRE)cruft.a.  If you add a new directory here, you also need
# generate a new configure script in the top-level directory (edit
# configure.in and run autoconf).

# Some of the directories in libcruft may be only optionally built,
# e.g. if they are already present on the system.  For these, their
# dirname is substituted by configure and may be the empty string.

CRUFT_DIRS = amos @BLAS_DIR@ blas-xtra daspk dasrt dassl \
	@FFT_DIR@ @LAPACK_DIR@ lapack-xtra \
	misc odepack ordered-qz quadpack ranlib \
	slatec-err slatec-fn villad

SUBDIRS = $(CRUFT_DIRS)

DISTSUBDIRS = $(sort $(CRUFT_DIRS) blas fftpack lapack)

CLEAN_SUBDIRS = $(DISTSUBDIRS)

DISTFILES = Makefile.in ChangeLog Makerules.in $(SOURCES) \
	STOP.patch mkf77def.in

XTRA_CRUFT_SH_LDFLAGS = @XTRA_CRUFT_SH_LDFLAGS@
SH_LDFLAGS += $(XTRA_CRUFT_SH_LDFLAGS)

# Include BLAS and FFTW just in case some of libcruft depends on them
LINK_DEPS = $(BLAS_LIBS) $(FFTW_LIBS) $(FLIBS)

all: libraries
.PHONY: all

mkf77def: mkf77def.in $(TOPDIR)/Makeconf
	@$(do-subst-f77-mangling)
	chmod a+rx $@

$(SUBDIRS): mkf77def
	$(MAKE) -C $@ all
.PHONY: $(SUBDIRS)

# FIXME -- this should build the shared library directly from
# a normal archive file (created from PIC code, though).

MISC_OBJ := misc/machar.o misc/smachar.o misc/f77-extern.o \
	misc/f77-fcn.o misc/lo-error.o misc/quit.o misc/cquit.o

CRUFT_FSRC := $(foreach dir, $(SUBDIRS), $(wildcard $(srcdir)/$(dir)/*.f))
CRUFT_OBJ2 := $(patsubst $(srcdir)/%, %, $(CRUFT_FSRC))
CRUFT_OBJ1 := $(patsubst %.f, %.o, $(CRUFT_OBJ2))
CRUFT_OBJ := $(CRUFT_OBJ1) $(MISC_OBJ)
CRUFT_DEFS := $(patsubst %.f, %.def, $(CRUFT_OBJ2))

ifeq ($(SHARED_LIBS), true)
  ifdef FPICFLAG
    CRUFT_OBJ_DIR := $(dir $(CRUFT_OBJ))
    CRUFT_OBJ_PICDIR := $(addsuffix pic/, $(CRUFT_OBJ_DIR))
    CRUFT_OBJ_NOTDIR := $(notdir $(CRUFT_OBJ))
    CRUFT_PICOBJ := $(join $(CRUFT_OBJ_PICDIR), $(CRUFT_OBJ_NOTDIR))
  else
    CRUFT_PICOBJ := $(CRUFT_OBJ)
  endif
endif

ifeq ($(SHARED_LIBS), true)
  ifeq ($(STATIC_LIBS), true)
    LIBRARIES = $(LIBPRE)cruft.$(LIBEXT) $(SHLLIBPRE)cruft.$(SHLEXT_VER)
  else
    LIBRARIES = $(SHLLIBPRE)cruft.$(SHLEXT_VER)
  endif
else
  ifeq ($(STATIC_LIBS), true)
    LIBRARIES = $(LIBPRE)cruft.$(LIBEXT)
  else
    LIBRARIES =
  endif
endif

$(CRUFT_DEFS): $(SUBDIRS)

cruft.def: $(CRUFT_DEFS)
	echo "EXPORTS" > $@
	cat $(CRUFT_DEFS) >> $@

libraries: cruft.def
	$(MAKE) $(LIBRARIES)
.PHONY: libraries

$(LIBPRE)cruft.$(LIBEXT): $(CRUFT_OBJ)
	rm -f $@
	$(AR) $(ARFLAGS) $@ $^
	$(RANLIB) $@

$(SHLLIBPRE)cruft.$(SHLEXT_VER): $(SHLLIBPRE)cruft.$(SHLEXT)
	rm -f $@
	$(LN_S) $< $@

$(SHLLIBPRE)cruft.$(SHLEXT): $(CRUFT_PICOBJ)
	rm -f $@
	$(SH_LD) $(SH_LDFLAGS) $(SONAME_FLAGS) -o $@ $^ $(LINK_DEPS)

$(CRUFT_OBJ):

check: all
.PHONY: check

install install-strip uninstall::
	@$(subdir-for-command)

clean mostlyclean distclean maintainer-clean::
	@$(foreach d, $(CLEAN_SUBDIRS), $(do-subdir-for-command))

install::
	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(octlibdir)
	if $(STATIC_LIBS); then \
	  rm -f $(DESTDIR)$(octlibdir)/$(LIBPRE)cruft.$(LIBEXT) ; \
	  $(INSTALL_DATA) $(LIBPRE)cruft.$(LIBEXT) \
	    $(DESTDIR)$(octlibdir)/$(LIBPRE)cruft.$(LIBEXT) ; \
	  $(RANLIB) $(DESTDIR)$(octlibdir)/$(LIBPRE)cruft.$(LIBEXT) ; \
	fi
	if $(SHARED_LIBS); then \
	  rm -f $(DESTDIR)$(octlibdir)/$(SHLLIBPRE)cruft.$(SHLLIB_VER); \
	  $(INSTALL) \
	    $(SHLLIBPRE)cruft.$(SHLLIB) $(DESTDIR)$(octlibdir)/$(SHLLIBPRE)cruft.$(SHLLIB_VER); \
	  rm -f $(DESTDIR)$(octlibdir)/$(SHLLIBPRE)cruft.$(SHLLIB); \
	  (cd $(DESTDIR)$(octlibdir); \
	  $(LN_S) $(SHLLIBPRE)cruft.$(SHLLIB_VER) $(DESTDIR)$(octlibdir)/$(SHLLIBPRE)cruft.$(SHLLIB)); \
	  if  test x$(SHLBIN) != x ; then \
	    rm -f $(DESTDIR)$(bindir)/$(SHLBINPRE)cruft.$(SHLBIN); \
	    $(INSTALL_PROGRAM) \
	      $(SHLBINPRE)cruft.$(SHLBIN) $(DESTDIR)$(bindir)/$(SHLBINPRE)cruft.$(SHLBIN); \
	  fi; \
	fi

install-strip::
	$(MAKE) INSTALL_PROGRAM="$(INSTALL_PROGRAM) -s" install

uninstall::
	rm -f $(DESTDIR)$(octlibdir)/$(LIBPRE)cruft.$(LIBEXT)
	rm -f $(DESTDIR)$(octlibdir)/$(SHLLIBPRE)cruft.$(SHLLIB)
	rm -f $(DESTDIR)$(octlibdir)/$(SHLLIBPRE)cruft.$(SHLLIB_VER)
	if test x$(SHLBIN) != x; then \
	  rm -f $(DESTDIR)$(bindir)/$(SHLBINPRE)cruft.$(SHLBIN); \
	  rm -f $(DESTDIR)$(bindir)/$(SHLBINPRE)cruft.$(SHLBIN_VER); \
	fi

tags TAGS:: $(SOURCES)
	$(SUBDIR_FOR_COMMAND)

tags::
	ctags $(SOURCES)

TAGS:: $(SOURCES)
	etags $(SOURCES)

clean mostlyclean distclean maintainer-clean::
	rm -f $(LIBPRE)cruft.$(LIBEXT)
	rm -f $(SHLLIBPRE)cruft.$(SHLEXT_VER) $(SHLLIBPRE)cruft.$(SHLEXT)
	rm -f $(SHLBINPRE)cruft.$(SHLBIN_VER) $(SHLBINPRE)cruft.$(SHLBIN)
	rm -f $(CRUFT_DEFS) cruft.def mkf77def

distclean maintainer-clean::
	rm -f Makefile Makerules so_locations

maintainer-clean::
	rm -f tags TAGS

dist:
	for dir in $(DISTSUBDIRS); do mkdir ../`cat ../.fname`/libcruft/$$dir; $(MAKE) -C $$dir $@; done
	ln $(addprefix $(srcdir)/, $(DISTFILES)) ../`cat ../.fname`/libcruft
.PHONY: dist

.NOTPARALLEL: