@@ -25,10 +25,12 @@ include compat/vcbuild/MSVC-DEFS-GEN
25
25
# See if vcpkg and the vcpkg-build versions of the third-party
26
26
# libraries that we use are installed. We include the result
27
27
# to get $(vcpkg_*) variables defined for the Makefile.
28
+ ifeq (,$(SKIP_VCPKG))
28
29
compat/vcbuild/VCPKG-DEFS: compat/vcbuild/vcpkg_install.bat
29
30
@"$<"
30
31
include compat/vcbuild/VCPKG-DEFS
31
32
endif
33
+ endif
32
34
33
35
# We choose to avoid "if .. else if .. else .. endif endif"
34
36
# because maintaining the nesting to match is a pain. If
@@ -681,3 +683,77 @@ ifeq ($(uname_S),QNX)
681
683
NO_STRCASESTR = YesPlease
682
684
NO_STRLCPY = YesPlease
683
685
endif
686
+
687
+ vcxproj:
688
+ # Require clean work tree
689
+ git update-index -q --refresh && \
690
+ git diff-files --quiet && \
691
+ git diff-index --cached --quiet HEAD --
692
+
693
+ # Make .vcxproj files and add them
694
+ unset QUIET_GEN QUIET_BUILT_IN; \
695
+ perl contrib/buildsystems/generate -g Vcxproj
696
+ git add -f git.sln {*,*/lib,t/helper/*}/*.vcxproj
697
+
698
+ # Generate the LinkOrCopyBuiltins.targets file
699
+ (echo '<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">' && \
700
+ echo ' <Target Name="CopyBuiltins_AfterBuild" AfterTargets="AfterBuild">' && \
701
+ for name in $(BUILT_INS);\
702
+ do \
703
+ echo ' <Copy SourceFiles="$$(OutDir)\git.exe" DestinationFiles="$$(OutDir)\'"$$name"'" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />'; \
704
+ done && \
705
+ for name in $(REMOTE_CURL_ALIASES); \
706
+ do \
707
+ echo ' <Copy SourceFiles="$$(OutDir)\'"$(REMOTE_CURL_PRIMARY)"'" DestinationFiles="$$(OutDir)\'"$$name"'" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />'; \
708
+ done && \
709
+ echo ' </Target>' && \
710
+ echo '</Project>') >git/LinkOrCopyBuiltins.targets
711
+ git add -f git/LinkOrCopyBuiltins.targets
712
+
713
+ # Add command-list.h
714
+ $(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 command-list.h
715
+ git add -f command-list.h
716
+
717
+ # Add scripts
718
+ rm -f perl/perl.mak
719
+ $(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 \
720
+ $(SCRIPT_LIB) $(SCRIPT_SH_GEN) $(SCRIPT_PERL_GEN)
721
+ # Strip out the sane tool path, needed only for building
722
+ sed -i '/^git_broken_path_fix ".*/d' git-sh-setup
723
+ git add -f $(SCRIPT_LIB) $(SCRIPT_SH_GEN) $(SCRIPT_PERL_GEN)
724
+
725
+ # Add Perl module
726
+ $(MAKE) $(LIB_PERL_GEN)
727
+ git add -f perl/build
728
+
729
+ # Add bin-wrappers, for testing
730
+ rm -rf bin-wrappers/
731
+ $(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(test_bindir_programs)
732
+ # Ensure that the GIT_EXEC_PATH is a Unix-y one, and that the absolute
733
+ # path of the repository is not hard-coded (GIT_EXEC_PATH will be set
734
+ # by test-lib.sh according to the current setup)
735
+ sed -i -e 's/^\(GIT_EXEC_PATH\)=.*/test -n "$${\1##*:*}" ||\
736
+ \1="$$(cygpath -u "$$\1")"/' \
737
+ -e "s|'$$(pwd)|\"\$$GIT_EXEC_PATH\"'|g" bin-wrappers/*
738
+ # Ensure that test-* helpers find the .dll files copied to top-level
739
+ sed -i 's|^PATH=.*|&:"$$GIT_EXEC_PATH"|' bin-wrappers/test-*
740
+ # We do not want to force hard-linking builtins
741
+ sed -i 's|\(git\)-\([-a-z]*\)\.exe"|\1.exe" \2|g' \
742
+ bin-wrappers/git-{receive-pack,upload-archive}
743
+ git add -f $(test_bindir_programs)
744
+ # remote-ext is a builtin, but invoked as if it were external
745
+ sed 's|receive-pack|remote-ext|g' \
746
+ <bin-wrappers/git-receive-pack >bin-wrappers/git-remote-ext
747
+ git add -f bin-wrappers/git-remote-ext
748
+
749
+ # Add templates
750
+ $(MAKE) -C templates
751
+ git add -f templates/boilerplates.made templates/blt/
752
+
753
+ # Add build options
754
+ $(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 GIT-BUILD-OPTIONS
755
+ git add -f GIT-BUILD-OPTIONS
756
+
757
+ # Commit the whole shebang
758
+ git commit -m "Generate Visual Studio solution" \
759
+ -m "Auto-generated by \`$(MAKE)$(MAKEFLAGS) $@\`"
0 commit comments