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