# THIS FILE IS DEPRECATED - 20-Dec-2005 # # General Jamrules support file for building Ascend4 # (see http://www.freetype.org/jam/index.html) # # This file is part of the Ascend Build System. # # Copyright (C) 2005 Jerry D. St.Clair # # The Ascend Build System 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 2 of the License, or (at your option) any later version. # # This program is distributed in 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 the program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139 USA. # Check the file named COPYING. #--------------------------------------------------------------------------- # # UNDER CONSTRUCTION # # This is a template Jamrules file which supports building the # Ascend libraries and executables. It contains general variable # and rule definitions required for execution of jam in any of the # source subdirectories. The Ascend jam build system currently # supports the MSVC, Borland, MinGW, and Watcom compilers # (extension to gcc on Linux is on the TODO: list). # # This file is not currently customized by the configure mechanism, # although this may be implemented in the future. # # Users should copy/rename this file to 'Jamrules_general', then # modify the settings manually for their particular system. # Ascend cannot be built by jam unless the Jamrules_general file # is present. # # User-customized Jamrules_general files should not be placed in # version control. Only the Jamrules_general.in template should # be versioned. # #--------------------------------------------------------------------------- # Comment to compile with debugging & assertions enabled. # Should be commented for regression tests to work properly. NODEBUG = 1 ; # Comment to compile without using the Epperly malloc debugger # Should be UNcommented for regression tests to work properly. #DEBUG_MALLOC = -DMALLOC_DEBUG ; #====================================================================== # PACKAGES # # Package settings for building Ascend. # Packages are bits of compiled code that represent models, or solvers, # or, in general, any bits of external code. # # Choose one of the following, comment out the others: # STATIC_PACKAGES packages should be statically linked/loaded # DYNAMIC_PACKAGES packages should be dynamically linked/loaded # NO_PACKAGES no packages # # If STATIC_PACKAGES are chosen, also indicate the location of # the packages in PACK_LIBS. Otherwise leave PACK_LIBS empty. #====================================================================== #PACKAGE_FLAGS = -DSTATIC_PACKAGES ; PACKAGE_FLAGS = -DDYNAMIC_PACKAGES ; #PACKAGE_FLAGS = -DNO_PACKAGES ; PACK_LIBS = $(ASC_PACKAGES_LIB_PATH) ; #PACK_LIBS = ; #====================================================================== # SIGNAL TRAPS # # If you want to be able to interrupt ASCEND with ctrl-C, then comment the # following line. Uncomment the line for the default (can't interrupt with # ctrl-C) behaviour. # # Comment the line for regression testing to work properly. #====================================================================== CCFLAGS += -DNO_SIGINT_TRAP -DNO_SIGSEGV_TRAP ; #--------------------------------------------------------------------------- # Tools required for complete build (comment out if not present). # The build system works around their absence if necessary. # Note that they are available for Windows, for example: # http://sourceforge.net/projects/gnuWin32 SED = sed ; YACC = yacc ; YACCFLAGS = -d ; YACCFILES = y.tab ; LEX = flex ; # Location of system libraries on Linux. # TODO This is a hack and needs to be redone. if $(UNIX) || $(OS) = LINUX { DL_LIB_DIRS = /usr/lib ; X11_LIB_DIRS = /usr/X11R6/lib ; MATH_LIB_DIRS = /usr/lib ; FOR_LIB_DIRS = /usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1 ; } #====================================================================== # General build options #====================================================================== # Build directory - - will be qualified for compiler & build type BUILD_DIR_ROOT = $(DOT) ; # Comment for normal jam deletion of object files after building targets KEEPOBJS = true ; # platform-independent options # sizeof(void*) - change value if not a typical 32-bit system SIZEOF_VOIDPTR = 4 ; # Added $(PACKAGE_FLAGS) CCFLAGS += $(PACKAGE_FLAGS) -DSIZEOF_VOID_P=$(SIZEOF_VOIDPTR) ; if $(NODEBUG) { CCFLAGS += -DNDEBUG ; BUILD_SUBDIR = $(SLASH)Release ; } else { BUILD_SUBDIR = $(SLASH)Debug ; } # platform- & complier-specific options if $(NT) { # Windows-specific defines CCFLAGS += -D_X86_=1 -DWIN32 -D_WIN32 -DASC_BUILD_LIB ; SUFSHR = .dll ; if $(BCCROOT) || ( $(TOOLSET) = BORLANDC ) { FORTRAN = ; CCFLAGS += -q -d -g0 -j0 -K -DMOD_ASCMALLOC ; CCWARN = -w ; if $(NODEBUG) { CCDEBUG = -v- -O2 ; } else { CCDEBUG = -v -y -Od ; } C++FLAGS = $(CCFLAGS) ; COFF2OMF = coff2omf ; # add location if not in path BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)bcc ; } else if $(MSVCNT) || ( $(TOOLSET) = VISUALC ) { FORTRAN = ; CCFLAGS += /Ze ; CCWARN = /W4 ; if $(NODEBUG) { CCDEBUG = /O2 ; } else { CCDEBUG = /Zi /Od ; } # Libraries are in different paths depending on VC version LINKFLAGS += /LIBPATH:$(VISUALC)\\lib /LIBPATH:$(VISUALC)\\PlatformSDK\\lib\\ ; LINKLIBS = advapi32.lib libc.lib oldnames.lib gdi32.lib user32.lib kernel32.lib ; BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)msvc ; } else if $(MINGW) || ( $(TOOLSET) = MINGW ) { FORTRANFLAGS = -c -I4 -O ; F77_LIBS += $(MINGW)$(SLASH)lib$(SLASH)libg2c.a ; CCFLAGS += -DHAVE_ERF=1 ; # uncomment to select desired warning level and ansi-strictness CCWARN += -Wall ; CCWARN += -W ; CCWARN += -pedantic ; #CCWARN += -Wshadow ; #CCWARN += -ansi ; CCWARN += -std=c99 ; if $(NODEBUG) { CCDEBUG = -O3 ; } else { CCDEBUG = -g -O0 ; CCFLAGS += -ggdb ; } C++FLAGS = $(CCFLAGS) ; BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)mingw ; } else if $(WATCOM) || ( $(TOOLSET) = WATCOM ) { FORTRANFLAGS = /NOER ; CCFLAGS += /fr /dMOD_ASCMALLOC ; CCWARN = /wx ; if $(NODEBUG) { CCDEBUG = /ox ; FORTRANFLAGS += /OX ; } else { CCDEBUG = /od /d2 ; FORTRANFLAGS += /OD /D2 ; } BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)watcom ; } } else if $(UNIX) || $(OS) = LINUX { SUFSHR = .so ; if $(CC) = gcc { if $(NODEBUG) { CCDEBUG = -O3 ; } else { CCDEBUG = -g -O0 ; Echo "DEBUGGER SYMBOLS TURNED ON" ; CCFLAGS += -ggdb ; } # uncomment to select desired warning level and ansi-strictness CCWARN += -Wall ; CCWARN += -W ; CCWARN += -pedantic ; #CCWARN += -Wshadow ; #CCWARN += -ansi ; CCWARN += -std=c99 ; FORTRANFLAGS = -c -I4 -O ; } BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)linux ; } CCFLAGS += $(CCWARN) $(CCDEBUG) $(DEBUG_MALLOC) ; C++FLAGS = $(CCFLAGS) ; BUILD_DIR = $(BUILD_DIR_ROOT)$(BUILD_SUBDIR) ; #====================================================================== # Ascend base library names & paths #====================================================================== ASC_COMPILER_LIBROOT = libasccompiler ; ASC_GENERAL_LIBROOT = libascgeneral ; ASC_SOLVER_LIBROOT = libascsolver ; ASC_UTILITIES_LIBROOT = libascutilities ; ASC_PACKAGES_LIBROOT = libascpackages ; ASC_COMPILER_LIB = $(ASC_COMPILER_LIBROOT)$(SUFLIB) ; ASC_GENERAL_LIB = $(ASC_GENERAL_LIBROOT)$(SUFLIB) ; ASC_SOLVER_LIB = $(ASC_SOLVER_LIBROOT)$(SUFLIB) ; ASC_UTILITIES_LIB = $(ASC_UTILITIES_LIBROOT)$(SUFLIB) ; ASC_PACKAGES_LIB = $(ASC_PACKAGES_LIBROOT)$(SUFLIB) ; ASC_BASE_LIBS = $(ASC_COMPILER_LIB) $(ASC_GENERAL_LIB) $(ASC_PACKAGES_LIB) $(ASC_SOLVER_LIB) $(ASC_UTILITIES_LIB) ; ASC_BASE_LIBS_WITH_RELPATH = compiler$(SLASH)$(ASC_COMPILER_LIB) general$(SLASH)$(ASC_GENERAL_LIB) packages$(SLASH)$(ASC_PACKAGES_LIB) solver$(SLASH)$(ASC_SOLVER_LIB) utilities$(SLASH)$(ASC_UTILITIES_LIB) ; # Path to base library sources & libs from top-level jam directory ASC_BASE_SOURCE_RELPATH = ..$(SLASH)base$(SLASH)generic ; ASC_BASE_LIBS_RELPATH = ..$(SLASH)base$(SLASH)jam$(SLASH)$(BUILD_DIR)$(SLASH) ; #====================================================================== # SOLVERS / INTEGRATORS # # If you are linking to MINOS or other external solvers, the solver # interface needs to know about it. # Set the comment flags as appropriate on the following definitions. # If the settings here do not match the libraries you link, you will # almost certainly get runtime errors if not link errors. #====================================================================== # >>>> UNDER CONSTRUCTION <<<< # Slv is the original ASCEND nonlinear solver. It is not currently supported. # to build with slv, uncomment the next line. #SOLVER_DEFS += -DSTATIC_SLV ; # Opt is not currently supported. # to build with optsqp, uncomment the next line #SOLVER_DEFS += -DSTATIC_OPTSQP ; # QRSlv is the current ASCEND nonlinear algebraic solver. # to build with qrslv, uncomment the next line SOLVER_DEFS += -DSTATIC_QRSLV ; # makeMPS is currently not supported. # to build with mps, uncomment the next line #SOLVER_DEFS += -DSTATIC_MPS ; # to build with ngslv, uncomment the next line #SOLVER_DEFS += -DSTATIC_NGSLV ; # to build with cmslv (requires CONOPT), uncomment the next line #SOLVER_DEFS += -DSTATIC_CMSLV ; # to build with lrslv, uncomment the next line #SOLVER_DEFS += -DSTATIC_LRSLV ; # TODO the configure script sets the following depending on its search for minos. # Minos is an external solver. It is not currently supported. # to force a build WITHOUT minos, comment the next line #SOLVER_DEFS += -DSTATIC_MINOS ; # # Name & path to the minos library #MINOSLIB = ; #MINOSLIB_RELPATH = ; # TODO the configure script sets the following depending on its search for conopt. # to force a build WITHOUT conopt, comment the next line #SOLVER_DEFS += -DSTATIC_CONOPT ; # # Path to the conopt library #CONOPTLIB = ; #CONOPTLIB_RELPATH = ; # TODO the configure script sets the following depending on its search for lsode. # Choose one of the following to build with lsode, comment both to build WITHOUT lsode SOLVER_DEFS += -DSTATIC_LSOD ; #SOLVER_DEFS += -DDYNAMIC_LSOD ; # # Name & path to the lsode library. Comment out if not using lsode. ASC_LSOD_LIBROOT = liblsode ; ASC_LSOD_LIB = $(ASC_LSOD_LIBROOT)$(SUFLIB) ; LSODLIB_RELPATH = ..$(SLASH)lsod$(SLASH)jam$(SLASH)$(BUILD_DIR) ; LSODLIB = $(ASC_LSOD_LIB) ; #====================================================================== # FORTRAN options - set to override compiler defaults #====================================================================== # Your FORTRAN compiler #FORTRAN = g77 ; # Fortran compilation flags & options: # These are used for making the ASCEND libraries based on FORTRAN codes. # These should be set to get the best performance possible out of your # f77 compiler without optimizing away functions that are not obviously # called, as some compilers do by default. # #FORTRANFLAGS = -c -I4 -O -lg2c ; # F77LIBS is for the base f77 libraries. If you are linking no f77 # objects to ascend, it may be left undefined. # Set F77LIBS appropriate for your machine and desired loader behavior. # #F77_LIBS = ; if $(UNIX) || $(OS) = LINUX { F77_LIBS = -L$(FOR_LIB_DIRS) -lg2c ; } #====================================================================== # FORTRAN Support Libraries # # Point BLASLIB and LPAKLIB to machine-specific BLAS and LINPACK # libraries (if you have them) to get the best speed out of ASCEND. # Otherwise, generic versions can be built if FORTRAN is available. #====================================================================== # Name & path to the blas library ASC_BLAS_LIBROOT = libblas ; ASC_BLAS_LIB = $(ASC_BLAS_LIBROOT)$(SUFLIB) ; BLASLIB_RELPATH = ..$(SLASH)blas$(SLASH)jam$(SLASH)$(BUILD_DIR) ; BLASLIB = $(ASC_BLAS_LIB) ; # Name & path to the linpack library ASC_LINPACK_LIBROOT = liblpak ; ASC_LINPACK_LIB = $(ASC_LINPACK_LIBROOT)$(SUFLIB) ; LPAKLIB_RELPATH = ..$(SLASH)linpack$(SLASH)jam$(SLASH)$(BUILD_DIR) ; LPAKLIB = $(ASC_LINPACK_LIB) ; #====================================================================== # Math libraries #====================================================================== if $(UNIX) || $(OS) = LINUX { MATH_LIBS = -L$(MATH_LIB_DIRS) -lieee -lm ; } #====================================================================== # Dynamic loading support #====================================================================== if $(UNIX) || $(OS) = LINUX { DL_LIBS = -L$(DL_LIB_DIRS) -ldl ; } #====================================================================== # X11 #====================================================================== if $(UNIX) || $(OS) = LINUX { X11_LIBS = -L$(X11_LIB_DIRS) -lX11 ; } #====================================================================== # Ascend-specific jam instructions #====================================================================== #---------------------------------------------------------------------- # LEX_or_copy # # Generates a c source file using the lexer defined by $(LEX), # or by copying a specified file if $(LEX) is not defined. # The following parameters are used: # # 1 source file to generate # 2 lex/flex definition file # 3 pre-generated source file to copy if $(LEX) is empty # 4 header file associated with the source file, if any #---------------------------------------------------------------------- rule LEX_or_copy { if $(LEX) { Echo Generating $(1) from $(LEX) ; DEPENDS $(1) : $(2) ; Lex_with_options $(1) : $(2) ; } else { Echo Copying $(1) from $(4) ; File $(1) : $(3) ; } # make the header dependent if $(4) { INCLUDES $(1) : $(4) ; } Clean clean : $(1) ; } # run LEX using options specified in LEXOPTS actions Lex_with_options { $(LEX) $(LEXOPTS) -o$(1) $(2) }