2006-11-20 16:04:51 +01:00
|
|
|
CPP = g++
|
|
|
|
|
|
|
|
CPPFLAGS = -Wall
|
|
|
|
|
|
|
|
ifeq ($(shell uname -o), Cygwin)
|
|
|
|
# Detection of uninitialized variables is buggy in Cygwin and generates spurious warnings
|
|
|
|
CPPFLAGS += -Wno-uninitialized
|
|
|
|
CPPFLAGS += -mno-cygwin
|
|
|
|
DYNARE_M = dynare_m.exe
|
|
|
|
DYNARE_S = dynare_s.exe
|
2006-11-25 21:09:29 +01:00
|
|
|
else
|
2006-11-25 21:12:55 +01:00
|
|
|
DYNARE_M = dynare_m
|
|
|
|
DYNARE_S = dynare_s
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CROSS_WIN32), yes)
|
|
|
|
CPP = i586-mingw32msvc-g++
|
2006-11-28 12:56:02 +01:00
|
|
|
# Detection of uninitialized variables is buggy in MinGW and generates spurious warnings
|
|
|
|
CPPFLAGS += -Wno-uninitialized
|
2006-11-25 21:12:55 +01:00
|
|
|
DYNARE_M = dynare_m.exe
|
|
|
|
DYNARE_S = dynare_s.exe
|
2006-11-20 16:04:51 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(DEBUG),yes)
|
|
|
|
CPPFLAGS += -ggdb
|
|
|
|
else
|
|
|
|
CPPFLAGS += -O3
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(VALGRIND), yes)
|
|
|
|
CPPFLAGS = -Wall -O -g -fno-inline
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
COMMON_OBJ=\
|
|
|
|
DynareFlex.o\
|
|
|
|
DynareBison.o\
|
|
|
|
ComputingTasks.o\
|
|
|
|
DynareMain.o\
|
|
|
|
ModelTree.o\
|
|
|
|
NumericalConstants.o\
|
|
|
|
NumericalInitialization.o\
|
|
|
|
Shocks.o\
|
|
|
|
SigmaeInitialization.o\
|
|
|
|
SymbolTable.o\
|
|
|
|
TmpSymbolTable.o\
|
|
|
|
VariableTable.o\
|
|
|
|
ParsingDriver.o\
|
2006-11-28 12:56:02 +01:00
|
|
|
DataTree.o \
|
2006-12-12 12:54:30 +01:00
|
|
|
ModFile.o \
|
2007-01-09 20:00:05 +01:00
|
|
|
Statement.o \
|
2007-02-22 00:28:16 +01:00
|
|
|
ExprNode.o \
|
|
|
|
ModelNormalization.o \
|
|
|
|
ModelBlocks.o \
|
|
|
|
BlockTriangular.o \
|
|
|
|
Model_Graph.o \
|
|
|
|
SymbolGaussElim.o
|
2006-11-20 16:04:51 +01:00
|
|
|
|
|
|
|
MATLAB_OBJ = InterfaceMatlab.o
|
|
|
|
|
|
|
|
SCILAB_OBJ = InterfaceScilab.o
|
|
|
|
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
### Build ######################################################################
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
all: $(DYNARE_M) $(DYNARE_S)
|
|
|
|
|
|
|
|
$(DYNARE_M): $(COMMON_OBJ) $(MATLAB_OBJ)
|
|
|
|
$(CPP) $(CPPFLAGS) -o $(DYNARE_M) $(COMMON_OBJ) $(MATLAB_OBJ)
|
|
|
|
cp $(DYNARE_M) ../matlab/
|
|
|
|
|
|
|
|
$(DYNARE_S): $(COMMON_OBJ) $(SCILAB_OBJ)
|
|
|
|
$(CPP) $(CPPFLAGS) -o $(DYNARE_S) $(COMMON_OBJ) $(SCILAB_OBJ)
|
|
|
|
cp $(DYNARE_S) ../scilab/
|
|
|
|
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
### Compile ####################################################################
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
%.o : %.cc
|
|
|
|
$(CPP) $(CPPFLAGS) -MD -I include -c $<
|
|
|
|
@cp $*.d $*.P; \
|
|
|
|
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
|
|
|
|
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
|
|
|
|
rm -f $*.d
|
|
|
|
|
|
|
|
-include $(COMMON_OBJ:.o=.P) $(MATLAB_OBJ:.o=.P) $(SCILAB_OBJ:.o=.P)
|
|
|
|
|
|
|
|
DynareFlex.cc: DynareFlex.ll include/DynareBison.hh include/ParsingDriver.hh
|
|
|
|
flex -oDynareFlex.cc DynareFlex.ll
|
|
|
|
|
|
|
|
DynareBison.cc include/DynareBison.hh: DynareBison.yy include/ParsingDriver.hh
|
|
|
|
bison --verbose -o DynareBison.cc DynareBison.yy
|
|
|
|
mv DynareBison.hh location.hh stack.hh position.hh include/
|
|
|
|
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
### Clean ######################################################################
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o *.P \
|
|
|
|
*~ include/*~ \
|
|
|
|
DynareBison.output \
|
|
|
|
DynareFlex.cc \
|
|
|
|
$(DYNARE_M) \
|
|
|
|
$(DYNARE_S)
|
|
|
|
|
2007-02-05 10:55:41 +01:00
|
|
|
distclean: clean
|
|
|
|
rm -f DynareBison.cc \
|
|
|
|
include/position.hh \
|
|
|
|
include/stack.hh \
|
|
|
|
include/location.hh \
|
|
|
|
include/DynareBison.hh
|
2007-06-07 14:38:25 +02:00
|
|
|
|