Makefile for simulate DLL

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1428 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
ferhat 2007-10-15 09:05:19 +00:00
parent a5323768aa
commit 89f2702600
1 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,43 @@
CPP = g++
CPPFLAGS = -Wall
MATLABPATH = C:/MATLAB7
ifeq ($(shell uname -o), Cygwin)
# Detection of uninitialized variables is buggy in Cygwin and generates spurious warnings
CPPFLAGS += -Wno-uninitialized
CPPFLAGS += -mno-cygwin
endif
ifeq ($(CROSS_WIN32), yes)
CPP = i586-mingw32msvc-g++
# Detection of uninitialized variables is buggy in MinGW and generates spurious warnings
CPPFLAGS += -Wno-uninitialized
endif
ifeq ($(DEBUG),yes)
CPPFLAGS += -ggdb
else
CPPFLAGS += -O3 -DMATLAB_MEX_FILE -malign-double -fno-exceptions -mtune=pentium
endif
ifeq ($(VALGRIND), yes)
CPPFLAGS = -Wall -O -g -fno-inline
endif
################################################################################
### Build ######################################################################
################################################################################
all: simulate.o
dlltool --def c:/matlab7/extern/include/libmex.def --output-lib temp1.a
dlltool --def c:/matlab7/extern/include/libmx.def --output-lib temp2.a
$(CPP) -mno-cygwin -shared simulate.o -o ../../matlab/simulate.dll temp1.a temp2.a -lstdc++
rm -f temp1.a temp2.a simulate.d simulate.P
################################################################################
### Compile ####################################################################
################################################################################
simulate.o : ../simulate.cc
$(CPP) $(CPPFLAGS) -MD -I ../include -I $(MATLABPATH)/extern/include -c ../simulate.cc
@cp $*.d $*.P;