From 177da869b1493aa9716b164f0001a96da7eab46d Mon Sep 17 00:00:00 2001 From: sebastien Date: Thu, 23 Apr 2009 15:52:00 +0000 Subject: [PATCH] trunk: * use autoconf to create the preprocessor Makefile * the preprocessor now displays the version number * the top-level Makefile triggers compilation of the preprocessor and of the documentation git-svn-id: https://www.dynare.org/svn/dynare/trunk@2621 ac1d8469-bf42-47a9-8791-bf33cf982152 --- DynareMain.cc | 2 +- Makefile => Makefile.in | 47 ++++++++++------------------------------- 2 files changed, 12 insertions(+), 37 deletions(-) rename Makefile => Makefile.in (69%) diff --git a/DynareMain.cc b/DynareMain.cc index bb42e8d7..e00ee49a 100644 --- a/DynareMain.cc +++ b/DynareMain.cc @@ -91,7 +91,7 @@ main(int argc, char** argv) } } - cout << "Starting Dynare ..." << endl + cout << "Starting Dynare (version " << PACKAGE_VERSION << ")." << endl << "Starting preprocessing of the model file ..." << endl; // Construct basename (i.e. remove file extension if there is one) diff --git a/Makefile b/Makefile.in similarity index 69% rename from Makefile rename to Makefile.in index 587c7ba7..8dea6040 100644 --- a/Makefile +++ b/Makefile.in @@ -1,37 +1,12 @@ -CXXFLAGS = -Wall +CXX = @CXX@ +CXXFLAGS = @CXXFLAGS@ +CPPFLAGS = @CPPFLAGS@ @DEFS@ +LDFLAGS = @LDFLAGS@ -ifeq ($(shell uname -o), Cygwin) -# Detection of uninitialized variables is buggy in Cygwin and generates spurious warnings -CXXFLAGS += -Wno-uninitialized -CXXFLAGS += -mno-cygwin -endif +FLEX = @FLEX@ +BISON = @BISON@ -ifeq ($(CROSS_WIN32), yes) -CXX = i586-mingw32msvc-g++ -AR = i586-mingw32msvc-ar -# Detection of uninitialized variables is buggy in MinGW and generates spurious warnings -CXXFLAGS += -Wno-uninitialized -endif - -ifeq ($(DEBUG),yes) -CXXFLAGS += -ggdb -else -CXXFLAGS += -O3 -endif - -ifeq ($(VALGRIND), yes) -CXXFLAGS = -Wall -O -g -fno-inline -endif - -ifeq ($(shell uname -o), Cygwin) -DYNARE_M = dynare_m.exe -else -DYNARE_M = dynare_m -endif - -ifeq ($(CROSS_WIN32), yes) -DYNARE_M = dynare_m.exe -endif +DYNARE_M = dynare_m@EXEEXT@ MAIN_OBJS = \ DynareFlex.o \ @@ -79,16 +54,16 @@ $(DYNARE_M): $(MAIN_OBJS) $(MACRO_OBJS) # Build rules for Flex and Bison files DynareFlex.cc: DynareFlex.ll - flex -oDynareFlex.cc DynareFlex.ll + $(FLEX) -oDynareFlex.cc DynareFlex.ll DynareBison.cc DynareBison.hh location.hh stack.hh position.hh: DynareBison.yy - bison --verbose -o DynareBison.cc DynareBison.yy + $(BISON) --verbose -o DynareBison.cc DynareBison.yy macro/MacroFlex.cc: macro/MacroFlex.ll - cd macro && flex -oMacroFlex.cc MacroFlex.ll + cd macro && $(FLEX) -oMacroFlex.cc MacroFlex.ll macro/MacroBison.cc macro/MacroBison.hh macro/location.hh macro/stack.hh macro/position.hh: macro/MacroBison.yy - cd macro && bison --verbose -o MacroBison.cc MacroBison.yy + cd macro && $(BISON) --verbose -o MacroBison.cc MacroBison.yy # Dependencies