diff --git a/src/parallel/decompose/ptscotchDecomp/Make/options b/src/parallel/decompose/ptscotchDecomp/Make/options index e50518232443d115e28bbe11d4221711e732f8f1..8cd4aa7b582c41172be2877b6994b4ed885513ef 100644 --- a/src/parallel/decompose/ptscotchDecomp/Make/options +++ b/src/parallel/decompose/ptscotchDecomp/Make/options @@ -24,6 +24,6 @@ LIB_LIBS = \ -lscotch /* May require librt, but scotch does not declare the dependency */ -ifeq ("$(SO)","so") +ifeq ("$(EXT_SO)", ".so") LIB_LIBS += -lrt endif diff --git a/src/parallel/decompose/scotchDecomp/Make/options b/src/parallel/decompose/scotchDecomp/Make/options index d4e3013991ce088f291f5347c8e0d8a55d9b3140..c605567ed60951c7b042093ec8b1820191a85333 100644 --- a/src/parallel/decompose/scotchDecomp/Make/options +++ b/src/parallel/decompose/scotchDecomp/Make/options @@ -7,6 +7,6 @@ LIB_LIBS = \ -lscotch -lscotcherrexit /* May require librt, but scotch does not declare the dependency */ -ifeq ("$(SO)","so") +ifeq ("$(EXT_SO)", ".so") LIB_LIBS += -lrt endif diff --git a/wmake/makefiles/general b/wmake/makefiles/general index a8c81c4e25231d47492dc9d591838a0ef0c22545..6b7fc6e4b6ce8d7d47b8d26d71d56c341aee902f 100644 --- a/wmake/makefiles/general +++ b/wmake/makefiles/general @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | +# \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -70,21 +70,23 @@ LIB_LIBS = # Declare default name of libraries and executables #------------------------------------------------------------------------------ -# Library -LIB = libNULL +# Shared library extension (with '.' separator) +EXT_SO = .so -# Shared library extension -ifneq (,$(findstring darwin,$(WM_ARCH))) -SO = dylib -else -SO = so -endif +# Executable extension (with '.' separator) +EXE_EXT = + +# Library (default which is to be overridden) +LIB = libNULL + +# Project executable (default which is to be overridden) +EXE = $(WM_PROJECT).out -# Project executable -EXE = $(WM_PROJECT).out +# Standalone executable (default which is to be overridden) +SEXE = a.out -# Standalone executable -SEXE = a.out +#DEBUG $(info "EXE_SO = ${EXE_SO}") +#DEBUG $(info "EXE_EXT = ${EXE_EXT}") #------------------------------------------------------------------------------ @@ -127,28 +129,28 @@ LIB_HEADER_DIRS = \ #------------------------------------------------------------------------------ .PHONY: all -all: $(EXE) +all: $(EXE)$(EXE_EXT) @: .PHONY: silent silent: @: -$(EXE): $(OBJECTS) +$(EXE)$(EXE_EXT): $(OBJECTS) @$(WM_SCRIPTS)/makeTargetDir $(EXE) - $(call QUIET_MESSAGE,ld,$(EXE)) + $(call QUIET_MESSAGE,ld,$(EXE)$(EXE_EXT)) $E $(LINKEXE) $(OBJECTS) -L$(LIB_PLATFORMS) \ $(EXE_LIBS) $(PROJECT_LIBS) $(SYS_LIBS) \ - $(LINK_LIBS) $(GLIBS) -o $(EXE) + $(LINK_LIBS) $(GLIBS) -o $(EXE)$(EXE_EXT) .PHONY: exe -exe: $(SEXE) | silent +exe: $(SEXE)$(EXE_EXT) | silent -$(SEXE): $(OBJECTS) +$(SEXE)$(EXE_EXT): $(OBJECTS) @$(WM_SCRIPTS)/makeTargetDir $(SEXE) - $(call QUIET_MESSAGE,ld,$(SEXE)) + $(call QUIET_MESSAGE,ld,$(SEXE)$(EXE_EXT)) $E $(LINKEXE) $(OBJECTS) $(EXE_LIBS) \ - $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(SEXE) + $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(SEXE)$(EXE_EXT) #------------------------------------------------------------------------------ @@ -159,13 +161,13 @@ $(SEXE): $(OBJECTS) objects: $(OBJECTS) | silent .PHONY: libso -libso: $(LIB).$(SO) | silent +libso: $(LIB)$(EXT_SO) | silent -$(LIB).$(SO): $(OBJECTS) +$(LIB)$(EXT_SO): $(OBJECTS) @$(WM_SCRIPTS)/makeTargetDir $(LIB) - $(call QUIET_MESSAGE,ld,$(LIB).$(SO)) + $(call QUIET_MESSAGE,ld,$(LIB)$(EXT_SO)) $E $(LINKLIBSO) $(OBJECTS) -L$(LIB_PLATFORMS) \ - $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB).$(SO) + $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB)$(EXT_SO) .PHONY: lib lib: $(LIB).a | silent diff --git a/wmake/rules/General/general b/wmake/rules/General/general index 96978a171260f7043b0de0e1bde0a1eceb6cd0f1..ebba2fd924a5071a8d36b77cc724393314d560ba 100644 --- a/wmake/rules/General/general +++ b/wmake/rules/General/general @@ -31,5 +31,4 @@ sinclude $(RULES)/general sinclude $(RULES)/c++ include $(GENERAL_RULES)/transform - #------------------------------------------------------------------------------ diff --git a/wmake/rules/darwin64Clang/general b/wmake/rules/darwin64Clang/general index 967ca8178c2d0dab927eb66187c507981dfbd3a3..2eb439fe7d48e20ffaa57376000bf1aeeaa971f6 100644 --- a/wmake/rules/darwin64Clang/general +++ b/wmake/rules/darwin64Clang/general @@ -7,3 +7,8 @@ include $(GENERAL_RULES)/Clang/openmp include $(DEFAULT_RULES)/c include $(DEFAULT_RULES)/c++ + +# Shared library extension (with '.' separator) +EXT_SO = .dylib + +# -----------------------------------------------------------------------------