view liboctave/Makefile.in @ 2919:56a24fd3e6d9

[project @ 1997-04-30 22:20:32 by jwe]
author jwe
date Wed, 30 Apr 1997 22:20:32 +0000
parents 71a47e9360c0
children 66ef74ee5d9f
line wrap: on
line source

#
# Makefile for octave's liboctave directory
#
# 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_DATA = @INSTALL_DATA@

LIBOCTAVE_LFLAGS = -L../libcruft -L../readline -L../kpathsea \
	-L../glob -L. $(RLD_FLAG)

LIBOCTAVE_LIBS = -lcruft -lreadline -lkpathsea -lglob

MATRIX_INC := Array.h Array2.h Array3.h DiagArray2.h Array-flags.h \
	Array-idx.h Array2-idx.h Array3-idx.h MArray-defs.h \
	MArray.h MArray2.h MDiagArray2.h Matrix.h \
	base-lu.h mx-base.h mx-op-defs.h mx-defs.h mx-ext.h \
	CColVector.h CDiagMatrix.h CMatrix.h CRowVector.h CmplxAEPBAL.h \
	CmplxCHOL.h CmplxDET.h CmplxHESS.h CmplxLU.h CmplxQR.h \
	CmplxQRP.h CmplxSCHUR.h CmplxSVD.h EIG.h boolMatrix.h chMatrix.h \
	dColVector.h dDiagMatrix.h dMatrix.h dRowVector.h dbleAEPBAL.h \
	dbleCHOL.h dbleDET.h dbleGEPBAL.h dbleHESS.h dbleLU.h dbleQR.h \
	dbleQRP.h dbleSCHUR.h dbleSVD.h

MX_OP_INC := mx-cdm-cm.h mx-cdm-cs.h mx-cdm-dm.h mx-cdm-m.h \
	mx-cdm-s.h mx-cm-cdm.h mx-cm-dm.h mx-cm-m.h mx-cm-s.h \
	mx-cs-cdm.h mx-cs-dm.h mx-cs-m.h mx-dm-cdm.h mx-dm-cm.h \
	mx-dm-cs.h mx-dm-m.h mx-dm-s.h mx-m-cdm.h mx-m-cm.h \
	mx-m-cs.h mx-m-dm.h mx-s-cdm.h mx-s-cm.h mx-s-dm.h

INCLUDES := Bounds.h CollocWt.h DAE.h DAEFunc.h DASSL.h FEGrid.h FSQP.h \
	LinConst.h LP.h LPsolve.h LSODE.h NLConst.h NLEqn.h NLFunc.h \
	NLP.h NPSOL.h ODE.h ODEFunc.h Objective.h QP.h QPSOL.h Quad.h \
	Range.h base-de.h base-min.h byte-swap.h cmd-hist.h data-conv.h \
	dir-ops.h file-ops.h getopt.h idx-vector.h \
	lo-ieee.h lo-mappers.h lo-utils.h mach-info.h oct-alloc.h \
	oct-cmplx.h oct-glob.h oct-math.h oct-term.h pathsearch.h \
	prog-args.h statdefs.h str-vec.h sun-utils.h sysdir.h \
	$(MATRIX_INC) \
	$(MX_OP_INC)

TEMPLATE_SRC := Array.cc Array2.cc Array3.cc DiagArray2.cc \
	MArray.cc MArray2.cc MDiagArray2.cc base-lu.cc

TI_SRC := Array-C.cc Array-b.cc Array-ch.cc Array-i.cc Array-d.cc \
	Array-s.cc Array-str.cc \
	MArray-C.cc MArray-ch.cc MArray-i.cc MArray-d.cc MArray-s.cc

MATRIX_SRC := Array-flags.cc CColVector.cc CDiagMatrix.cc CMatrix.cc \
	CRowVector.cc CmplxAEPBAL.cc CmplxCHOL.cc CmplxDET.cc \
	CmplxHESS.cc CmplxLU.cc CmplxQR.cc CmplxQRP.cc CmplxSCHUR.cc \
	CmplxSVD.cc EIG.cc MArray-misc.cc boolMatrix.cc chMatrix.cc \
	dColVector.cc dDiagMatrix.cc dMatrix.cc dRowVector.cc \
	dbleAEPBAL.cc dbleCHOL.cc dbleDET.cc dbleGEPBAL.cc \
	dbleHESS.cc dbleLU.cc dbleQR.cc dbleQRP.cc dbleSCHUR.cc \
	dbleSVD.cc

MX_OP_SRC := mx-cdm-cm.cc mx-cdm-cs.cc mx-cdm-dm.cc mx-cdm-m.cc \
	mx-cdm-s.cc mx-cm-cdm.cc mx-cm-dm.cc mx-cm-m.cc mx-cm-s.cc \
	mx-cs-cdm.cc mx-cs-dm.cc mx-cs-m.cc mx-dm-cdm.cc mx-dm-cm.cc \
	mx-dm-cs.cc mx-dm-m.cc mx-dm-s.cc mx-m-cdm.cc mx-m-cm.cc \
	mx-m-cs.cc mx-m-dm.cc mx-s-cdm.cc mx-s-cm.cc mx-s-dm.cc

SOURCES := Bounds.cc CollocWt.cc DAE.cc DASSL.cc FEGrid.cc FSQP.cc \
	LinConst.cc LPsolve.cc LSODE.cc NLEqn.cc NPSOL.cc QPSOL.cc \
	Quad.cc Range.cc acosh.c asinh.c atanh.c cmd-hist.cc \
	data-conv.cc dir-ops.cc erf.c erfc.c f2c-main.c file-ops.cc \
	filemode.c gamma.c getopt.c getopt1.c idx-vector.cc lgamma.c \
	lo-ieee.cc lo-mappers.cc lo-utils.cc mach-info.cc mkdir.c \
	oct-alloc.cc oct-glob.cc oct-term.cc pathsearch.cc \
	prog-args.cc rename.c rmdir.c str-vec.cc tempname.c tempnam.c \
	$(TEMPLATE_SRC) \
	$(TI_SRC) \
	$(MATRIX_SRC) \
	$(MX_OP_SRC)

EXTRAS := mx-inlines.cc

DISTFILES := Makefile.in ChangeLog safe-xstat.cin safe-xstat.hin \
	$(SOURCES) $(INCLUDES) $(EXTRAS)

ifeq ($(SHARED_LIBS), true)
  BINDISTFILES = liboctave.$(SHLEXT)
  BINDISTLIBS = $(addprefix liboctave/, liboctave.$(SHLEXT))
endif

MAKEDEPS_1 := $(patsubst %.cc, %.d, $(SOURCES))
MAKEDEPS := $(patsubst %.c, %.d, $(MAKEDEPS_1))

OBJECTS_1 := $(patsubst %.cc, %.o, $(SOURCES))
OBJECTS := $(patsubst %.c, %.o, $(OBJECTS_1))

ifeq ($(SHARED_LIBS), true)
  ifdef CXXPICFLAG
    PICOBJ := $(addprefix pic/, $(OBJECTS))
  else
    PICOBJ := $(OBJECTS)
  endif
endif

LIBOCTAVE_DEPEND := $(patsubst %, liboctave.a(%), $(OBJECTS))

all: liboctave.a stamp-shared
.PHONY: all

stamp-prereq: stamp-picdir safe-stat.h safe-lstat.h
	touch stamp-prereq

stamp-picdir:
	@if $(SHARED_LIBS); then \
	  if [ -n "$(CPICFLAG)" ] || [ -n "$(CXXPICFLAG)" ]; then \
	    if [ -d pic ]; then \
	      true ; \
	    else \
	      echo "mkdir pic" ; \
	      mkdir pic ; \
	    fi ; \
	  fi ; \
	else \
	  true ; \
	fi
	touch stamp-picdir

liboctave.a: stamp-prereq $(OBJECTS)
	$(AR) $(ARFLAGS) liboctave.a $(OBJECTS)
	$(RANLIB) liboctave.a

stamp-shared: stamp-prereq $(PICOBJ)
	if $(SHARED_LIBS); then \
	  $(SH_LD) $(SH_LDFLAGS) -o liboctave.$(SHLEXT) $(PICOBJ) ; \
	else \
	  true ; \
	fi
	touch stamp-shared

extract_stat = sed 's/@l@//g; s/@L@//g; /@LSTAT_ONLY@/d'
extract_lstat = sed 's/@l@/l/g; s/@L@/L/g; s/	*@LSTAT_ONLY@//'

