Mercurial > hg > octave-nkf
changeset 1682:e436e535e295
[project @ 1995-12-30 03:42:27 by jwe]
author | jwe |
---|---|
date | Sat, 30 Dec 1995 03:45:22 +0000 |
parents | c7c947c21e49 |
children | 5282f171363d |
files | libcruft/Makefile.in libcruft/Makerules.in libcruft/dassl/Makefile.in libcruft/qpsol/Makefile.in liboctave/Makefile.in make/common.make |
diffstat | 6 files changed, 73 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/libcruft/Makefile.in +++ b/libcruft/Makefile.in @@ -32,7 +32,7 @@ DISTFILES = Makefile.in Makerules.in $(SOURCES) STOP.patch -all: $(SUBDIRS) libcruft.a +all: $(SUBDIRS) libcruft.a stamp-shared .PHONY: all $(SUBDIRS): @@ -40,17 +40,34 @@ cd $@; $(MAKE) all .PHONY: $(SUBDIRS) -CRUFT_FSRC = $(foreach dir, $(SUBDIRS), $(wildcard $(srcdir)/$(dir)/*.f)) -CRUFT_OBJ3 = $(patsubst $(srcdir)/%, %, $(CRUFT_FSRC)) -CRUFT_OBJ2 = $(patsubst %.f, %.o, $(CRUFT_OBJ3)) -CRUFT_OBJ1 = $(subst misc/d1mach.o, , $(CRUFT_OBJ2)) -CRUFT_OBJ = $(CRUFT_OBJ1) misc/d1mach.o misc/dostop.o +CRUFT_FSRC := $(foreach dir, $(SUBDIRS), $(wildcard $(srcdir)/$(dir)/*.f)) +CRUFT_OBJ3 := $(patsubst $(srcdir)/%, %, $(CRUFT_FSRC)) +CRUFT_OBJ2 := $(patsubst %.f, %.o, $(CRUFT_OBJ3)) +CRUFT_OBJ1 := $(subst misc/d1mach.o, , $(CRUFT_OBJ2)) +CRUFT_OBJ := $(CRUFT_OBJ1) misc/d1mach.o misc/dostop.o + +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 libcruft.a: $(CRUFT_OBJ) rm -f libcruft.a $(AR) $(ARFLAGS) libcruft.a $(CRUFT_OBJ) $(RANLIB) libcruft.a +stamp-shared: + if $(SHARED_LIBS); then \ + $(CXX) -shared -o libcruft.$(SHLEXT) $(CRUFT_PICOBJ) $(FLIBS); \ + else true; fi + touch stamp-shared + $(CRUFT_OBJ): check: all @@ -64,6 +81,10 @@ rm -f $(libdir)/libcruft.a $(INSTALL_DATA) libcruft.a $(libdir)/libcruft.a $(RANLIB) $(libdir)/libcruft.a + if $(SHARED_LIBS); then \ + rm -f $(libdir)/libcruft.$(SHLEXT); \ + $(INSTALL_DATA) libcruft.$(SHLEXT) $(libdir)/libcruft.$(SHLEXT); \ + fi uninstall:: rm -f $(libdir)/libcruft.a
--- a/libcruft/Makerules.in +++ b/libcruft/Makerules.in @@ -23,7 +23,7 @@ .PHONY: all stamp-picdir: - if [ -n $(FPICFLAG) ]; then \ + if [ -n "$(FPICFLAG)" ]; then \ if [ -d pic ]; then true; else mkdir pic ; fi ; \ else true; fi touch stamp-picdir
--- a/libcruft/dassl/Makefile.in +++ b/libcruft/dassl/Makefile.in @@ -2,9 +2,9 @@ # Makefile for octave's libcruft/dassl directory # # John W. Eaton -# jwe@che.utexas.edu +# jwe@bevo.che.wisc.edu +# University of Wisconsin-Madison # Department of Chemical Engineering -# The University of Texas at Austin TOPDIR = ../..
--- a/libcruft/qpsol/Makefile.in +++ b/libcruft/qpsol/Makefile.in @@ -2,9 +2,9 @@ # Makefile for octave's libcruft/qpsol directory # # John W. Eaton -# jwe@che.utexas.edu +# jwe@bevo.che.wisc.edu +# University of Wisconsin-Madison # Department of Chemical Engineering -# The University of Texas at Austin TOPDIR = ../..
--- a/liboctave/Makefile.in +++ b/liboctave/Makefile.in @@ -18,7 +18,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ -MATRIX_INC = Array.h Array-idx.h MArray.h Matrix.h mx-base.h \ +MATRIX_INC := Array.h Array-idx.h MArray.h Matrix.h mx-base.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 \ @@ -27,19 +27,19 @@ dbleCHOL.h dbleDET.h dbleGEPBAL.h dbleHESS.h dbleLU.h dbleQR.h \ dbleQRP.h dbleSCHUR.h dbleSVD.h -INCLUDES = Bounds.h CollocWt.h DAE.h DAEFunc.h FEGrid.h FSQP.h \ +INCLUDES := Bounds.h CollocWt.h DAE.h DAEFunc.h FEGrid.h FSQP.h \ LinConst.h LP.h LPsolve.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-min.h f77-uscore.h idx-vector.h \ lo-error.h oct-cmplx.h sun-utils.h \ $(MATRIX_INC) -TEMPLATE_SRC = Array.cc MArray.cc +TEMPLATE_SRC := Array.cc MArray.cc -TI_SRC = Array-C.cc Array-c.cc Array-i.cc Array-d.cc Array-s.cc \ +TI_SRC := Array-C.cc Array-c.cc Array-i.cc Array-d.cc Array-s.cc \ MArray-C.cc MArray-c.cc MArray-i.cc MArray-d.cc MArray-s.cc -MATRIX_SRC = Array-ext.cc CColVector.cc CDiagMatrix.cc CMatrix.cc \ +MATRIX_SRC := Array-ext.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 cMatrix.cc dColVector.cc dDiagMatrix.cc \ @@ -47,28 +47,36 @@ dbleDET.cc dbleGEPBAL.cc dbleHESS.cc dbleLU.cc dbleQR.cc \ dbleQRP.cc dbleSCHUR.cc dbleSVD.cc -SOURCES = Bounds.cc CollocWt.cc DAE.cc FEGrid.cc FSQP.cc LinConst.cc \ +SOURCES := Bounds.cc CollocWt.cc DAE.cc FEGrid.cc FSQP.cc LinConst.cc \ LPsolve.cc NLEqn.cc NPSOL.cc ODE.cc QPSOL.cc Quad.cc \ Range.cc idx-vector.cc lo-error.cc sun-utils.cc \ $(TEMPLATE_SRC) \ $(TI_SRC) \ $(MATRIX_SRC) -EXTRAS = mx-inlines.cc +EXTRAS := mx-inlines.cc + +DISTFILES := Makefile.in $(SOURCES) $(INCLUDES) $(EXTRAS) -DISTFILES = Makefile.in $(SOURCES) $(INCLUDES) $(EXTRAS) +MAKEDEPS := $(patsubst %.cc, %.d, $(SOURCES)) + +OBJECTS := $(patsubst %.cc, %.o, $(SOURCES)) -MAKEDEPS = $(patsubst %.cc, %.d, $(SOURCES)) - -OBJECTS = $(patsubst %.cc, %.o, $(SOURCES)) +ifeq ($(SHARED_LIBS), true) + ifdef CXXPICFLAG + PICOBJ := $(addprefix pic/, $(OBJECTS)) + else + PICOBJ := $(OBJECTS) + endif +endif LIBOCTAVE_DEPEND := $(patsubst %, liboctave.a(%), $(OBJECTS)) -all: stamp-picdir liboctave.a +all: stamp-picdir liboctave.a stamp-shared .PHONY: all stamp-picdir: - if [ -n "$(FPICFLAG)" ] || [ -n "$(CPICFLAG)" ] || [ -n "$(CXXPICFLAG)" ]; then \ + if [ -n "$(CXXPICFLAG)" ]; then \ if [ -d pic ]; then true; else mkdir pic ; fi ; \ else true; fi touch stamp-picdir @@ -77,6 +85,13 @@ $(AR) $(ARFLAGS) liboctave.a $(OBJECTS) $(RANLIB) liboctave.a +stamp-shared: + if $(SHARED_LIBS); then \ + $(CXX) -shared -o liboctave.$(SHLEXT) $(PICOBJ) \ + -L../libcruft -lcruft; \ + else true; fi + touch stamp-shared + check: all .PHONY: check @@ -85,6 +100,10 @@ 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_DATA) liboctave.$(SHLEXT) $(libdir)/liboctave.$(SHLEXT); \ + fi for f in $(INCLUDES) $(TEMPLATE_SRC) ; do \ rm -f $(includedir)/$$f ; \ $(INSTALL_DATA) $(srcdir)/$$f $(includedir)/$$f ; \
--- a/make/common.make +++ b/make/common.make @@ -5,6 +5,12 @@ srcdir = @srcdir@ VPATH = @srcdir@ +CPICFLAGS = @CPICFLAG@ + +SHLEXT = @SHLEXT@ + +SHARED_LIBS = @SHARED_LIBS@ + CC = @CC@ # CFLAGS is used for both compilation and linking. CFLAGS = @CFLAGS@ $(XCFLAGS) @@ -14,6 +20,8 @@ -I$(kpathsea_parent) -I$(kpathsea_srcdir_parent) \ $(prog_cflags) @CPPFLAGS@ $(DEFS) .c.o: + [ -z "$(CPICFLAG)" ] ||\ + $(CC) $(CPPFLAGS) $(CPICFLAG) $(CFLAGS) -c $< -o pic/$@ $(CC) $(CPPFLAGS) $(CFLAGS) -c $< .SUFFIXES: .c .o @@ -33,7 +41,7 @@ kpathsea_dir = $(kpathsea_parent)/kpathsea kpathsea_srcdir_parent = $(top_srcdir)/.. kpathsea_srcdir = $(kpathsea_srcdir_parent)/kpathsea -kpathsea = $(kpathsea_dir)/kpathsea.a +kpathsea = $(kpathsea_dir)/libkpathsea.a ##ifeq ($(CC), gcc) ##XDEFS = -Wall -Wpointer-arith $(warn_more)