From 6141218beacc68967cb7265cf9f6bf70120f1d0d Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Thu, 27 Aug 2015 15:43:47 +0100 Subject: [PATCH] Windows port: rename arch to mingw --- .../tecio/tecsrc/Make/tecioOptions | 4 ++++ src/dbns/Make/options | 14 +++++++++----- .../scotchDecomp/Make/options | 14 ++++++++++---- src/foam/Make/options | 10 +++++++--- .../MGridGenGamgAgglomeration/Make/options | 12 +++++++++--- wmake/rules/mingw64/c | 16 ++++++++++++++++ 6 files changed, 55 insertions(+), 15 deletions(-) create mode 100644 wmake/rules/mingw64/c diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/Make/tecioOptions b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/Make/tecioOptions index cb1c12e73..246c6d1b3 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/Make/tecioOptions +++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/Make/tecioOptions @@ -20,6 +20,10 @@ TECIO_FLAGS = -DMAKEARCHIVE -DLINUX -DLINUX64 -DUSEENUM -DTHREED -U_WIN32 -DENGINE +#elif defined(mingw) + + TECIO_FLAGS = -DMAKEARCHIVE -DMSWIN -DUSEENUM -DTHREED -U_WIN32 -DENGINE + #else #error "architecture not supported for compiling tecio." diff --git a/src/dbns/Make/options b/src/dbns/Make/options index b8663b22b..c15372eed 100644 --- a/src/dbns/Make/options +++ b/src/dbns/Make/options @@ -1,5 +1,6 @@ -ifeq ($(WM_ARCH_BASE), mingw) -EXE_INC = -g \ +#if defined(mingw) + +EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ @@ -9,8 +10,10 @@ EXE_INC = -g \ LIB_LIBS = \ -lfiniteVolume \ -L$(PARMGRIDGEN_LIB_DIR) -lIMlib -lmgrid -else -EXE_INC = -g \ + +#else + +EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ @@ -21,4 +24,5 @@ EXE_INC = -g \ LIB_LIBS = \ -lfiniteVolume \ -L$(PARMGRIDGEN_LIB_DIR) -lIMlib -lMGridGen -endif \ No newline at end of file + +#endif \ No newline at end of file diff --git a/src/decompositionMethods/scotchDecomp/Make/options b/src/decompositionMethods/scotchDecomp/Make/options index 2c01296c2..bb3091e12 100644 --- a/src/decompositionMethods/scotchDecomp/Make/options +++ b/src/decompositionMethods/scotchDecomp/Make/options @@ -2,22 +2,28 @@ EXE_INC = \ -I$(SCOTCH_INCLUDE_DIR) \ -I../decompositionMethods/lnInclude -ifeq ($(WM_ARCH_BASE), darwin) +#if defined(darwinIntel) + /* No librt for Mac OS X */ LIB_LIBS = \ -lfoam \ -L$(SCOTCH_LIB_DIR) -lscotch \ -L$(SCOTCH_LIB_DIR) -lscotcherrexit -else ifeq ($(WM_ARCH_BASE), mingw) + +#elif defined(mingw) + /* No librt for MinGW */ LIB_LIBS = \ -ldecompositionMethods \ -L$(SCOTCH_LIB_DIR) -lscotch \ -L$(SCOTCH_LIB_DIR) -lscotcherrexit \ -L$(OPENMPI_DIR)/lib -lmpi -else + +#else + LIB_LIBS = \ -L$(SCOTCH_LIB_DIR) -lscotch \ -L$(SCOTCH_LIB_DIR) -lscotcherrexit \ -lrt -endif + +#endif diff --git a/src/foam/Make/options b/src/foam/Make/options index 73f9f3b44..d15b24680 100644 --- a/src/foam/Make/options +++ b/src/foam/Make/options @@ -3,7 +3,8 @@ include $(RULES)/mplib$(WM_MPLIB) EXE_INC = $(PFLAGS) $(PINC)\ -I$(WM_THIRD_PARTY_DIR)/zlib-1.2.3 -ifeq ($(WM_ARCH_BASE), mingw) +#if defined(mingw) + LIB_LIBS = $(PLIBS)\ $(FOAM_LIBBIN)/libOSspecific.o \ -lz \ @@ -11,11 +12,14 @@ LIB_LIBS = $(PLIBS)\ -ldl \ -lpsapi \ -lpthread -else + +#else + LIB_LIBS = $(PLIBS)\ $(FOAM_LIBBIN)/libOSspecific.o \ -lz -endif + +#endif $(OBJECTS_DIR)/global.o: FORCE diff --git a/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options index 13a35803e..abee7e109 100644 --- a/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options +++ b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options @@ -1,11 +1,15 @@ ParMGridGen = $(WM_THIRD_PARTY_DIR)/packages/ParMGridGen-1.0 TYPE_REAL= + #if defined(WM_SP) + TYPE_REAL=-DTYPE_REAL + #endif -ifeq ($(WM_ARCH_BASE), mingw) +#if defined(mingw) + EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(PARMGRIDGEN_INCLUDE_DIR) \ @@ -14,7 +18,8 @@ EXE_INC = \ LIB_LIBS = \ -lfiniteVolume \ -L$(PARMGRIDGEN_LIB_DIR) -lmgrid -else +#else + EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(PARMGRIDGEN_INCLUDE_DIR)/Lib \ @@ -23,4 +28,5 @@ EXE_INC = \ LIB_LIBS = \ -L$(PARMGRIDGEN_LIB_DIR) -lMGridGen -endif + +#endif diff --git a/wmake/rules/mingw64/c b/wmake/rules/mingw64/c new file mode 100644 index 000000000..a8e588f66 --- /dev/null +++ b/wmake/rules/mingw64/c @@ -0,0 +1,16 @@ +.SUFFIXES: .c .h + +cWARN = -Wall + +cc = gcc + +include $(RULES)/c$(WM_COMPILE_OPTION) + +cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC -Dmingw + +ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@ + +LINK_LIBS = $(cDBUG) + +LINKLIBSO = $(cc) -shared +LINKEXE = $(cc) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs