mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: add wmake rules for mingw (#1238)
This commit is contained in:
committed by
Andrew Heather
parent
07ec741e2a
commit
a54aff9d26
@ -163,11 +163,19 @@ objects: $(OBJECTS) | silent
|
||||
.PHONY: libso
|
||||
libso: $(LIB)$(EXT_SO) | silent
|
||||
|
||||
ifeq ("$(WM_OSTYPE)","MSwindows")
|
||||
$(LIB)$(EXT_SO): $(OBJECTS)
|
||||
@$(WM_SCRIPTS)/makeTargetDir $(LIB)
|
||||
$(call QUIET_MESSAGE,ld,$(LIB)$(EXT_SO))
|
||||
$E $(LINKLIBSO) $(OBJECTS) -L$(LIB_PLATFORMS) \
|
||||
$(PROJECT_LIBS) $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB)$(EXT_SO)
|
||||
else
|
||||
$(LIB)$(EXT_SO): $(OBJECTS)
|
||||
@$(WM_SCRIPTS)/makeTargetDir $(LIB)
|
||||
$(call QUIET_MESSAGE,ld,$(LIB)$(EXT_SO))
|
||||
$E $(LINKLIBSO) $(OBJECTS) -L$(LIB_PLATFORMS) \
|
||||
$(LIB_LIBS) $(GLIB_LIBS) -o $(LIB)$(EXT_SO)
|
||||
endif
|
||||
|
||||
.PHONY: lib
|
||||
lib: $(LIB).a | silent
|
||||
|
||||
28
wmake/rules/linux64Mingw/c
Normal file
28
wmake/rules/linux64Mingw/c
Normal file
@ -0,0 +1,28 @@
|
||||
include $(GENERAL_RULES)/Gcc/c
|
||||
|
||||
cARCH = -m64
|
||||
|
||||
cc = x86_64-w64-mingw32-gcc
|
||||
|
||||
include $(RULES)/c$(WM_COMPILE_OPTION)
|
||||
|
||||
cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS)
|
||||
|
||||
ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
|
||||
|
||||
LINK_LIBS = $(cDBUG)
|
||||
|
||||
LINKLIBSO = $(cc) $(cARCH) \
|
||||
-Wl,--output-def=$(LIB).def \
|
||||
-Wl,--out-implib,$(LIB).dll.a \
|
||||
-Wl,--no-undefined \
|
||||
-Wl,--enable-runtime-pseudo-reloc \
|
||||
-Wl,--enable-auto-import \
|
||||
-Wl,--enable-auto-image-base \
|
||||
-Wl,--strip-all \
|
||||
-shared
|
||||
|
||||
LINKEXE = $(cc) $(cARCH) \
|
||||
-Wl,--enable-auto-import \
|
||||
-Wl,--strip-all \
|
||||
-Wl,--force-exe-suffix
|
||||
35
wmake/rules/linux64Mingw/c++
Normal file
35
wmake/rules/linux64Mingw/c++
Normal file
@ -0,0 +1,35 @@
|
||||
include $(GENERAL_RULES)/Gcc/c++
|
||||
|
||||
c++ARCH = -m64
|
||||
|
||||
# With gnu++11 (not c++11) to ensure __STRICT_ANSI__ is not defined
|
||||
CC = x86_64-w64-mingw32-g++ -std=gnu++11
|
||||
|
||||
include $(RULES)/c++$(WM_COMPILE_OPTION)
|
||||
|
||||
c++FLAGS = $(c++ARCH) $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS)
|
||||
|
||||
Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
|
||||
cxxtoo = $(Ctoo)
|
||||
cctoo = $(Ctoo)
|
||||
cpptoo = $(Ctoo)
|
||||
|
||||
LINK_LIBS = $(c++DBUG)
|
||||
|
||||
# Using "-Wl,--no-undefined,--enable-runtime-pseudo-reloc"
|
||||
# does not forgive undefined symbols during linking
|
||||
|
||||
LINKLIBSO = $(CC) $(c++FLAGS) \
|
||||
-Wl,--output-def=$(LIB).def \
|
||||
-Wl,--out-implib=$(LIB).dll.a \
|
||||
-Wl,--no-undefined \
|
||||
-Wl,--enable-runtime-pseudo-reloc \
|
||||
-Wl,--enable-auto-import \
|
||||
-Wl,--enable-auto-image-base \
|
||||
-Wl,--strip-all \
|
||||
-shared
|
||||
|
||||
LINKEXE = $(CC) $(c++FLAGS) \
|
||||
-Wl,--enable-auto-import \
|
||||
-Wl,--strip-all \
|
||||
-Wl,--force-exe-suffix
|
||||
2
wmake/rules/linux64Mingw/c++Debug
Normal file
2
wmake/rules/linux64Mingw/c++Debug
Normal file
@ -0,0 +1,2 @@
|
||||
c++DBUG = -gstabs3 -DFULLDEBUG
|
||||
c++OPT = -O0 -fdefault-inline
|
||||
4
wmake/rules/linux64Mingw/c++Opt
Normal file
4
wmake/rules/linux64Mingw/c++Opt
Normal file
@ -0,0 +1,4 @@
|
||||
c++DBUG = -DNDEBUG
|
||||
c++OPT = -O3
|
||||
|
||||
ROUNDING_MATH = -frounding-math
|
||||
2
wmake/rules/linux64Mingw/c++Prof
Normal file
2
wmake/rules/linux64Mingw/c++Prof
Normal file
@ -0,0 +1,2 @@
|
||||
c++DBUG = -gstabs3 -pg
|
||||
c++OPT = -O2
|
||||
2
wmake/rules/linux64Mingw/cDebug
Normal file
2
wmake/rules/linux64Mingw/cDebug
Normal file
@ -0,0 +1,2 @@
|
||||
cDBUG = -gstabs3 -DFULLDEBUG
|
||||
cOPT = -O1 -finline-functions
|
||||
2
wmake/rules/linux64Mingw/cOpt
Normal file
2
wmake/rules/linux64Mingw/cOpt
Normal file
@ -0,0 +1,2 @@
|
||||
cDBUG = -DNDEBUG
|
||||
cOPT = -O3
|
||||
2
wmake/rules/linux64Mingw/cProf
Normal file
2
wmake/rules/linux64Mingw/cProf
Normal file
@ -0,0 +1,2 @@
|
||||
cDBUG = -gstabs3 -pg
|
||||
cOPT = -O2
|
||||
19
wmake/rules/linux64Mingw/general
Normal file
19
wmake/rules/linux64Mingw/general
Normal file
@ -0,0 +1,19 @@
|
||||
# Need -D_WIN32 -D__MINGW32__ if host cpp is used
|
||||
#CPP = /lib/cpp -traditional-cpp -D_WIN32 -D__MINGW32__ $(GFLAGS)
|
||||
|
||||
CPP = x86_64-w64-mingw32-cpp -traditional-cpp $(GFLAGS)
|
||||
LD = x86_64-w64-mingw32-ld
|
||||
AR = x86_64-w64-mingw32-ar
|
||||
RANLIB = x86_64-w64-mingw32-ranlib
|
||||
|
||||
PROJECT_LIBS = -l$(WM_PROJECT) -L$(FOAM_LIBBIN)/dummy -lPstream
|
||||
|
||||
include $(GENERAL_RULES)/standard
|
||||
|
||||
include $(DEFAULT_RULES)/c
|
||||
include $(DEFAULT_RULES)/c++
|
||||
|
||||
EXT_SO = .dll
|
||||
EXT_EXE = .exe
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
3
wmake/rules/linux64Mingw/mplibMSMPI
Normal file
3
wmake/rules/linux64Mingw/mplibMSMPI
Normal file
@ -0,0 +1,3 @@
|
||||
PFLAGS = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX
|
||||
PINC = -I$(MPI_ARCH_PATH)/include
|
||||
PLIBS = -L$(MPI_ARCH_PATH)/lib -L$(MPI_ARCH_PATH)/lib/x64 -lmsmpi
|
||||
Reference in New Issue
Block a user