From ae7f51e42f5041a917519cd5b5483da9131b5636 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 30 Jan 2025 11:56:52 +0100 Subject: [PATCH 1/3] fixup! ci: reinstate Azure Pipelines support Trying to reinstate support for Azure Pipelines is somewhere between heroic and futile. I originally tried to do this because it was highly valuable to be able to run Git's test suite in a private Azure DevOps project when developing embargoed releases. Now that upstream drops even more Azure Pipeline support code, it is time to declare defeat. Signed-off-by: Johannes Schindelin --- azure-pipelines.yml | 393 -------------------------------------------- 1 file changed, 393 deletions(-) delete mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index fed26341d49a4a..00000000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,393 +0,0 @@ -variables: - Agent.Source.Git.ShallowFetchDepth: 1 - GIT_CONFIG_PARAMETERS: "'checkout.workers=56' 'user.name=CI' 'user.email=ci@git'" - -jobs: -- job: windows_build - displayName: Windows Build - condition: succeeded() - pool: - vmImage: windows-latest - timeoutInMinutes: 240 - steps: - - bash: git clone --bare --depth=1 --filter=blob:none --single-branch -b main https://github.com/git-for-windows/git-sdk-64 - displayName: 'clone git-sdk-64' - - bash: git clone --depth=1 --single-branch -b main https://github.com/git-for-windows/build-extra - displayName: 'clone build-extra' - - bash: sh -x ./build-extra/please.sh create-sdk-artifact --sdk=git-sdk-64.git --out=git-sdk-64-minimal minimal-sdk - displayName: 'build git-sdk-64-minimal-sdk' - - bash: | - # Let Git ignore the SDK and the test-cache - printf "%s\n" /git-sdk-64.git/ /build-extra/ /git-sdk-64-minimal/ /test-cache/ >>'.git/info/exclude' - displayName: 'Ignore untracked directories' - - bash: ci/make-test-artifacts.sh artifacts - displayName: Build - env: - HOME: $(Build.SourcesDirectory) - MSYSTEM: MINGW64 - DEVELOPER: 1 - NO_PERL: 1 - PATH: "$(Build.SourcesDirectory)\\git-sdk-64-minimal\\mingw64\\bin;$(Build.SourcesDirectory)\\git-sdk-64-minimal\\usr\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\system32\\wbem" - - task: PublishPipelineArtifact@0 - displayName: 'Publish Pipeline Artifact: test artifacts' - inputs: - artifactName: 'windows-artifacts' - targetPath: '$(Build.SourcesDirectory)\artifacts' - - task: PublishPipelineArtifact@0 - displayName: 'Publish Pipeline Artifact: git-sdk-64-minimal' - inputs: - artifactName: 'git-sdk-64-minimal' - targetPath: '$(Build.SourcesDirectory)\git-sdk-64-minimal' - -- job: windows_test - displayName: Windows Test - dependsOn: windows_build - condition: succeeded() - pool: - vmImage: windows-latest - timeoutInMinutes: 240 - strategy: - parallel: 10 - steps: - - task: DownloadPipelineArtifact@0 - displayName: 'Download Pipeline Artifact: test artifacts' - inputs: - artifactName: 'windows-artifacts' - targetPath: '$(Build.SourcesDirectory)' - - task: DownloadPipelineArtifact@0 - displayName: 'Download Pipeline Artifact: git-sdk-64-minimal' - inputs: - artifactName: 'git-sdk-64-minimal' - targetPath: '$(Build.SourcesDirectory)\git-sdk-64-minimal' - - bash: | - test -f artifacts.tar.gz || { - echo No test artifacts found\; skipping >&2 - exit 0 - } - tar xf artifacts.tar.gz || exit 1 - - # Let Git ignore the SDK and the test-cache - printf '%s\n' /git-sdk-64.git/ /build-extra/ /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude - - ci/run-test-slice.sh $SYSTEM_JOBPOSITIONINPHASE $SYSTEM_TOTALJOBSINPHASE || { - ci/print-test-failures.sh - exit 1 - } - displayName: 'Test (parallel)' - env: - HOME: $(Build.SourcesDirectory) - MSYSTEM: MINGW64 - NO_SVN_TESTS: 1 - GIT_TEST_SKIP_REBASE_P: 1 - PATH: "$(Build.SourcesDirectory)\\git-sdk-64-minimal\\mingw64\\bin;$(Build.SourcesDirectory)\\git-sdk-64-minimal\\usr\\bin\\core_perl;$(Build.SourcesDirectory)\\git-sdk-64-minimal\\usr\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\system32\\wbem" - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'windows' - platform: Windows - publishRunAttachments: false - condition: succeededOrFailed() - - task: PublishBuildArtifacts@1 - displayName: 'Publish trash directories of failed tests' - condition: failed() - inputs: - PathtoPublish: t/failed-test-artifacts - ArtifactName: failed-test-artifacts - -- job: vs_build - displayName: Visual Studio Build - condition: succeeded() - pool: - vmImage: windows-latest - timeoutInMinutes: 240 - steps: - - bash: git clone --bare --depth=1 --filter=blob:none --single-branch -b main https://github.com/git-for-windows/git-sdk-64 - displayName: 'clone git-sdk-64' - - bash: git clone --depth=1 --single-branch -b main https://github.com/git-for-windows/build-extra - displayName: 'clone build-extra' - - bash: sh -x ./build-extra/please.sh create-sdk-artifact --sdk=git-sdk-64.git --out=git-sdk-64-minimal minimal-sdk - displayName: 'build git-sdk-64-minimal-sdk' - - bash: | - # Let Git ignore the SDK and the test-cache - printf "%s\n" /git-sdk-64-minimal/ /test-cache/ >>'.git/info/exclude' - displayName: 'Ignore untracked directories' - - bash: make NDEBUG=1 DEVELOPER=1 vcxproj - displayName: Generate Visual Studio Solution - env: - HOME: $(Build.SourcesDirectory) - MSYSTEM: MINGW64 - DEVELOPER: 1 - NO_PERL: 1 - PATH: "$(Build.SourcesDirectory)\\git-sdk-64-minimal\\mingw64\\bin;$(Build.SourcesDirectory)\\git-sdk-64-minimal\\usr\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\system32\\wbem" - - powershell: | - $urlbase = "https://dev.azure.com/git/git/_apis/build/builds" - $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id - $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl - (New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip") - Expand-Archive compat.zip -DestinationPath . -Force - Remove-Item compat.zip - displayName: 'Download vcpkg artifacts' - - task: MSBuild@1 - inputs: - solution: git.sln - platform: x64 - configuration: Release - maximumCpuCount: 4 - msbuildArguments: /p:PlatformToolset=v142 - - bash: | - ./compat/vcbuild/vcpkg_copy_dlls.bat release && - mkdir -p artifacts && - eval "$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts | grep ^tar)" - displayName: Bundle artifact tar - env: - HOME: $(Build.SourcesDirectory) - MSYSTEM: MINGW64 - DEVELOPER: 1 - NO_PERL: 1 - MSVC: 1 - VCPKG_ROOT: $(Build.SourcesDirectory)\compat\vcbuild\vcpkg - PATH: "$(Build.SourcesDirectory)\\git-sdk-64-minimal\\mingw64\\bin;$(Build.SourcesDirectory)\\git-sdk-64-minimal\\usr\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\system32\\wbem" - - powershell: | - $tag = (Invoke-WebRequest -UseBasicParsing "https://gitforwindows.org/latest-tag.txt").content - $version = (Invoke-WebRequest -UseBasicParsing "https://gitforwindows.org/latest-version.txt").content - $url = "https://github.com/git-for-windows/git/releases/download/${tag}/PortableGit-${version}-64-bit.7z.exe" - (New-Object Net.WebClient).DownloadFile($url,"PortableGit.exe") - & .\PortableGit.exe -y -oartifacts\PortableGit - # Wait until it is unpacked - while (-not @(Remove-Item -ErrorAction SilentlyContinue PortableGit.exe; $?)) { sleep 1 } - displayName: Download & extract portable Git - - task: PublishPipelineArtifact@0 - displayName: 'Publish Pipeline Artifact: MSVC test artifacts' - inputs: - artifactName: 'vs-artifacts' - targetPath: '$(Build.SourcesDirectory)\artifacts' - -- job: vs_test - displayName: Visual Studio Test - dependsOn: vs_build - condition: succeeded() - pool: - vmImage: windows-latest - timeoutInMinutes: 240 - strategy: - parallel: 10 - steps: - - task: DownloadPipelineArtifact@0 - displayName: 'Download Pipeline Artifact: VS test artifacts' - inputs: - artifactName: 'vs-artifacts' - targetPath: '$(Build.SourcesDirectory)' - - bash: | - test -f artifacts.tar.gz || { - echo No test artifacts found\; skipping >&2 - exit 0 - } - tar xf artifacts.tar.gz || exit 1 - - # Let Git ignore the SDK and the test-cache - printf '%s\n' /PortableGit/ /test-cache/ >>.git/info/exclude - - cd t && - PATH="$PWD/helper:$PATH" && - test-tool.exe run-command testsuite --jobs=10 -V -x --write-junit-xml \ - $(test-tool.exe path-utils slice-tests \ - $SYSTEM_JOBPOSITIONINPHASE $SYSTEM_TOTALJOBSINPHASE t[0-9]*.sh) - displayName: 'Test (parallel)' - env: - HOME: $(Build.SourcesDirectory) - MSYSTEM: MINGW64 - NO_SVN_TESTS: 1 - GIT_TEST_SKIP_REBASE_P: 1 - PATH: "$(Build.SourcesDirectory)\\PortableGit\\mingw64\\bin;$(Build.SourcesDirectory)\\PortableGit\\usr\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\system32\\wbem" - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'vs' - platform: Windows - publishRunAttachments: false - condition: succeededOrFailed() - - task: PublishBuildArtifacts@1 - displayName: 'Publish trash directories of failed tests' - condition: failed() - inputs: - PathtoPublish: t/failed-test-artifacts - ArtifactName: failed-vs-test-artifacts - -- job: linux_clang - displayName: linux-clang - condition: succeeded() - pool: - vmImage: ubuntu-latest - steps: - - bash: | - export CC=clang || exit 1 - - ci/install-dependencies.sh || exit 1 - ci/run-build-and-tests.sh || { - ci/print-test-failures.sh - exit 1 - } - displayName: 'ci/run-build-and-tests.sh' - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'linux-clang' - platform: Linux - publishRunAttachments: false - condition: succeededOrFailed() - - task: PublishBuildArtifacts@1 - displayName: 'Publish trash directories of failed tests' - condition: failed() - inputs: - PathtoPublish: t/failed-test-artifacts - ArtifactName: failed-test-artifacts - -- job: linux_gcc - displayName: linux-gcc - condition: succeeded() - pool: - vmImage: ubuntu-latest - steps: - - bash: | - ci/install-dependencies.sh || exit 1 - ci/run-build-and-tests.sh || { - ci/print-test-failures.sh - exit 1 - } - displayName: 'ci/run-build-and-tests.sh' - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'linux-gcc' - platform: Linux - publishRunAttachments: false - condition: succeededOrFailed() - - task: PublishBuildArtifacts@1 - displayName: 'Publish trash directories of failed tests' - condition: failed() - inputs: - PathtoPublish: t/failed-test-artifacts - ArtifactName: failed-test-artifacts - -- job: osx_clang - displayName: osx-clang - condition: succeeded() - pool: - vmImage: macOS-latest - steps: - - bash: | - export CC=clang - - ci/install-dependencies.sh || exit 1 - ci/run-build-and-tests.sh || { - ci/print-test-failures.sh - exit 1 - } - displayName: 'ci/run-build-and-tests.sh' - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'osx-clang' - platform: macOS - publishRunAttachments: false - condition: succeededOrFailed() - - task: PublishBuildArtifacts@1 - displayName: 'Publish trash directories of failed tests' - condition: failed() - inputs: - PathtoPublish: t/failed-test-artifacts - ArtifactName: failed-test-artifacts - -- job: osx_gcc - displayName: osx-gcc - condition: succeeded() - pool: - vmImage: macOS-latest - steps: - - bash: | - ci/install-dependencies.sh || exit 1 - ci/run-build-and-tests.sh || { - ci/print-test-failures.sh - exit 1 - } - displayName: 'ci/run-build-and-tests.sh' - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'osx-gcc' - platform: macOS - publishRunAttachments: false - condition: succeededOrFailed() - - task: PublishBuildArtifacts@1 - displayName: 'Publish trash directories of failed tests' - condition: failed() - inputs: - PathtoPublish: t/failed-test-artifacts - ArtifactName: failed-test-artifacts - -- job: linux32 - displayName: Linux32 - condition: succeeded() - pool: - vmImage: ubuntu-latest - steps: - - bash: | - res=0 - sudo AGENT_OS="$AGENT_OS" BUILD_BUILDNUMBER="$BUILD_BUILDNUMBER" BUILD_REPOSITORY_URI="$BUILD_REPOSITORY_URI" BUILD_SOURCEBRANCH="$BUILD_SOURCEBRANCH" BUILD_SOURCEVERSION="$BUILD_SOURCEVERSION" SYSTEM_PHASENAME="$SYSTEM_PHASENAME" SYSTEM_TASKDEFINITIONSURI="$SYSTEM_TASKDEFINITIONSURI" SYSTEM_TEAMPROJECT="$SYSTEM_TEAMPROJECT" CC=$CC MAKEFLAGS="$MAKEFLAGS" jobname=linux32 bash -lxc ci/run-docker.sh || res=1 - - sudo chmod a+r t/out/TEST-*.xml - test ! -d t/failed-test-artifacts || sudo chmod a+r t/failed-test-artifacts - - exit $res - displayName: 'jobname=linux32 ci/run-docker.sh' - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'linux32' - platform: Linux - publishRunAttachments: false - condition: succeededOrFailed() - - task: PublishBuildArtifacts@1 - displayName: 'Publish trash directories of failed tests' - condition: failed() - inputs: - PathtoPublish: t/failed-test-artifacts - ArtifactName: failed-test-artifacts - -- job: static_analysis - displayName: StaticAnalysis - condition: succeeded() - pool: - vmImage: ubuntu-22.04 - steps: - - bash: | - sudo apt-get update && - sudo apt-get install -y coccinelle libcurl4-openssl-dev libssl-dev libexpat-dev gettext && - - export jobname=StaticAnalysis && - - ci/run-static-analysis.sh || exit 1 - displayName: 'ci/run-static-analysis.sh' - -- job: documentation - displayName: Documentation - condition: succeeded() - pool: - vmImage: ubuntu-latest - steps: - - bash: | - sudo apt-get update && - sudo apt-get install -y asciidoc xmlto asciidoctor docbook-xsl-ns && - - export ALREADY_HAVE_ASCIIDOCTOR=yes. && - export jobname=Documentation && - - ci/test-documentation.sh || exit 1 - displayName: 'ci/test-documentation.sh' From e6e5b99b5c28b4df10d1cdda6e257f6deb412d23 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 30 Jan 2025 12:15:41 +0100 Subject: [PATCH 2/3] amend! vcxproj: handle GUI programs, too contrib/buildsystems: drop support for building .vcproj/.vcxproj files Before we had CMake support, the only way to build Git in Visual Studio was via this hacky `generate` script. For a while I tried to fix whenever things got broken, in particular to allow building confidence in embargoed releases by running the CI builds in Azure Pipelines in a private Azure DevOps project. I even carried the patches in Git for Windows with the intention of upstreaming them, eventually. However, it is a lot of work with too little benefit. CMake is much better supported by Visual Studio. So let's drop this hacky script (plus support code). Signed-off-by: Johannes Schindelin --- contrib/buildsystems/Generators.pm | 42 -- contrib/buildsystems/Generators/QMake.pm | 189 ------- contrib/buildsystems/Generators/Vcproj.pm | 579 --------------------- contrib/buildsystems/Generators/Vcxproj.pm | 451 ---------------- contrib/buildsystems/engine.pl | 395 -------------- contrib/buildsystems/generate | 29 -- contrib/buildsystems/parse.pl | 228 -------- 7 files changed, 1913 deletions(-) delete mode 100644 contrib/buildsystems/Generators.pm delete mode 100644 contrib/buildsystems/Generators/QMake.pm delete mode 100644 contrib/buildsystems/Generators/Vcproj.pm delete mode 100644 contrib/buildsystems/Generators/Vcxproj.pm delete mode 100755 contrib/buildsystems/engine.pl delete mode 100755 contrib/buildsystems/generate delete mode 100755 contrib/buildsystems/parse.pl diff --git a/contrib/buildsystems/Generators.pm b/contrib/buildsystems/Generators.pm deleted file mode 100644 index aa4cbaa2adacb1..00000000000000 --- a/contrib/buildsystems/Generators.pm +++ /dev/null @@ -1,42 +0,0 @@ -package Generators; -require Exporter; - -use strict; -use File::Basename; -no strict 'refs'; -use vars qw($VERSION @AVAILABLE); - -our $VERSION = '1.00'; -our(@ISA, @EXPORT, @EXPORT_OK, @AVAILABLE); -@ISA = qw(Exporter); - -BEGIN { - local(*D); - my $me = $INC{"Generators.pm"}; - die "Couldn't find myself in \@INC, which is required to load the generators!" if ("$me" eq ""); - $me = dirname($me); - if (opendir(D,"$me/Generators")) { - foreach my $gen (readdir(D)) { - next unless ($gen =~ /\.pm$/); - require "${me}/Generators/$gen"; - $gen =~ s,\.pm,,; - push(@AVAILABLE, $gen); - } - closedir(D); - my $gens = join(', ', @AVAILABLE); - } - - push @EXPORT_OK, qw(available); -} - -sub available { - return @AVAILABLE; -} - -sub generate { - my ($gen, $git_dir, $out_dir, $rel_dir, %build_structure) = @_; - return eval("Generators::${gen}::generate(\$git_dir, \$out_dir, \$rel_dir, \%build_structure)") if grep(/^$gen$/, @AVAILABLE); - die "Generator \"${gen}\" is not available!\nAvailable generators are: @AVAILABLE\n"; -} - -1; diff --git a/contrib/buildsystems/Generators/QMake.pm b/contrib/buildsystems/Generators/QMake.pm deleted file mode 100644 index ff3b657e610575..00000000000000 --- a/contrib/buildsystems/Generators/QMake.pm +++ /dev/null @@ -1,189 +0,0 @@ -package Generators::QMake; -require Exporter; - -use strict; -use vars qw($VERSION); - -our $VERSION = '1.00'; -our(@ISA, @EXPORT, @EXPORT_OK, @AVAILABLE); -@ISA = qw(Exporter); - -BEGIN { - push @EXPORT_OK, qw(generate); -} - -sub generate { - my ($git_dir, $out_dir, $rel_dir, %build_structure) = @_; - - my @libs = @{$build_structure{"LIBS"}}; - foreach (@libs) { - createLibProject($_, $git_dir, $out_dir, $rel_dir, %build_structure); - } - - my @apps = @{$build_structure{"APPS"}}; - foreach (@apps) { - createAppProject($_, $git_dir, $out_dir, $rel_dir, %build_structure); - } - - createGlueProject($git_dir, $out_dir, $rel_dir, %build_structure); - return 0; -} - -sub createLibProject { - my ($libname, $git_dir, $out_dir, $rel_dir, %build_structure) = @_; - print "Generate $libname lib project\n"; - $rel_dir = "../$rel_dir"; - - my $sources = join(" \\\n\t", sort(map("$rel_dir/$_", @{$build_structure{"LIBS_${libname}_SOURCES"}}))); - my $defines = join(" \\\n\t", sort(@{$build_structure{"LIBS_${libname}_DEFINES"}})); - my $includes= join(" \\\n\t", sort(map("$rel_dir/$_", @{$build_structure{"LIBS_${libname}_INCLUDES"}}))); - my $cflags = join(" ", sort(@{$build_structure{"LIBS_${libname}_CFLAGS"}})); - - my $cflags_debug = $cflags; - $cflags_debug =~ s/-MT/-MTd/; - $cflags_debug =~ s/-O.//; - - my $cflags_release = $cflags; - $cflags_release =~ s/-MTd/-MT/; - - my @tmp = @{$build_structure{"LIBS_${libname}_LFLAGS"}}; - my @tmp2 = (); - foreach (@tmp) { - if (/^-LTCG/) { - } elsif (/^-L/) { - $_ =~ s/^-L/-LIBPATH:$rel_dir\//; - } - push(@tmp2, $_); - } - my $lflags = join(" ", sort(@tmp)); - - my $target = $libname; - $target =~ s/\//_/g; - $defines =~ s/-D//g; - $defines =~ s/"/\\\\"/g; - $includes =~ s/-I//g; - mkdir "$target" || die "Could not create the directory $target for lib project!\n"; - open F, ">$target/$target.pro" || die "Could not open $target/$target.pro for writing!\n"; - print F << "EOM"; -TEMPLATE = lib -TARGET = $target -DESTDIR = $rel_dir - -CONFIG -= qt -CONFIG += static - -QMAKE_CFLAGS = -QMAKE_CFLAGS_RELEASE = $cflags_release -QMAKE_CFLAGS_DEBUG = $cflags_debug -QMAKE_LIBFLAGS = $lflags - -DEFINES += \\ - $defines - -INCLUDEPATH += \\ - $includes - -SOURCES += \\ - $sources -EOM - close F; -} - -sub createAppProject { - my ($appname, $git_dir, $out_dir, $rel_dir, %build_structure) = @_; - print "Generate $appname app project\n"; - $rel_dir = "../$rel_dir"; - - my $sources = join(" \\\n\t", sort(map("$rel_dir/$_", @{$build_structure{"APPS_${appname}_SOURCES"}}))); - my $defines = join(" \\\n\t", sort(@{$build_structure{"APPS_${appname}_DEFINES"}})); - my $includes= join(" \\\n\t", sort(map("$rel_dir/$_", @{$build_structure{"APPS_${appname}_INCLUDES"}}))); - my $cflags = join(" ", sort(@{$build_structure{"APPS_${appname}_CFLAGS"}})); - - my $cflags_debug = $cflags; - $cflags_debug =~ s/-MT/-MTd/; - $cflags_debug =~ s/-O.//; - - my $cflags_release = $cflags; - $cflags_release =~ s/-MTd/-MT/; - - my $libs; - foreach (sort(@{$build_structure{"APPS_${appname}_LIBS"}})) { - $_ =~ s/\//_/g; - $libs .= " $_"; - } - my @tmp = @{$build_structure{"APPS_${appname}_LFLAGS"}}; - my @tmp2 = (); - foreach (@tmp) { - # next if ($_ eq "-NODEFAULTLIB:MSVCRT.lib"); - if (/^-LTCG/) { - } elsif (/^-L/) { - $_ =~ s/^-L/-LIBPATH:$rel_dir\//; - } - push(@tmp2, $_); - } - my $lflags = join(" ", sort(@tmp)); - - my $target = $appname; - $target =~ s/\.exe//; - $target =~ s/\//_/g; - $defines =~ s/-D//g; - $defines =~ s/"/\\\\"/g; - $includes =~ s/-I//g; - mkdir "$target" || die "Could not create the directory $target for app project!\n"; - open F, ">$target/$target.pro" || die "Could not open $target/$target.pro for writing!\n"; - print F << "EOM"; -TEMPLATE = app -TARGET = $target -DESTDIR = $rel_dir - -CONFIG -= qt embed_manifest_exe -CONFIG += console - -QMAKE_CFLAGS = -QMAKE_CFLAGS_RELEASE = $cflags_release -QMAKE_CFLAGS_DEBUG = $cflags_debug -QMAKE_LFLAGS = $lflags -LIBS = $libs - -DEFINES += \\ - $defines - -INCLUDEPATH += \\ - $includes - -win32:QMAKE_LFLAGS += -LIBPATH:$rel_dir -else: QMAKE_LFLAGS += -L$rel_dir - -SOURCES += \\ - $sources -EOM - close F; -} - -sub createGlueProject { - my ($git_dir, $out_dir, $rel_dir, %build_structure) = @_; - my $libs = join(" \\ \n", map("\t$_|$_.pro", @{$build_structure{"LIBS"}})); - my $apps = join(" \\ \n", map("\t$_|$_.pro", @{$build_structure{"APPS"}})); - $libs =~ s/\.a//g; - $libs =~ s/\//_/g; - $libs =~ s/\|/\//g; - $apps =~ s/\.exe//g; - $apps =~ s/\//_/g; - $apps =~ s/\|/\//g; - - my $filename = $out_dir; - $filename =~ s/.*\/([^\/]+)$/$1/; - $filename =~ s/\/$//; - print "Generate glue project $filename.pro\n"; - open F, ">$filename.pro" || die "Could not open $filename.pro for writing!\n"; - print F << "EOM"; -TEMPLATE = subdirs -CONFIG += ordered -SUBDIRS += \\ -$libs \\ -$apps -EOM - close F; -} - -1; diff --git a/contrib/buildsystems/Generators/Vcproj.pm b/contrib/buildsystems/Generators/Vcproj.pm deleted file mode 100644 index 737647e76afd42..00000000000000 --- a/contrib/buildsystems/Generators/Vcproj.pm +++ /dev/null @@ -1,579 +0,0 @@ -package Generators::Vcproj; -require Exporter; - -use strict; -use vars qw($VERSION); -use Digest::SHA qw(sha256_hex); - -our $VERSION = '1.00'; -our(@ISA, @EXPORT, @EXPORT_OK, @AVAILABLE); -@ISA = qw(Exporter); - -BEGIN { - push @EXPORT_OK, qw(generate); -} - -sub generate_guid ($) { - my $hex = sha256_hex($_[0]); - $hex =~ s/^(.{8})(.{4})(.{4})(.{4})(.{12}).*/{$1-$2-$3-$4-$5}/; - $hex =~ tr/a-z/A-Z/; - return $hex; -} - -sub generate { - my ($git_dir, $out_dir, $rel_dir, %build_structure) = @_; - my @libs = @{$build_structure{"LIBS"}}; - foreach (@libs) { - createLibProject($_, $git_dir, $out_dir, $rel_dir, \%build_structure); - } - - my @apps = @{$build_structure{"APPS"}}; - foreach (@apps) { - createAppProject($_, $git_dir, $out_dir, $rel_dir, \%build_structure); - } - - createGlueProject($git_dir, $out_dir, $rel_dir, %build_structure); - return 0; -} - -sub createLibProject { - my ($libname, $git_dir, $out_dir, $rel_dir, $build_structure) = @_; - print "Generate $libname vcproj lib project\n"; - $rel_dir = "..\\$rel_dir"; - $rel_dir =~ s/\//\\/g; - - my $target = $libname; - $target =~ s/\//_/g; - $target =~ s/\.a//; - - my $uuid = generate_guid($libname); - $$build_structure{"LIBS_${target}_GUID"} = $uuid; - - my @srcs = sort(map("$rel_dir\\$_", @{$$build_structure{"LIBS_${libname}_SOURCES"}})); - my @sources; - foreach (@srcs) { - $_ =~ s/\//\\/g; - push(@sources, $_); - } - my $defines = join(",", sort(@{$$build_structure{"LIBS_${libname}_DEFINES"}})); - my $includes= join(";", sort(map(""$rel_dir\\$_"", @{$$build_structure{"LIBS_${libname}_INCLUDES"}}))); - my $cflags = join(" ", sort(@{$$build_structure{"LIBS_${libname}_CFLAGS"}})); - $cflags =~ s/\"/"/g; - $cflags =~ s//>/g; - - my $cflags_debug = $cflags; - $cflags_debug =~ s/-MT/-MTd/; - $cflags_debug =~ s/-O.//; - - my $cflags_release = $cflags; - $cflags_release =~ s/-MTd/-MT/; - - my @tmp = @{$$build_structure{"LIBS_${libname}_LFLAGS"}}; - my @tmp2 = (); - foreach (@tmp) { - if (/^-LTCG/) { - } elsif (/^-L/) { - $_ =~ s/^-L/-LIBPATH:$rel_dir\//; - } - push(@tmp2, $_); - } - my $lflags = join(" ", sort(@tmp)); - - $defines =~ s/-D//g; - $defines =~ s/\"/\\"/g; - $defines =~ s//>/g; - $defines =~ s/\'//g; - $includes =~ s/-I//g; - mkdir "$target" || die "Could not create the directory $target for lib project!\n"; - open F, ">$target/$target.vcproj" || die "Could not open $target/$target.pro for writing!\n"; - binmode F, ":crlf"; - print F << "EOM"; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -EOM - foreach(@sources) { - print F << "EOM"; - -EOM - } - print F << "EOM"; - - - - - -EOM - close F; -} - -sub createAppProject { - my ($appname, $git_dir, $out_dir, $rel_dir, $build_structure) = @_; - print "Generate $appname vcproj app project\n"; - $rel_dir = "..\\$rel_dir"; - $rel_dir =~ s/\//\\/g; - - my $target = $appname; - $target =~ s/\//_/g; - $target =~ s/\.exe//; - - my $uuid = generate_guid($appname); - $$build_structure{"APPS_${target}_GUID"} = $uuid; - - my @srcs = sort(map("$rel_dir\\$_", @{$$build_structure{"APPS_${appname}_SOURCES"}})); - my @sources; - foreach (@srcs) { - $_ =~ s/\//\\/g; - push(@sources, $_); - } - my $defines = join(",", sort(@{$$build_structure{"APPS_${appname}_DEFINES"}})); - my $includes= join(";", sort(map(""$rel_dir\\$_"", @{$$build_structure{"APPS_${appname}_INCLUDES"}}))); - my $cflags = join(" ", sort(@{$$build_structure{"APPS_${appname}_CFLAGS"}})); - $cflags =~ s/\"/"/g; - $cflags =~ s//>/g; - - my $cflags_debug = $cflags; - $cflags_debug =~ s/-MT/-MTd/; - $cflags_debug =~ s/-O.//; - - my $cflags_release = $cflags; - $cflags_release =~ s/-MTd/-MT/; - - my $libs; - foreach (sort(@{$$build_structure{"APPS_${appname}_LIBS"}})) { - $_ =~ s/\//_/g; - $libs .= " $_"; - } - my @tmp = @{$$build_structure{"APPS_${appname}_LFLAGS"}}; - my @tmp2 = (); - foreach (@tmp) { - if (/^-LTCG/) { - } elsif (/^-L/) { - $_ =~ s/^-L/-LIBPATH:$rel_dir\//; - } - push(@tmp2, $_); - } - my $lflags = join(" ", sort(@tmp)) . " -LIBPATH:$rel_dir"; - - $defines =~ s/-D//g; - $defines =~ s/\"/\\"/g; - $defines =~ s//>/g; - $defines =~ s/\'//g; - $defines =~ s/\\\\/\\/g; - $includes =~ s/-I//g; - mkdir "$target" || die "Could not create the directory $target for lib project!\n"; - open F, ">$target/$target.vcproj" || die "Could not open $target/$target.pro for writing!\n"; - binmode F, ":crlf"; - print F << "EOM"; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -EOM - foreach(@sources) { - print F << "EOM"; - -EOM - } - print F << "EOM"; - - - - - -EOM - close F; -} - -sub createGlueProject { - my ($git_dir, $out_dir, $rel_dir, %build_structure) = @_; - print "Generate solutions file\n"; - $rel_dir = "..\\$rel_dir"; - $rel_dir =~ s/\//\\/g; - my $SLN_HEAD = "Microsoft Visual Studio Solution File, Format Version 10.00\n# Visual Studio 2008\n"; - my $SLN_PRE = "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = "; - my $SLN_POST = "\nEndProject\n"; - - my @libs = @{$build_structure{"LIBS"}}; - my @tmp; - foreach (@libs) { - $_ =~ s/\//_/g; - $_ =~ s/\.a//; - push(@tmp, $_); - } - @libs = @tmp; - - my @apps = @{$build_structure{"APPS"}}; - @tmp = (); - foreach (@apps) { - $_ =~ s/\//_/g; - $_ =~ s/\.exe//; - if ($_ eq "git" ) { - unshift(@tmp, $_); - } else { - push(@tmp, $_); - } - } - @apps = @tmp; - - open F, ">git.sln" || die "Could not open git.sln for writing!\n"; - binmode F, ":crlf"; - print F "$SLN_HEAD"; - - my $uuid_libgit = $build_structure{"LIBS_libgit_GUID"}; - my $uuid_xdiff_lib = $build_structure{"LIBS_xdiff_lib_GUID"}; - foreach (@apps) { - my $appname = $_; - my $uuid = $build_structure{"APPS_${appname}_GUID"}; - print F "$SLN_PRE"; - print F "\"${appname}\", \"${appname}\\${appname}.vcproj\", \"${uuid}\"\n"; - print F " ProjectSection(ProjectDependencies) = postProject\n"; - print F " ${uuid_libgit} = ${uuid_libgit}\n"; - print F " ${uuid_xdiff_lib} = ${uuid_xdiff_lib}\n"; - print F " EndProjectSection"; - print F "$SLN_POST"; - } - foreach (@libs) { - my $libname = $_; - my $uuid = $build_structure{"LIBS_${libname}_GUID"}; - print F "$SLN_PRE"; - print F "\"${libname}\", \"${libname}\\${libname}.vcproj\", \"${uuid}\""; - print F "$SLN_POST"; - } - - print F << "EOM"; -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection -EOM - print F << "EOM"; - GlobalSection(ProjectConfigurationPlatforms) = postSolution -EOM - foreach (@apps) { - my $appname = $_; - my $uuid = $build_structure{"APPS_${appname}_GUID"}; - print F "\t\t${uuid}.Debug|Win32.ActiveCfg = Debug|Win32\n"; - print F "\t\t${uuid}.Debug|Win32.Build.0 = Debug|Win32\n"; - print F "\t\t${uuid}.Release|Win32.ActiveCfg = Release|Win32\n"; - print F "\t\t${uuid}.Release|Win32.Build.0 = Release|Win32\n"; - } - foreach (@libs) { - my $libname = $_; - my $uuid = $build_structure{"LIBS_${libname}_GUID"}; - print F "\t\t${uuid}.Debug|Win32.ActiveCfg = Debug|Win32\n"; - print F "\t\t${uuid}.Debug|Win32.Build.0 = Debug|Win32\n"; - print F "\t\t${uuid}.Release|Win32.ActiveCfg = Release|Win32\n"; - print F "\t\t${uuid}.Release|Win32.Build.0 = Release|Win32\n"; - } - - print F << "EOM"; - EndGlobalSection -EndGlobal -EOM - close F; -} - -1; diff --git a/contrib/buildsystems/Generators/Vcxproj.pm b/contrib/buildsystems/Generators/Vcxproj.pm deleted file mode 100644 index d62249bf7f1010..00000000000000 --- a/contrib/buildsystems/Generators/Vcxproj.pm +++ /dev/null @@ -1,451 +0,0 @@ -package Generators::Vcxproj; -require Exporter; - -use strict; -use vars qw($VERSION); -use Digest::SHA qw(sha256_hex); - -our $VERSION = '1.00'; -our(@ISA, @EXPORT, @EXPORT_OK, @AVAILABLE); -@ISA = qw(Exporter); - -BEGIN { - push @EXPORT_OK, qw(generate); -} - -sub generate_guid ($) { - my $hex = sha256_hex($_[0]); - $hex =~ s/^(.{8})(.{4})(.{4})(.{4})(.{12}).*/{$1-$2-$3-$4-$5}/; - $hex =~ tr/a-z/A-Z/; - return $hex; -} - -sub generate { - my ($git_dir, $out_dir, $rel_dir, %build_structure) = @_; - my @libs = @{$build_structure{"LIBS"}}; - foreach (@libs) { - createProject($_, $git_dir, $out_dir, $rel_dir, \%build_structure, 1); - } - - my @apps = @{$build_structure{"APPS"}}; - foreach (@apps) { - createProject($_, $git_dir, $out_dir, $rel_dir, \%build_structure, 0); - } - - createGlueProject($git_dir, $out_dir, $rel_dir, %build_structure); - return 0; -} - -sub createProject { - my ($name, $git_dir, $out_dir, $rel_dir, $build_structure, $static_library) = @_; - my $label = $static_library ? "lib" : "app"; - my $prefix = $static_library ? "LIBS_" : "APPS_"; - my $config_type = $static_library ? "StaticLibrary" : "Application"; - print "Generate $name vcxproj $label project\n"; - my $cdup = $name; - $cdup =~ s/[^\/]+/../g; - $cdup =~ s/\//\\/g; - $rel_dir = $rel_dir eq "." ? $cdup : "$cdup\\$rel_dir"; - $rel_dir =~ s/\//\\/g; - - my $target = $name; - if ($static_library) { - $target =~ s/\.a//; - } else { - $target =~ s/\.exe//; - } - - my $uuid = generate_guid($name); - $$build_structure{"$prefix${target}_GUID"} = $uuid; - my $vcxproj = $target; - $vcxproj =~ s/(.*\/)?(.*)/$&.proj\/$2.vcxproj/; - $vcxproj =~ s/([^\/]*)(\/lib\.proj)\/(lib.vcxproj)/$1$2\/$1_$3/; - $$build_structure{"$prefix${target}_VCXPROJ"} = $vcxproj; - - my @srcs = sort(map("$rel_dir\\$_", @{$$build_structure{"$prefix${name}_SOURCES"}})); - my @sources; - foreach (@srcs) { - $_ =~ s/\//\\/g; - push(@sources, $_); - } - my $defines = join(";", sort(@{$$build_structure{"$prefix${name}_DEFINES"}})); - my $includes= join(";", sort(map { s/^-I//; s/\//\\/g; File::Spec->file_name_is_absolute($_) ? $_ : "$rel_dir\\$_" } @{$$build_structure{"$prefix${name}_INCLUDES"}})); - my $cflags = join(" ", sort(map { s/^-[GLMOWZ].*//; s/.* .*/"$&"/; $_; } @{$$build_structure{"$prefix${name}_CFLAGS"}})); - $cflags =~ s//>/g; - - my $libs_release = "\n "; - my $libs_debug = "\n "; - if (!$static_library && $name ne 'headless-git') { - $libs_release = join(";", sort(grep /^(?!libgit\.lib|xdiff\/lib\.lib|vcs-svn\/lib\.lib|reftable\/libreftable(_test)?\.lib)/, @{$$build_structure{"$prefix${name}_LIBS"}})); - $libs_debug = $libs_release; - $libs_debug =~ s/zlib\.lib/zlibd\.lib/g; - $libs_debug =~ s/libexpat\.lib/libexpatd\.lib/g; - $libs_debug =~ s/libcurl\.lib/libcurl-d\.lib/g; - } - - $defines =~ s/-D//g; - $defines =~ s//>/g; - $defines =~ s/\'//g; - $defines =~ s/\\"/"/g; - - my $rcdefines = $defines; - $rcdefines =~ s/(?$vcxproj" or die "Could not open $vcxproj for writing!\n"; - binmode F, ":crlf :utf8"; - print F chr(0xFEFF); - print F << "EOM"; - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - Debug - ARM64 - - - Release - ARM64 - - - - $uuid - Win32Proj - x86-windows - x64-windows - arm64-windows - $cdup\\compat\\vcbuild\\vcpkg\\installed\\\$(VCPKGArch) - \$(VCPKGArchDirectory)\\debug\\bin - \$(VCPKGArchDirectory)\\debug\\lib - \$(VCPKGArchDirectory)\\bin - \$(VCPKGArchDirectory)\\lib - \$(VCPKGArchDirectory)\\include - $libs_debug - $libs_release - - - - true - true - - - false - true - - - $config_type - v142 - - ..\\ - - - - - - - - - - - - - false - true - - - - $cflags %(AdditionalOptions) - $cdup;$cdup\\compat;$cdup\\compat\\regex;$cdup\\compat\\win32;$cdup\\compat\\poll;$cdup\\compat\\vcbuild\\include;\$(VCPKGIncludeDirectory);%(AdditionalIncludeDirectories) - - OnlyExplicitInline - - ProgramDatabase - stdc11 - - - true - - - \$(VCPKGLibDirectory);%(AdditionalLibraryDirectories) - \$(VCPKGLibs);\$(AdditionalDependencies) - invalidcontinue.obj %(AdditionalOptions) - $entrypoint - $subsystem - -EOM - if ($target eq 'libgit') { - print F << "EOM"; - - Initialize VCPKG - del "$cdup\\compat\\vcbuild\\vcpkg" - call "$cdup\\compat\\vcbuild\\vcpkg_install.bat" \$(VCPKGArch) - -EOM - } - print F << "EOM"; - - - - MachineX86 - - - - - Disabled - WIN32;_DEBUG;$defines;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - - - WIN32;_DEBUG;$rcdefines;%(PreprocessorDefinitions) - - - true - - - - - MaxSpeed - true - WIN32;NDEBUG;$defines;%(PreprocessorDefinitions) - MultiThreadedDLL - true - Speed - - - WIN32;NDEBUG;$rcdefines;%(PreprocessorDefinitions) - - - true - true - true - - - -EOM - foreach(@sources) { - if (/\.rc$/) { - print F << "EOM"; - -EOM - } else { - print F << "EOM"; - -EOM - } - } - print F << "EOM"; - -EOM - if ((!$static_library || $target =~ 'vcs-svn' || $target =~ 'xdiff') && !($name =~ /headless-git/)) { - my $uuid_libgit = $$build_structure{"LIBS_libgit_GUID"}; - my $uuid_libreftable = $$build_structure{"LIBS_reftable/libreftable_GUID"}; - my $uuid_libreftable_test = $$build_structure{"LIBS_reftable/libreftable_test_GUID"}; - my $uuid_xdiff_lib = $$build_structure{"LIBS_xdiff/lib_GUID"}; - - print F << "EOM"; - - - $uuid_libgit - false - -EOM - if (!($name =~ /xdiff|libreftable/)) { - print F << "EOM"; - - $uuid_libreftable - false - - - $uuid_libreftable_test - false - -EOM - } - if (!($name =~ 'xdiff')) { - print F << "EOM"; - - $uuid_xdiff_lib - false - -EOM - } - if ($name =~ /(test-(line-buffer|svn-fe)|^git-remote-testsvn)\.exe$/) { - my $uuid_vcs_svn_lib = $$build_structure{"LIBS_vcs-svn/lib_GUID"}; - print F << "EOM"; - - $uuid_vcs_svn_lib - false - -EOM - } - print F << "EOM"; - -EOM - } - print F << "EOM"; - -EOM - if (!$static_library) { - print F << "EOM"; - - - - - - - -EOM - } - if ($target eq 'git') { - print F " \n"; - } - if ($target eq 'git-remote-http') { - print F " \n"; - } - print F << "EOM"; - -EOM - close F; -} - -sub createGlueProject { - my ($git_dir, $out_dir, $rel_dir, %build_structure) = @_; - print "Generate solutions file\n"; - $rel_dir = "..\\$rel_dir"; - $rel_dir =~ s/\//\\/g; - my $SLN_HEAD = "Microsoft Visual Studio Solution File, Format Version 11.00\n# Visual Studio 2010\n"; - my $SLN_PRE = "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = "; - my $SLN_POST = "\nEndProject\n"; - - my @libs = @{$build_structure{"LIBS"}}; - my @tmp; - foreach (@libs) { - $_ =~ s/\.a//; - push(@tmp, $_); - } - @libs = @tmp; - - my @apps = @{$build_structure{"APPS"}}; - @tmp = (); - foreach (@apps) { - $_ =~ s/\.exe//; - if ($_ eq "git" ) { - unshift(@tmp, $_); - } else { - push(@tmp, $_); - } - } - @apps = @tmp; - - open F, ">git.sln" || die "Could not open git.sln for writing!\n"; - binmode F, ":crlf :utf8"; - print F chr(0xFEFF); - print F "$SLN_HEAD"; - - foreach (@apps) { - my $appname = $_; - my $uuid = $build_structure{"APPS_${appname}_GUID"}; - print F "$SLN_PRE"; - my $vcxproj = $build_structure{"APPS_${appname}_VCXPROJ"}; - $vcxproj =~ s/\//\\/g; - $appname =~ s/.*\///; - print F "\"${appname}.proj\", \"${vcxproj}\", \"${uuid}\""; - print F "$SLN_POST"; - } - foreach (@libs) { - my $libname = $_; - my $uuid = $build_structure{"LIBS_${libname}_GUID"}; - print F "$SLN_PRE"; - my $vcxproj = $build_structure{"LIBS_${libname}_VCXPROJ"}; - $vcxproj =~ s/\//\\/g; - $libname =~ s/\//_/g; - print F "\"${libname}.proj\", \"${vcxproj}\", \"${uuid}\""; - print F "$SLN_POST"; - } - - print F << "EOM"; -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM64 = Debug|ARM64 - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|ARM64 = Release|ARM64 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection -EOM - print F << "EOM"; - GlobalSection(ProjectConfigurationPlatforms) = postSolution -EOM - foreach (@apps) { - my $appname = $_; - my $uuid = $build_structure{"APPS_${appname}_GUID"}; - print F "\t\t${uuid}.Debug|ARM64.ActiveCfg = Debug|ARM64\n"; - print F "\t\t${uuid}.Debug|ARM64.Build.0 = Debug|ARM64\n"; - print F "\t\t${uuid}.Debug|x64.ActiveCfg = Debug|x64\n"; - print F "\t\t${uuid}.Debug|x64.Build.0 = Debug|x64\n"; - print F "\t\t${uuid}.Debug|x86.ActiveCfg = Debug|Win32\n"; - print F "\t\t${uuid}.Debug|x86.Build.0 = Debug|Win32\n"; - print F "\t\t${uuid}.Release|ARM64.ActiveCfg = Release|ARM64\n"; - print F "\t\t${uuid}.Release|ARM64.Build.0 = Release|ARM64\n"; - print F "\t\t${uuid}.Release|x64.ActiveCfg = Release|x64\n"; - print F "\t\t${uuid}.Release|x64.Build.0 = Release|x64\n"; - print F "\t\t${uuid}.Release|x86.ActiveCfg = Release|Win32\n"; - print F "\t\t${uuid}.Release|x86.Build.0 = Release|Win32\n"; - } - foreach (@libs) { - my $libname = $_; - my $uuid = $build_structure{"LIBS_${libname}_GUID"}; - print F "\t\t${uuid}.Debug|ARM64.ActiveCfg = Debug|ARM64\n"; - print F "\t\t${uuid}.Debug|ARM64.Build.0 = Debug|ARM64\n"; - print F "\t\t${uuid}.Debug|x64.ActiveCfg = Debug|x64\n"; - print F "\t\t${uuid}.Debug|x64.Build.0 = Debug|x64\n"; - print F "\t\t${uuid}.Debug|x86.ActiveCfg = Debug|Win32\n"; - print F "\t\t${uuid}.Debug|x86.Build.0 = Debug|Win32\n"; - print F "\t\t${uuid}.Release|ARM64.ActiveCfg = Release|ARM64\n"; - print F "\t\t${uuid}.Release|ARM64.Build.0 = Release|ARM64\n"; - print F "\t\t${uuid}.Release|x64.ActiveCfg = Release|x64\n"; - print F "\t\t${uuid}.Release|x64.Build.0 = Release|x64\n"; - print F "\t\t${uuid}.Release|x86.ActiveCfg = Release|Win32\n"; - print F "\t\t${uuid}.Release|x86.Build.0 = Release|Win32\n"; - } - - print F << "EOM"; - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal -EOM - close F; -} - -1; diff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl deleted file mode 100755 index ee4fca200cc506..00000000000000 --- a/contrib/buildsystems/engine.pl +++ /dev/null @@ -1,395 +0,0 @@ -#!/usr/bin/perl -w -###################################################################### -# Do not call this script directly! -# -# The generate script ensures that @INC is correct before the engine -# is executed. -# -# Copyright (C) 2009 Marius Storm-Olsen -###################################################################### -use strict; -use File::Basename; -use File::Spec; -use Cwd; -use Generators; -use Text::ParseWords; - -my (%build_structure, %compile_options, @makedry); -my $out_dir = getcwd(); -my $git_dir = $out_dir; -$git_dir =~ s=\\=/=g; -$git_dir = dirname($git_dir) while (!-e "$git_dir/git.c" && "$git_dir" ne ""); -die "Couldn't find Git repo" if ("$git_dir" eq ""); - -my @gens = Generators::available(); -my $gen = "Vcproj"; - -sub showUsage -{ - my $genlist = join(', ', @gens); - print << "EOM"; -generate usage: - -g --gen Specify the buildsystem generator (default: $gen) - Available: $genlist - -o --out Specify output directory generation (default: .) - --make-out Write the output of GNU Make into a file - -i --in Specify input file, instead of running GNU Make - -h,-? --help This help -EOM - exit 0; -} - -# Parse command-line options -my $make_out; -while (@ARGV) { - my $arg = shift @ARGV; - if ("$arg" eq "-h" || "$arg" eq "--help" || "$arg" eq "-?") { - showUsage(); - exit(0); - } elsif("$arg" eq "--out" || "$arg" eq "-o") { - $out_dir = shift @ARGV; - } elsif("$arg" eq "--make-out") { - $make_out = shift @ARGV; - } elsif("$arg" eq "--gen" || "$arg" eq "-g") { - $gen = shift @ARGV; - } elsif("$arg" eq "--in" || "$arg" eq "-i") { - my $infile = shift @ARGV; - open(F, "<$infile") || die "Couldn't open file $infile"; - @makedry = ; - close(F); - } else { - die "Unknown option: " . $arg; - } -} - -# NOT using File::Spec->rel2abs($path, $base) here, as -# it fails badly for me in the msysgit environment -$git_dir = File::Spec->rel2abs($git_dir); -$out_dir = File::Spec->rel2abs($out_dir); -my $rel_dir = makeOutRel2Git($git_dir, $out_dir); - -# Print some information so the user feels informed -print << "EOM"; ------ -Generator: $gen -Git dir: $git_dir -Out dir: $out_dir ------ -Running GNU Make to figure out build structure... -EOM - -# Pipe a make --dry-run into a variable, if not already loaded from file -# Capture the make dry stderr to file for review (will be empty for a release build). - -my $ErrsFile = "msvc-build-makedryerrors.txt"; -@makedry = `make -C $git_dir -n MSVC=1 SKIP_VCPKG=1 V=1 2>$ErrsFile` -if !@makedry; -# test for an empty Errors file and remove it -unlink $ErrsFile if -f -z $ErrsFile; - -if (defined $make_out) { - open OUT, ">" . $make_out; - print OUT @makedry; - close OUT; -} - -# Parse the make output into usable info -parseMakeOutput(); - -# Finally, ask the generator to start generating.. -Generators::generate($gen, $git_dir, $out_dir, $rel_dir, %build_structure); - -# main flow ends here -# ------------------------------------------------------------------------------------------------- - - -# 1) path: /foo/bar/baz 2) path: /foo/bar/baz 3) path: /foo/bar/baz -# base: /foo/bar/baz/temp base: /foo/bar base: /tmp -# rel: .. rel: baz rel: ../foo/bar/baz -sub makeOutRel2Git -{ - my ($path, $base) = @_; - my $rel; - if ("$path" eq "$base") { - return "."; - } elsif ($base =~ /^$path/) { - # case 1 - my $tmp = $base; - $tmp =~ s/^$path//; - foreach (split('/', $tmp)) { - $rel .= "../" if ("$_" ne ""); - } - } elsif ($path =~ /^$base/) { - # case 2 - $rel = $path; - $rel =~ s/^$base//; - $rel = "./$rel"; - } else { - my $tmp = $base; - foreach (split('/', $tmp)) { - $rel .= "../" if ("$_" ne ""); - } - $rel .= $path; - } - $rel =~ s/\/\//\//g; # simplify - $rel =~ s/\/$//; # don't end with / - return $rel; -} - -sub parseMakeOutput -{ - print "Parsing GNU Make output to figure out build structure...\n"; - my $line = 0; - while (my $text = shift @makedry) { - my $ate_next; - do { - $ate_next = 0; - $line++; - chomp $text; - chop $text if ($text =~ /\r$/); - if ($text =~ /\\$/) { - $text =~ s/\\$//; - $text .= shift @makedry; - $ate_next = 1; - } - } while($ate_next); - - if ($text =~ /^test /) { - # options to test (eg -o) may be mistaken for linker options - next; - } - - if ($text =~ /^(mkdir|msgfmt) /) { - # options to the Portable Object translations - # the line "mkdir ... && msgfmt ..." contains no linker options - next; - } - - if($text =~ / -c / || $text =~ / -i \S+\.rc /) { - # compilation - handleCompileLine($text, $line); - - } elsif ($text =~ / -o /) { - # linking executable - handleLinkLine($text, $line); - - } elsif ($text =~ /\.o / && $text =~ /\.a /) { - # libifying - handleLibLine($text, $line); -# -# } elsif ($text =~ /^cp /) { -# # copy file around -# -# } elsif ($text =~ /^rm -f /) { -# # shell command -# -# } elsif ($text =~ /^make[ \[]/) { -# # make output -# -# } elsif ($text =~ /^echo /) { -# # echo to file -# -# } elsif ($text =~ /^if /) { -# # shell conditional -# -# } elsif ($text =~ /^tclsh /) { -# # translation stuff -# -# } elsif ($text =~ /^umask /) { -# # handling boilerplates -# -# } elsif ($text =~ /\$\(\:\)/) { -# # ignore -# -# } elsif ($text =~ /^FLAGS=/) { -# # flags check for dependencies -# -# } elsif ($text =~ /^'\/usr\/bin\/perl' -MError -e/) { -# # perl commands for copying files -# -# } elsif ($text =~ /generate-cmdlist\.sh/) { -# # command for generating list of commands -# -# } elsif ($text =~ /new locations or Tcl/) { -# # command for detecting Tcl/Tk changes -# -# } elsif ($text =~ /mkdir -p/) { -# # command creating path -# -# } elsif ($text =~ /: no custom templates yet/) { -# # whatever -# -# } else { -# print "Unhandled (line: $line): $text\n"; - } - } - -# use Data::Dumper; -# print "Parsed build structure:\n"; -# print Dumper(%build_structure); -} - -# variables for the compilation part of each step -my (@defines, @incpaths, @cflags, @sources); - -sub clearCompileStep -{ - @defines = (); - @incpaths = (); - @cflags = (); - @sources = (); -} - -sub removeDuplicates -{ - my (%dupHash, $entry); - %dupHash = map { $_, 1 } @defines; - @defines = keys %dupHash; - - %dupHash = map { $_, 1 } @incpaths; - @incpaths = keys %dupHash; - - %dupHash = map { $_, 1 } @cflags; - @cflags = keys %dupHash; -} - -sub handleCompileLine -{ - my ($line, $lineno) = @_; - my @parts = shellwords($line); - my $sourcefile; - shift(@parts); # ignore cmd - while (my $part = shift @parts) { - if ("$part" eq "-o") { - # ignore object file - shift @parts; - } elsif ("$part" eq "-c" || "$part" eq "-i" || "$part" =~ /^-fno-/ || "$part" eq '-pedantic') { - # ignore compile flag - } elsif ($part =~ /^.?-I/) { - push(@incpaths, $part); - } elsif ($part =~ /^.?-D/) { - push(@defines, $part); - } elsif ($part =~ /^-/) { - push(@cflags, $part); - } elsif ($part =~ /\.(c|cc|cpp|rc)$/) { - $sourcefile = $part; - } else { - die "Unhandled compiler option @ line $lineno: $part"; - } - } - @{$compile_options{"${sourcefile}_CFLAGS"}} = @cflags; - @{$compile_options{"${sourcefile}_DEFINES"}} = @defines; - @{$compile_options{"${sourcefile}_INCPATHS"}} = @incpaths; - clearCompileStep(); -} - -sub handleLibLine -{ - my ($line, $lineno) = @_; - my (@objfiles, @lflags, $libout, $part); - # kill cmd and rm 'prefix' - $line =~ s/^rm -f .* && .* rcs //; - my @parts = shellwords($line); - while ($part = shift @parts) { - if ($part =~ /^-/) { - push(@lflags, $part); - } elsif ($part =~ /\.(o|obj)$/) { - push(@objfiles, $part); - } elsif ($part =~ /\.(a|lib)$/) { - $libout = $part; - $libout =~ s/\.a$//; - } else { - die "Unhandled lib option @ line $lineno: $part"; - } - } -# print "LibOut: '$libout'\nLFlags: @lflags\nOfiles: @objfiles\n"; -# exit(1); - foreach (@objfiles) { - my $sourcefile = $_; - $sourcefile =~ s/\.o$/.c/; - push(@sources, $sourcefile); - push(@cflags, @{$compile_options{"${sourcefile}_CFLAGS"}}); - push(@defines, @{$compile_options{"${sourcefile}_DEFINES"}}); - push(@incpaths, @{$compile_options{"${sourcefile}_INCPATHS"}}); - } - removeDuplicates(); - - push(@{$build_structure{"LIBS"}}, $libout); - @{$build_structure{"LIBS_${libout}"}} = ("_DEFINES", "_INCLUDES", "_CFLAGS", "_SOURCES", - "_OBJECTS"); - @{$build_structure{"LIBS_${libout}_DEFINES"}} = @defines; - @{$build_structure{"LIBS_${libout}_INCLUDES"}} = @incpaths; - @{$build_structure{"LIBS_${libout}_CFLAGS"}} = @cflags; - @{$build_structure{"LIBS_${libout}_LFLAGS"}} = @lflags; - @{$build_structure{"LIBS_${libout}_SOURCES"}} = @sources; - @{$build_structure{"LIBS_${libout}_OBJECTS"}} = @objfiles; - clearCompileStep(); -} - -sub handleLinkLine -{ - my ($line, $lineno) = @_; - my (@objfiles, @lflags, @libs, $appout, $part); - my @parts = shellwords($line); - shift(@parts); # ignore cmd - while ($part = shift @parts) { - if ($part =~ /^-IGNORE/) { - push(@lflags, $part); - } elsif ($part =~ /^-[GRIMDO]/) { - # eat compiler flags - } elsif ("$part" eq "-o") { - $appout = shift @parts; - } elsif ("$part" eq "-lz") { - push(@libs, "zlib.lib"); - } elsif ("$part" eq "-lcrypto") { - push(@libs, "libcrypto.lib"); - } elsif ("$part" eq "-lssl") { - push(@libs, "libssl.lib"); - } elsif ("$part" eq "-lcurl") { - push(@libs, "libcurl.lib"); - } elsif ("$part" eq "-lexpat") { - push(@libs, "libexpat.lib"); - } elsif ("$part" eq "-liconv") { - push(@libs, "iconv.lib"); - } elsif ($part =~ /^[-\/]/) { - push(@lflags, $part); - } elsif ($part =~ /\.(a|lib)$/) { - $part =~ s/\.a$/.lib/; - push(@libs, $part); - } elsif ($part eq 'invalidcontinue.obj') { - # ignore - known to MSVC - } elsif ($part =~ /\.(o|res)$/) { - push(@objfiles, $part); - } elsif ($part =~ /\.obj$/) { - # do nothing, 'make' should not be producing .obj, only .o files - } else { - die "Unhandled link option @ line $lineno: $part"; - } - } -# print "AppOut: '$appout'\nLFlags: @lflags\nLibs : @libs\nOfiles: @objfiles\n"; -# exit(1); - foreach (@objfiles) { - my $sourcefile = $_; - $sourcefile =~ s/^headless-git\.o$/compat\/win32\/headless.c/; - $sourcefile =~ s/\.o$/.c/; - $sourcefile =~ s/\.res$/.rc/; - push(@sources, $sourcefile); - push(@cflags, @{$compile_options{"${sourcefile}_CFLAGS"}}); - push(@defines, @{$compile_options{"${sourcefile}_DEFINES"}}); - push(@incpaths, @{$compile_options{"${sourcefile}_INCPATHS"}}); - } - removeDuplicates(); - - removeDuplicates(); - push(@{$build_structure{"APPS"}}, $appout); - @{$build_structure{"APPS_${appout}"}} = ("_DEFINES", "_INCLUDES", "_CFLAGS", "_LFLAGS", - "_SOURCES", "_OBJECTS", "_LIBS"); - @{$build_structure{"APPS_${appout}_DEFINES"}} = @defines; - @{$build_structure{"APPS_${appout}_INCLUDES"}} = @incpaths; - @{$build_structure{"APPS_${appout}_CFLAGS"}} = @cflags; - @{$build_structure{"APPS_${appout}_LFLAGS"}} = @lflags; - @{$build_structure{"APPS_${appout}_SOURCES"}} = @sources; - @{$build_structure{"APPS_${appout}_OBJECTS"}} = @objfiles; - @{$build_structure{"APPS_${appout}_LIBS"}} = @libs; - clearCompileStep(); -} diff --git a/contrib/buildsystems/generate b/contrib/buildsystems/generate deleted file mode 100755 index bc10f25ff24a74..00000000000000 --- a/contrib/buildsystems/generate +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/perl -w -###################################################################### -# Generate buildsystem files -# -# This script generate buildsystem files based on the output of a -# GNU Make --dry-run, enabling Windows users to develop Git with their -# trusted IDE with native projects. -# -# Note: -# It is not meant as *the* way of building Git with MSVC, but merely a -# convenience. The correct way of building Git with MSVC is to use the -# GNU Make tool to build with the maintained Makefile in the root of -# the project. If you have the msysgit environment installed and -# available in your current console, together with the Visual Studio -# environment you wish to build for, all you have to do is run the -# command: -# make MSVC=1 -# -# Copyright (C) 2009 Marius Storm-Olsen -###################################################################### -use strict; -use File::Basename; -use Cwd; - -my $git_dir = getcwd(); -$git_dir =~ s=\\=/=g; -$git_dir = dirname($git_dir) while (!-e "$git_dir/git.c" && "$git_dir" ne ""); -die "Couldn't find Git repo" if ("$git_dir" eq ""); -exec join(" ", ("PERL5LIB=${git_dir}/contrib/buildsystems ${git_dir}/contrib/buildsystems/engine.pl", @ARGV)); diff --git a/contrib/buildsystems/parse.pl b/contrib/buildsystems/parse.pl deleted file mode 100755 index c9656ece9931c4..00000000000000 --- a/contrib/buildsystems/parse.pl +++ /dev/null @@ -1,228 +0,0 @@ -#!/usr/bin/perl -w -###################################################################### -# Do not call this script directly! -# -# The generate script ensures that @INC is correct before the engine -# is executed. -# -# Copyright (C) 2009 Marius Storm-Olsen -###################################################################### -use strict; -use File::Basename; -use Cwd; - -my $file = $ARGV[0]; -die "No file provided!" if !defined $file; - -my ($cflags, $target, $type, $line); - -open(F, "<$file") || die "Couldn't open file $file"; -my @data = ; -close(F); - -while (my $text = shift @data) { - my $ate_next; - do { - $ate_next = 0; - $line++; - chomp $text; - chop $text if ($text =~ /\r$/); - if ($text =~ /\\$/) { - $text =~ s/\\$//; - $text .= shift @data; - $ate_next = 1; - } - } while($ate_next); - - if($text =~ / -c /) { - # compilation - handleCompileLine($text, $line); - - } elsif ($text =~ / -o /) { - # linking executable - handleLinkLine($text, $line); - - } elsif ($text =~ /\.o / && $text =~ /\.a /) { - # libifying - handleLibLine($text, $line); - -# } elsif ($text =~ /^cp /) { -# # copy file around -# -# } elsif ($text =~ /^rm -f /) { -# # shell command -# -# } elsif ($text =~ /^make[ \[]/) { -# # make output -# -# } elsif ($text =~ /^echo /) { -# # echo to file -# -# } elsif ($text =~ /^if /) { -# # shell conditional -# -# } elsif ($text =~ /^tclsh /) { -# # translation stuff -# -# } elsif ($text =~ /^umask /) { -# # handling boilerplates -# -# } elsif ($text =~ /\$\(\:\)/) { -# # ignore -# -# } elsif ($text =~ /^FLAGS=/) { -# # flags check for dependencies -# -# } elsif ($text =~ /^'\/usr\/bin\/perl' -MError -e/) { -# # perl commands for copying files -# -# } elsif ($text =~ /generate-cmdlist\.sh/) { -# # command for generating list of commands -# -# } elsif ($text =~ /^test / && $text =~ /|| rm -f /) { -# # commands removing executables, if they exist -# -# } elsif ($text =~ /new locations or Tcl/) { -# # command for detecting Tcl/Tk changes -# -# } elsif ($text =~ /mkdir -p/) { -# # command creating path -# -# } elsif ($text =~ /: no custom templates yet/) { -# # whatever - - } else { -# print "Unhandled (line: $line): $text\n"; - } -} -close(F); - -# use Data::Dumper; -# print "Parsed build structure:\n"; -# print Dumper(%build_structure); - -# ------------------------------------------------------------------- -# Functions under here -# ------------------------------------------------------------------- -my (%build_structure, @defines, @incpaths, @cflags, @sources); - -sub clearCompileStep -{ - @defines = (); - @incpaths = (); - @cflags = (); - @sources = (); -} - -sub removeDuplicates -{ - my (%dupHash, $entry); - %dupHash = map { $_, 1 } @defines; - @defines = keys %dupHash; - - %dupHash = map { $_, 1 } @incpaths; - @incpaths = keys %dupHash; - - %dupHash = map { $_, 1 } @cflags; - @cflags = keys %dupHash; - - %dupHash = map { $_, 1 } @sources; - @sources = keys %dupHash; -} - -sub handleCompileLine -{ - my ($line, $lineno) = @_; - my @parts = split(' ', $line); - shift(@parts); # ignore cmd - while (my $part = shift @parts) { - if ("$part" eq "-o") { - # ignore object file - shift @parts; - } elsif ("$part" eq "-c") { - # ignore compile flag - } elsif ("$part" eq "-c") { - } elsif ($part =~ /^.?-I/) { - push(@incpaths, $part); - } elsif ($part =~ /^.?-D/) { - push(@defines, $part); - } elsif ($part =~ /^-/) { - push(@cflags, $part); - } elsif ($part =~ /\.(c|cc|cpp)$/) { - push(@sources, $part); - } else { - die "Unhandled compiler option @ line $lineno: $part"; - } - } - #print "Sources: @sources\nCFlags: @cflags\nDefine: @defines\nIncpat: @incpaths\n"; - #exit(1); -} - -sub handleLibLine -{ - my ($line, $lineno) = @_; - my (@objfiles, @lflags, $libout, $part); - # kill cmd and rm 'prefix' - $line =~ s/^rm -f .* && .* rcs //; - my @parts = split(' ', $line); - while ($part = shift @parts) { - if ($part =~ /^-/) { - push(@lflags, $part); - } elsif ($part =~ /\.(o|obj)$/) { - push(@objfiles, $part); - } elsif ($part =~ /\.(a|lib)$/) { - $libout = $part; - } else { - die "Unhandled lib option @ line $lineno: $part"; - } - } - #print "LibOut: '$libout'\nLFlags: @lflags\nOfiles: @objfiles\n"; - #exit(1); - removeDuplicates(); - push(@{$build_structure{"LIBS"}}, $libout); - @{$build_structure{"LIBS_${libout}"}} = ("_DEFINES", "_INCLUDES", "_CFLAGS", "_SOURCES", - "_OBJECTS"); - @{$build_structure{"LIBS_${libout}_DEFINES"}} = @defines; - @{$build_structure{"LIBS_${libout}_INCLUDES"}} = @incpaths; - @{$build_structure{"LIBS_${libout}_CFLAGS"}} = @cflags; - @{$build_structure{"LIBS_${libout}_SOURCES"}} = @sources; - @{$build_structure{"LIBS_${libout}_OBJECTS"}} = @objfiles; - clearCompileStep(); -} - -sub handleLinkLine -{ - my ($line, $lineno) = @_; - my (@objfiles, @lflags, @libs, $appout, $part); - my @parts = split(' ', $line); - shift(@parts); # ignore cmd - while ($part = shift @parts) { - if ($part =~ /^-[GRIDO]/) { - # eat compiler flags - } elsif ("$part" eq "-o") { - $appout = shift @parts; - } elsif ($part =~ /^-/) { - push(@lflags, $part); - } elsif ($part =~ /\.(a|lib)$/) { - push(@libs, $part); - } elsif ($part =~ /\.(o|obj)$/) { - push(@objfiles, $part); - } else { - die "Unhandled lib option @ line $lineno: $part"; - } - } - #print "AppOut: '$appout'\nLFlags: @lflags\nLibs : @libs\nOfiles: @objfiles\n"; - #exit(1); - removeDuplicates(); - push(@{$build_structure{"APPS"}}, $appout); - @{$build_structure{"APPS_${appout}"}} = ("_DEFINES", "_INCLUDES", "_CFLAGS", "_LFLAGS", - "_SOURCES", "_OBJECTS", "_LIBS"); - @{$build_structure{"APPS_${appout}_DEFINES"}} = @defines; - @{$build_structure{"APPS_${appout}_INCLUDES"}} = @incpaths; - @{$build_structure{"APPS_${appout}_CFLAGS"}} = @cflags; - @{$build_structure{"APPS_${appout}_LFLAGS"}} = @lflags; - @{$build_structure{"APPS_${appout}_SOURCES"}} = @sources; - @{$build_structure{"APPS_${appout}_OBJECTS"}} = @objfiles; - @{$build_structure{"APPS_${appout}_LIBS"}} = @libs; - clearCompileStep(); -} From 5732514b1b60d4016de02a9f936f094136fd9ba4 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 30 Jan 2025 12:25:34 +0100 Subject: [PATCH 3/3] fixup! vcxproj: unclash project directories with build outputs Now that we dropped `contrib/buildsystems/generate` to generate Visual Studio Solution files, it is time to also drop the `vcxproj` Makefile target that depended on that script. Signed-off-by: Johannes Schindelin --- config.mak.uname | 78 ------------------------------------------------ 1 file changed, 78 deletions(-) diff --git a/config.mak.uname b/config.mak.uname index ba947f1b7df8f4..c1355eff9d6bd8 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -825,81 +825,3 @@ ifeq ($(uname_S),QNX) NO_STRCASESTR = YesPlease NO_STRLCPY = YesPlease endif - -vcxproj: - # Require clean work tree - git update-index -q --refresh && \ - git diff-files --quiet && \ - git diff-index --cached --quiet HEAD -- - - # Make .vcxproj files and add them - perl contrib/buildsystems/generate -g Vcxproj - git add -f git.sln {*,*/lib.proj,t/helper/*,reftable/libreftable{,_test}.proj}/*.vcxproj - - # Generate the LinkOrCopyBuiltins.targets and LinkOrCopyRemoteHttp.targets file - (echo '' && \ - echo ' ' && \ - for name in $(BUILT_INS);\ - do \ - echo ' '; \ - done && \ - echo ' ' && \ - echo '') >git.proj/LinkOrCopyBuiltins.targets - (echo '' && \ - echo ' ' && \ - for name in $(REMOTE_CURL_ALIASES); \ - do \ - echo ' '; \ - done && \ - echo ' ' && \ - echo '') >git-remote-http.proj/LinkOrCopyRemoteHttp.targets - git add -f git.proj/LinkOrCopyBuiltins.targets git-remote-http.proj/LinkOrCopyRemoteHttp.targets - - # Add generated headers - $(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(GENERATED_H) - git add -f $(GENERATED_H) - - # Add scripts - rm -f perl/perl.mak - $(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(SCRIPT_LIB) $(SCRIPTS) - # Strip out the sane tool path, needed only for building - sed -i '/^git_broken_path_fix ".*/d' git-sh-setup - git add -f $(SCRIPT_LIB) $(SCRIPTS) - -ifndef NO_PERL - # Add Perl module - $(MAKE) $(LIB_PERL_GEN) - git add -f perl/build -endif - - # Add bin-wrappers, for testing - rm -rf bin-wrappers/ - $(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(test_bindir_programs) - # Ensure that the GIT_EXEC_PATH is a Unix-y one, and that the absolute - # path of the repository is not hard-coded (GIT_EXEC_PATH will be set - # by test-lib.sh according to the current setup) - sed -i -e 's/^\(GIT_EXEC_PATH\)=.*/test -n "$${\1##*:*}" ||\ - \1="$$(cygpath -u "$$\1")"/' \ - -e "s|'$$(pwd)|\"\$$GIT_EXEC_PATH\"'|g" bin-wrappers/* - # Ensure that test-* helpers find the .dll files copied to top-level - sed -i 's|^PATH=.*|&:"$$GIT_EXEC_PATH"|' bin-wrappers/test-* - # We do not want to force hard-linking builtins - sed -i 's|\(git\)-\([-a-z]*\)\.exe"|\1.exe" \2|g' \ - bin-wrappers/git-{receive-pack,upload-archive} - git add -f $(test_bindir_programs) - - # Add templates - $(MAKE) -C templates - git add -f templates/boilerplates.made templates/blt/ - - # Add the translated messages - make MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(MOFILES) - git add -f $(MOFILES) - - # Add build options - $(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 GIT-BUILD-OPTIONS - git add -f GIT-BUILD-OPTIONS - - # Commit the whole shebang - git commit -m "Generate Visual Studio solution" \ - -m "Auto-generated by \`$(MAKE)$(MAKEFLAGS) $@\`"