From a07f77ac5290e19e7c510c11c4fe16f68b3f86e6 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Tue, 8 Nov 2022 08:51:29 -0600 Subject: [PATCH] make: add 'rebuild' target (clean and reset sub-repos, then rebuild V) (#16357) --- GNUmakefile | 4 +++- make.bat | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 6254364e3..501de9877 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -85,7 +85,7 @@ endif endif endif -.PHONY: all clean check fresh_vc fresh_tcc fresh_legacy check_for_working_tcc +.PHONY: all clean rebuild check fresh_vc fresh_tcc fresh_legacy check_for_working_tcc ifdef prod VFLAGS+=-prod @@ -119,6 +119,8 @@ clean: rm -rf $(LEGACYLIBS) rm -rf $(VC) +rebuild: clean all + ifndef local latest_vc: $(VC)/.git/config cd $(VC) && $(GITCLEANPULL) diff --git a/make.bat b/make.bat index 9fbef3f25..a9d3a4afd 100644 --- a/make.bat +++ b/make.bat @@ -44,7 +44,7 @@ if !shift_counter! LSS 1 ( if "%~1" == "help" ( if not ["%~2"] == [""] set "subcmd=%~2"& shift& set /a shift_counter+=1 ) - for %%z in (build clean cleanall check help) do ( + for %%z in (build clean cleanall check help rebuild) do ( if "%~1" == "%%z" set target=%1& shift& set /a shift_counter+=1& goto :verifyopt ) ) @@ -98,6 +98,10 @@ echo ^> Delete old V executable(s) del v*.exe exit /b 0 +:rebuild +call :cleanall +goto :build + :help if [!subcmd!] == [] ( call :usage @@ -271,6 +275,7 @@ echo clean Clean build artifacts and debugging symbols echo cleanall Cleanup entire ALL build artifacts and vc repository echo check Check that tests pass, and the repository is in a good shape for Pull Requests echo help Display help for the given target +echo rebuild Fully clean/reset repository and rebuild V echo. echo Examples: echo make.bat -msvc @@ -316,6 +321,18 @@ echo --local Use the local vc repository without echo syncing with remote exit /b 0 +:help_rebuild +echo Usage: +echo make.bat rebuild [compiler] [options] +echo. +echo Compiler: +echo -msvc ^| -gcc ^| -tcc ^| -tcc32 ^| -clang Set C compiler +echo. +echo Options: +echo --local Use the local vc repository without +echo syncing with remote +exit /b 0 + :bootstrap_tcc echo Bootstrapping TCC... echo ^> TCC not found -- 2.30.2