export CPP
export AR
export TARGET_PLATFORM
+export TARGET_ARCH
export RANLIB
+export PWD
release: all
# Win: enable_brew
ifeq ($(TARGET_PLATFORM),)
-ifeq ($(findstring darwin,$(OSTYPE)),darwin)
-export TARGET_PLATFORM=MAC
-else
-export TARGET_PLATFORM=MSW
-endif
+ ifeq ($(findstring darwin,$(OSTYPE)),darwin)
+ export TARGET_PLATFORM=MAC
+ else
+ export TARGET_PLATFORM=MSW
+ endif
endif
ifeq ($(TARGET_PLATFORM),MAC)
-FFLAGS=-std=legacy -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -arch x86_64
-LIBQUADMATH=/usr/local/gcc8/lib/libquadmath.a
-#FLDFLAGS= -nodefaultlibs -lgfortran-static -lgcc -lc -lm -lSystem -lSystemStubs -lgfortranbegin
-FLDFLAGS= -lgcc -lc -lm -lSystem -static-libgfortran -static-libgcc $(LIBQUADMATH)
-EXE_SUFFIX=
+ FFLAGS=-std=legacy -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -arch x86_64
+ LIBQUADMATH=/usr/local/gcc8/lib/libquadmath.a
+# FLDFLAGS= -nodefaultlibs -lgfortran-static -lgcc -lc -lm -lSystem -lSystemStubs -lgfortranbegin
+# FSTATICFLAGS= -static-libgcc -Wl,-Bstatic -lgfortran -lquadmath -Wl,-Bdynamic -lm
+ FSTATICFLAGS= -static-libgfortran -static-libgcc $(LIBQUADMATH)
+ FLDFLAGS= -lgcc -lc -lm -lSystem $(FSTATICFLAGS)
+ EXE_SUFFIX=
+ FORTRAN=gfortran
else
-CROSS_PREFIX=x86_64-w64-mingw32-
-FFLAGS=-std=legacy
-FLDFLAGS=-Wl,--stack=33554432 -static-libgcc -static-libgfortran
-EXE_SUFFIX=.exe
+ ifeq ($(TARGET_ARCH),x86_64)
+ CROSS_PREFIX=x86_64-w64-mingw32-
+ else
+ CROSS_PREFIX=i686-w64-mingw32-
+ endif
+ FFLAGS=-std=legacy
+ FSTATICFLAGS= -static-libgcc -Wl,-Bstatic -lgfortran -lquadmath -Wl,-Bdynamic -lm
+ FLDFLAGS=-Wl,--stack=33554432 $(FSTATICFLAGS)
+ EXE_SUFFIX=.exe
+ FORTRAN = gcc
endif
export FFLAGS
export FLDFLAGS
$(BUILDDIR)/ortep3$(EXE_SUFFIX) : $(TEPDIR)/$(TEPNAME).f
(mkdir -p $(OPWD)/$(BUILDDIR); cp -p $(TEPDIR)/$(TEPNAME).f $(OPWD)/$(BUILDDIR)/)
- (cd $(OPWD)/$(BUILDDIR) && $(CROSS_PREFIX)gfortran $(FFLAGS) -fno-automatic -O -w -c $(TEPNAME).f && $(CROSS_PREFIX)gfortran $(FFLAGS) $(FLDFLAGS) -O -w -o ortep3$(EXE_SUFFIX) $(TEPNAME).o)
+ (cd $(OPWD)/$(BUILDDIR) && $(CROSS_PREFIX)$(FORTRAN) $(FFLAGS) -fno-automatic -O -w -c $(TEPNAME).f && $(CROSS_PREFIX)$(FORTRAN) -o ortep3$(EXE_SUFFIX) $(TEPNAME).o $(FFLAGS) $(FLDFLAGS) -O -w)
clean :
rm -rf $(BUILDDIR)
uninstall:
-rm -f $(LIBDIR)/libmc.a
+# Somehow, build rule for %.o is broken here (I am sure I had done something wrong, but I cannot find
+# what it was). So a trivial rule is placed here. Toshi Nagata 2021/11/4
+%.o : %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
clog.o: clog.c complex.h protos.h
cmplx.o: cmplx.c complex.h protos.h
clogf.o: clogf.c complex.h protos.h
ISYSROOT=-isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -arch x86_64
endif
ifeq ($(TARGET_PLATFORM),MSW)
-CROSS_PREFIX=x86_64-w64-mingw32-
+ ifeq ($(TARGET_ARCH),x86_64)
+ CROSS_PREFIX=x86_64-w64-mingw32-
+ else
+ CROSS_PREFIX=i686-w64-mingw32-
+ endif
endif
BINDIR=$(AMBERHOME)/bin
CFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DBINTRAJ $(AMBERBUILDFLAGS)
OCFLAGS=-O3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DBINTRAJ $(AMBERBUILDFLAGS)
#NABFLAGS=
-LDFLAGS= $(AMBERBUILDFLAGS) -framework Accelerate
+LDFLAGS= -static-libgcc $(AMBERBUILDFLAGS) -framework Accelerate
# Full path of the libquadmath.a
# Note: you also need to remove "-lquadmath" from libgfortran.spec, which resides
# in the same directory as libquadmath.a and other libraries.
LIBQUADMATH=/usr/local/gcc8/lib/libquadmath.a
#FLDFLAGS= -nodefaultlibs -lgfortran-static -lgcc -lc -lm -lSystem -lSystemStubs -lgfortranbegin
-FLDFLAGS= -lgcc -lc -lm -lSystem -static-libgfortran -static-libgcc $(LIBQUADMATH)
+FSTATICFLAGS= -static-libgfortran -static-libgcc $(LIBQUADMATH)
+#FSTATICFLAGS= -static-libgcc -Wl,-Bstatic -lstdc++ -lgfortran -lquadmath -Wl,-Bdynamic -lm
+FLDFLAGS= -lgcc -lc -lm -lSystem $(FSTATICFLAGS)
else
CC=$(CROSS_PREFIX)gcc
CXX=$(CROSS_PREFIX)g++
CFLAGS= -DUSE_AMBER_C9XCOMPLEX -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $(AMBERBUILDFLAGS) -DWINDOWS=1
OCFLAGS=-O3 -DUSE_AMBER_C9XCOMPLEX -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $(AMBERBUILDFLAGS) -DWINDOWS=1
NABFLAGS=
+FSTATICFLAGS= -static-libgcc -Wl,-Bstatic -lstdc++ -lgfortran -lquadmath -Wl,-Bdynamic -lm
LDFLAGS=-Wl,--stack=0x01000000 $(AMBERBUILDFLAGS) -static-libgcc
-FLDFLAGS=-static-libgfortran
+FLDFLAGS= $(FSTATICFLAGS)
endif
#LEX= flex
FC=gfortran $(ISYSROOT)
FPP=cpp -traditional -P -DNO_SANDER_DIVCON -DBINTRAJ
else
-FC=$(CROSS_PREFIX)gfortran
+FC=$(CROSS_PREFIX)gcc
FPP=cpp -traditional -P -DNO_SANDER_DIVCON -DBINTRAJ
endif
-FFLAGS= -O0 $(LOCALFLAGS) $(AMBERBUILDFLAGS)
-FOPTFLAGS= -O3 $(LOCALFLAGS) $(AMBERBUILDFLAGS)
-FREEFORMAT_FLAG= -ffree-form
+FFLAGS= -O0 $(LOCALFLAGS) $(AMBERBUILDFLAGS) $(FSTATICFLAGS)
+FOPTFLAGS= -O3 $(LOCALFLAGS) $(AMBERBUILDFLAGS) $(FSTATICFLAGS)
+FREEFORMAT_FLAG= -ffree-form -std=legacy
LM=-lm
FPPFLAGS=-P -DNO_SANDER_DIVCON -DBINTRAJ
isa = PBXNativeTarget;
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Molby" */;
buildPhases = (
+ E471B4952734058600486093 /* ShellScript */,
E4FC7B57183E516E0064FB2E /* ShellScript */,
8D1107290486CEB800E47090 /* Resources */,
8D11072C0486CEB800E47090 /* Sources */,
shellPath = /bin/sh;
shellScript = "if [ \"${BUILD_STYLE:=$CONFIGURATION}\" = \"Release\" ]; then\n mkdir -p \"$PROJECT_DIR/../latest_binaries/Molby\" || exit 1\n (cd \"$PROJECT_DIR/../latest_binaries/Molby\" && rm -rf Molby_command Molby_resources) || exit 1\n(cd \"$BUILT_PRODUCTS_DIR\"; echo $PWD; cp -a -H Molby_command Molby_resources \"$PROJECT_DIR/../latest_binaries/Molby\") || exit 1\nfi\n";
};
+ E471B4952734058600486093 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ );
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "cd $PROJECT_DIR\nexport TARGET_PLATFORM=MAC\nexport TARGET_ARCH=x86_64\nPATH=/usr/local/gcc8/bin:$PATH\nif ! [ -e ortep3/ortep3 ]; then\n make -f ../Makefile_ortep3\nfi\nif ! [ -e amber11/bin/sqm ]; then\n make -f ../Makefile_amber11\nfi\n";
+ };
E49B3DF82306DB1800422E13 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "1030"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "E4CB370B1FE2C1F7001BB75E"
+ BuildableName = "Molby_win32"
+ BlueprintName = "Molby_win32"
+ ReferencedContainer = "container:Molby.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ </Testables>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "E4CB370B1FE2C1F7001BB75E"
+ BuildableName = "Molby_win32"
+ BlueprintName = "Molby_win32"
+ ReferencedContainer = "container:Molby.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "E4CB370B1FE2C1F7001BB75E"
+ BuildableName = "Molby_win32"
+ BlueprintName = "Molby_win32"
+ ReferencedContainer = "container:Molby.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "1030"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "E4B710FA2306BC80000A77EB"
+ BuildableName = "Molby_win64"
+ BlueprintName = "Molby_win64"
+ ReferencedContainer = "container:Molby.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ </Testables>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "E4B710FA2306BC80000A77EB"
+ BuildableName = "Molby_win64"
+ BlueprintName = "Molby_win64"
+ ReferencedContainer = "container:Molby.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "E4B710FA2306BC80000A77EB"
+ BuildableName = "Molby_win64"
+ BlueprintName = "Molby_win64"
+ ReferencedContainer = "container:Molby.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>