safe-lstat.c: safe-xstat.cin
	@echo "making $@ from $<"
	@$(extract_lstat) $< > $@.tmp
	@$(top_srcdir)/move-if-change $@.tmp $@

safe-lstat.h: safe-xstat.hin
	@echo "making $@ from $<"
	@$(extract_lstat) $< > $@.tmp
	@$(top_srcdir)/move-if-change $@.tmp $@

safe-stat.c: safe-xstat.cin
	@echo "making $@ from $<"
	@$(extract_stat) $< > $@.tmp
	@$(top_srcdir)/move-if-change $@.tmp $@

safe-stat.h: safe-xstat.hin
	@echo "making $@ from $<"
	@$(extract_stat) $< > $@.tmp
	@$(top_srcdir)/move-if-change $@.tmp $@

safe-stat.o: safe-stat.h
safe-lstat.o: safe-lstat.h safe-stat.h

check: all
.PHONY: check

install: install-lib install-inc
.PHONY: install

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

install-lib:
	$(top_srcdir)/mkinstalldirs $(libdir)
	rm -f $(libdir)/liboctave.a
	$(INSTALL_DATA) liboctave.a $(libdir)/liboctave.a
	$(RANLIB) $(libdir)/liboctave.a
	if $(SHARED_LIBS); then \
	  rm -f $(libdir)/liboctave.$(SHLEXT); \
	  $(INSTALL_PROGRAM) liboctave.$(SHLEXT) \
	    $(libdir)/liboctave.$(SHLEXT); \
	fi
.PHONY: install-lib

install-inc:
	$(top_srcdir)/mkinstalldirs $(octincludedir)
	for f in $(INCLUDES) $(TEMPLATE_SRC) ; do \
	  rm -f $(octincludedir)/$$f ; \
	  $(INSTALL_DATA) $(srcdir)/$$f $(octincludedir)/$$f ; \
	done
	tmp=`echo $(octincludedir) | sed 's|/*$$||'` ; \
	dir=`echo $$tmp | sed 's|[^/]*$$||'` ; \
	src=`echo $$tmp | sed 's|^.*/||'` ; \
	dest=`echo $$src | sed 's|-$(version)$$||'` ; \
	if [ "$$src" = "$$dest" ] ; then \
	  true ; \
	else \
	  if [ -d $$dir/$$dest ] ; then \
	    true ; \
	  else \
	    cd $$dir ; rm -f $$dest && $(LN_S) $$src $$dest ; \
	  fi ; \
	fi
.PHONY: install-inc

uninstall:
	rm -f $(libdir)/liboctave.a $(libdir)/liboctave.$(SHLEXT)
	for f in $(INCLUDES) ; do rm -f $(octincludedir)/$$f ; done
.PHONY: uninstall

tags: $(SOURCES)
	ctags $(SOURCES)

TAGS: $(SOURCES)
	etags $(SOURCES)

clean:
	rm -f safe-stat.h safe-lstat.h *.a *.o *.d pic/*.o
	if $(SHARED_LIBS); then rm -f *.$(SHLEXT); fi
.PHONY: clean

mostlyclean: clean
.PHONY: mostlyclean

distclean: clean
	rm -f Makefile so_locations stamp-picdir stamp-shared stamp-prereq
	-rmdir pic
.PHONY: distclean

maintainer-clean: distclean
	rm -f tags TAGS stamp-picdir stamp-shared stamp-prereq
	-rmdir pic
.PHONY: maintainer-clean

dist:
	ln $(DISTFILES) ../`cat ../.fname`/liboctave
.PHONY: dist

bin-dist:
	if [ -n "$(BINDISTFILES)" ]; then \
	  ln $(BINDISTFILES) ../`cat ../.fname`/liboctave ; \
	fi
	if [ -n "$(BINDISTLIBS)" ]; then \
	  echo $(BINDISTLIBS) >> ../`cat ../.fname`/LIBRARIES ; \
	fi
.PHONY: bin-dist

# If missing, GNU make attempts to create them in the reverse of the
# order in which they are listed here.  We rely on that fact to ensure
# that the safe-stat.h and safe-lstat.h files are created before trying
# to create the .d files.  Hmm.  I wonder if we can count on that...

ifndef omit_deps
-include $(MAKEDEPS) stamp-prereq
endif