diff --git a/src/tools/win_makefile b/src/tools/win_makefile index b076e7f32d..6cfd6f1b53 100644 --- a/src/tools/win_makefile +++ b/src/tools/win_makefile @@ -18,15 +18,14 @@ # this to the svn repository # -topdir = `echo $(CURDIR) | sed 's/^\//C:\/cygwin\//g' | sed 's/\/src\/tools//g'` -install_dir = ${prefix} -libdir = ${prefix}/lib -bindir = ${prefix}/bin -incdir = ${prefix}/include +topdir := $(shell cygpath -m $(CURDIR))/../.. +installdir = ${topdir}/src/Debug +libdir = ${installdir}/lib +bindir = ${installdir}/bin +incdir = ${installdir}/include # list of components to build with the c compiler C_SUBDIRS = \ - mpirun \ ompid # list of components to build with the cpp compiler @@ -38,23 +37,42 @@ CC = cl INCL = \ /I"${topdir}/src/win32/generated_include" \ - /I"${topdir}/src/win32/" \ + /I"${topdir}/src/win32" \ + /I"${topdir}/include" \ /I"${topdir}/src" \ - /I"${topdir}/include" + /I"${topdir}/src/event/compat/" \ + /I"${topdir}/src/event" \ + /I"${topdir}/src/event/WIN32-Code/" CFLAGS = \ /DWIN32 \ - /DOMPI_SYSCONFDIR="\"${prefix}/share\"" \ - /nologo + /DOMPI_BUILDING=0 \ + /DHAVE_CONFIG_H \ + /DOMPI_SYSCONFDIR="\"${installdir}/share\"" \ + /EHsc \ + /ML \ + /W0 \ + /Wp64 \ + /TC \ + /D_MBCS \ + /LD\ + /nologo \ + /c CPPFLAGS = \ /DWIN32 \ - /DOMPI_SYSCONFDIR="\"${prefix}/share\"" \ - /c \ /TP \ - /Zi \ + /DOMPI_BUILDING=0 \ + /DHAVE_CONFIG_H \ + /DOMPI_SYSCONFDIR="\"${installdir}/share\"" \ + /EHsc \ + /ML \ + /W0 \ + /Wp64 \ + /D_MBCS \ + /LD \ /nologo \ - /EHsc + /c ADD_INCL = \ /DOMPI_WANT_F90_BINDINGS="\"not implemented\"" \ @@ -70,12 +88,12 @@ ADD_INCL = \ /DOMPI_BUILD_FCFLAGS="\"not implemented\"" \ /DOMPI_BUILD_LDFLAGS="\"not implemented\"" \ /DOMPI_BUILD_LIBS="\"not implemented\"" \ - /DOMPI_MAJOR_VERSION="\"not implemented\"" \ - /DOMPI_MINOR_VERSION="\"not implemented\"" \ - /DOMPI_RELEASE_VERSION="\"not implemented\"" \ - /DOMPI_ALPHA_VERSION="\"not implemented\"" \ - /DOMPI_BETA_VERSION="\"not implemented\"" \ - /DOMPI_SVN_VERSION="\"not implemented\"" \ + /DOMPI_MAJOR_VERSION=1 \ + /DOMPI_MINOR_VERSION=0 \ + /DOMPI_RELEASE_VERSION=0 \ + /DOMPI_ALPHA_VERSION=0 \ + /DOMPI_BETA_VERSION=0 \ + /DOMPI_SVN_VERSION=0 \ /DOMPI_PREFIX="\"${prefix}\"" \ /DOMPI_BINDIR="\"${bindir}\"" \ /DOMPI_LIBDIR="\"${libdir}\"" \ @@ -90,23 +108,51 @@ OMPILIB = \ LINK = link LINKFLAGS = \ - /DLL \ - /DEFAULTLIB:${OMPILIB} + /OPT:NOICF \ + /OPT:NOREF \ + /DEFAULTLIB:${OMPILIB} \ + /nologo + +ADDLIBS = \ + ws2_32.lib \ + kernel32.lib \ + user32.lib \ + gdi32.lib \ + winspool.lib \ + comdlg32.lib \ + advapi32.lib \ + shell32.lib \ + ole32.lib \ + oleaut32.lib \ + uuid.lib \ + odbc32.lib \ + odbccp32.lib all: \ - cexes + cexes \ + cppexecs cexes: ${C_SUBDIRS} @for dirs in ${C_SUBDIRS}; do \ - (echo "Entering $$dirs"; cd $$dirs; ${CC} ${CFLAGS} ${INCL} *.c ${OMPILIB};); \ + (echo "Entering $$dirs"; cd $$dirs; ${CC} ${CFLAGS} ${INCL} *.c; ${LINK} ${LINKFLAGS} ${ADDLIBS} *.obj;); \ done -cpplibs: ${CPP_SUBDIRS} +cppexecs: ${CPP_SUBDIRS} @for dirs in ${CPP_SUBDIRS}; do \ - (echo "Entering $$dirs"; cd $$dirs; ${CC} ${CPPFLAGS} ${INCL} ${ADD_INCL} *.cc ${OMPILIB};); \ + (echo "Entering $$dirs"; cd $$dirs; ${CC} ${CPPFLAGS} ${INCL} ${ADD_INCL} *.cc; ${LINK} ${LINKFLAGS} ${ADDLIBS} *.obj;); \ done -install: +install: win_makefile + @echo -n "Installing components ......................." + @for dirs in ${C_SUBDIRS}; do \ + install -d ${CURDIR}/$${dirs}/ ${bindir}; \ + install -p ${CURDIR}/$${dirs}/$${dirs}.exe ${installdir}/$${dirs}.exe; \ + done + @for dirs in ${CPP_SUBDIRS}; do \ + install -d ${CURDIR}/$${dirs}/ ${bindir}; \ + install -p ${CURDIR}/$${dirs}/$${dirs}.exe ${installdir}/$${dirs}.exe; \ + done + @echo "done" .PHONY: clean @@ -114,6 +160,6 @@ clean: @for dirs in ${C_SUBDIRS}; do \ (echo "Entering $$dirs"; cd $$dirs; rm -rf *.lib *.obj *.exp;); \ done - @for dirs in ${C_PPSUBDIRS}; do \ + @for dirs in ${CPP_SUBDIRS}; do \ (echo "Entering $$dirs"; cd $$dirs; rm -rf *.lib *.obj *.exp;); \ done