| 1 | # | 
|---|
| 2 | # Makefile | 
|---|
| 3 | # | 
|---|
| 4 | # Copyright (C) 1996 Limit Point Systems, Inc. | 
|---|
| 5 | # | 
|---|
| 6 | # Author: Curtis Janssen <cljanss@ca.sandia.gov> | 
|---|
| 7 | # Maintainer: LPS | 
|---|
| 8 | # | 
|---|
| 9 | # This file is part of the SC Toolkit. | 
|---|
| 10 | # | 
|---|
| 11 | # The SC Toolkit is free software; you can redistribute it and/or modify | 
|---|
| 12 | # it under the terms of the GNU Library General Public License as published by | 
|---|
| 13 | # the Free Software Foundation; either version 2, or (at your option) | 
|---|
| 14 | # any later version. | 
|---|
| 15 | # | 
|---|
| 16 | # The SC Toolkit is distributed in the hope that it will be useful, | 
|---|
| 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 19 | # GNU Library General Public License for more details. | 
|---|
| 20 | # | 
|---|
| 21 | # You should have received a copy of the GNU Library General Public License | 
|---|
| 22 | # along with the SC Toolkit; see the file COPYING.LIB.  If not, write to | 
|---|
| 23 | # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 
|---|
| 24 | # | 
|---|
| 25 | # The U.S. Government is granted a limited license as per AL 91-7. | 
|---|
| 26 | # | 
|---|
| 27 |  | 
|---|
| 28 | TOPDIR=../../../.. | 
|---|
| 29 | ifndef SRCDIR | 
|---|
| 30 | SRCDIR=$(shell pwd) | 
|---|
| 31 | endif | 
|---|
| 32 |  | 
|---|
| 33 | include $(SRCDIR)/$(TOPDIR)/lib/GlobalMakefile | 
|---|
| 34 |  | 
|---|
| 35 | LD=$(CXX) | 
|---|
| 36 |  | 
|---|
| 37 | CXXSRC = function.cc opt.cc update.cc qnewton.cc newton.cc \ | 
|---|
| 38 | gdiis.cc efc.cc steep.cc dfp.cc powell.cc \ | 
|---|
| 39 | scextrap.cc scextrapmat.cc diis.cc transform.cc conv.cc \ | 
|---|
| 40 | mcsearch.cc | 
|---|
| 41 | CSRC = | 
|---|
| 42 |  | 
|---|
| 43 | LIBOBJ = $(CXXSRC:%.cc=%.$(OBJSUF)) $(CSRC:%.c=%.$(OBJSUF)) | 
|---|
| 44 |  | 
|---|
| 45 | INC = function.h opt.h gdiis.h efc.h update.h qnewton.h newton.h \ | 
|---|
| 46 | scextrap.h scextrapmat.h diis.h transform.h conv.h mcsearch.h | 
|---|
| 47 |  | 
|---|
| 48 | DEPENDINCLUDE = | 
|---|
| 49 |  | 
|---|
| 50 | BIN_OR_LIB = LIB | 
|---|
| 51 | TARGET_TO_MAKE = libSCoptimize | 
|---|
| 52 |  | 
|---|
| 53 | kvopt.testrun: DO_TESTRUN=no | 
|---|
| 54 |  | 
|---|
| 55 | TESTPROGS = kvopt opttest scextest | 
|---|
| 56 |  | 
|---|
| 57 | DISTFILES = opttest.cc $(CXXSRC) $(CSRC) $(INC) Makefile LIBS.h | 
|---|
| 58 |  | 
|---|
| 59 | default:: $(DEPENDINCLUDE) | 
|---|
| 60 |  | 
|---|
| 61 | opttest: opttest.$(OBJSUF) $(shell $(LISTLIBS) $(INCLUDE) $(SRCDIR)/LIBS.h) | 
|---|
| 62 | $(LTLINK) $(LD) $(LDFLAGS) -o opttest $^ $(SYSLIBS) $(LTLINKBINOPTS) | 
|---|
| 63 |  | 
|---|
| 64 | opttest.$(OBJSUF): opttest.cc | 
|---|
| 65 | $(LTCOMP) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -DSRCDIR=\"$(SRCDIR)\" -c $< | 
|---|
| 66 |  | 
|---|
| 67 | scextest: scextest.$(OBJSUF) libSCoptimize.$(LIBSUF) \ | 
|---|
| 68 | $(shell $(LISTLIBS) $(INCLUDE) $(SRCDIR)/LIBS.h) | 
|---|
| 69 | $(LTLINK) $(LD) $(LDFLAGS) -o scextest $^ $(SYSLIBS) $(LTLINKBINOPTS) | 
|---|
| 70 |  | 
|---|
| 71 | scextest.$(OBJSUF): scextest.cc | 
|---|
| 72 | $(LTCOMP) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -DSRCDIR=\"$(SRCDIR)\" -c $< | 
|---|
| 73 |  | 
|---|
| 74 | kvopt: kvopt.$(OBJSUF) $(shell $(LISTLIBS) $(INCLUDE) $(SRCDIR)/LIBS.h) | 
|---|
| 75 | $(LTLINK) $(LD) $(LDFLAGS) -o kvopt $^ $(SYSLIBS) $(LTLINKBINOPTS) | 
|---|
| 76 |  | 
|---|
| 77 | include $(SRCDIR)/$(TOPDIR)/lib/GlobalRules | 
|---|
| 78 |  | 
|---|
| 79 | kvopt.d opttest.d scextest.d $(LIBOBJ:.$(OBJSUF)=.d): $(DEPENDINCLUDE) | 
|---|
| 80 | ifneq ($(DODEPEND),no) | 
|---|
| 81 | include $(LIBOBJ:.$(OBJSUF)=.d) kvopt.d opttest.d scextest.d | 
|---|
| 82 | endif | 
|---|
| 83 |  | 
|---|