OSDN Git Service

Build options are updated to match the author's development environment
authortoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Fri, 5 Nov 2021 00:35:30 +0000 (00:35 +0000)
committertoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Fri, 5 Nov 2021 00:35:30 +0000 (00:35 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@633 a2be9bc6-48de-4e38-9406-05402d4bc13c

Makefile
Makefile_ortep3
amber11/src/c9x-complex/Makefile
amber11/src/config.h
build-xcode/Molby.xcodeproj/project.pbxproj
build-xcode/Molby.xcodeproj/project.xcworkspace/xcuserdata/toshi_n.xcuserdatad/UserInterfaceState.xcuserstate
build-xcode/Molby.xcodeproj/xcshareddata/xcschemes/Molby_win32.xcscheme [new file with mode: 0644]
build-xcode/Molby.xcodeproj/xcshareddata/xcschemes/Molby_win64.xcscheme [new file with mode: 0644]

index d31d375..df81976 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -77,7 +77,9 @@ export CC
 export CPP
 export AR
 export TARGET_PLATFORM
+export TARGET_ARCH
 export RANLIB
+export PWD
 
 release: all
 
index 267b7c9..729ac4f 100644 (file)
@@ -7,24 +7,33 @@
 #    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
@@ -39,7 +48,7 @@ ortep3/ortep3$(EXE_SUFFIX) : $(BUILDDIR)/ortep3$(EXE_SUFFIX)
 
 $(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)
index 40b65d4..120650b 100644 (file)
@@ -34,6 +34,11 @@ libmc.a: $(LIBMCFILES)
 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
index 037835a..e2d3c58 100644 (file)
@@ -9,7 +9,11 @@ ifeq ($(TARGET_PLATFORM),MAC)
 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
@@ -58,13 +62,15 @@ CPLUSPLUS=g++ $(ISYSROOT)
 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++
@@ -72,8 +78,9 @@ CPLUSPLUS=$(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
@@ -126,12 +133,12 @@ ifeq ($(TARGET_PLATFORM),MAC)
 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 
 
index 7e2c6da..838c128 100644 (file)
                        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;
index b8b0dab..d0c967c 100644 (file)
Binary files a/build-xcode/Molby.xcodeproj/project.xcworkspace/xcuserdata/toshi_n.xcuserdatad/UserInterfaceState.xcuserstate and b/build-xcode/Molby.xcodeproj/project.xcworkspace/xcuserdata/toshi_n.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/build-xcode/Molby.xcodeproj/xcshareddata/xcschemes/Molby_win32.xcscheme b/build-xcode/Molby.xcodeproj/xcshareddata/xcschemes/Molby_win32.xcscheme
new file mode 100644 (file)
index 0000000..292ac86
--- /dev/null
@@ -0,0 +1,80 @@
+<?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>
diff --git a/build-xcode/Molby.xcodeproj/xcshareddata/xcschemes/Molby_win64.xcscheme b/build-xcode/Molby.xcodeproj/xcshareddata/xcschemes/Molby_win64.xcscheme
new file mode 100644 (file)
index 0000000..37e762b
--- /dev/null
@@ -0,0 +1,80 @@
+<?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>