From 304df08fd7101cc19642e86b35f4c9ff00197fc6 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Wed, 14 Oct 2015 14:03:01 -0700 Subject: [PATCH] Refactor use of dotnetlibs for reduced rebuilding Also cleaned up Makefiles. Added `scripts/dotnetlibs` back to Git so Make doesn't ever have to create it (now I understand Peter's reasoning here). --- .gitignore | 12 +++++------- scripts/.gitignore | 26 +++++--------------------- scripts/Makefile | 19 +++++++++---------- scripts/dotnetlibs/.gitignore | 1 + 4 files changed, 20 insertions(+), 38 deletions(-) create mode 100644 scripts/dotnetlibs/.gitignore diff --git a/.gitignore b/.gitignore index 16092215a9..d41f12ba70 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,9 @@ .idea -.config/ -.local/ CMakeCache.txt CMakeFiles/ -Makefile -!scripts/Makefile cmake_install.cmake -scripts/*-tests.xml -scripts/powershell.inc -.bash_history +Makefile +!/scripts/Makefile +/.bash_history +/.local/ +/.config/ diff --git a/scripts/.gitignore b/scripts/.gitignore index 6b1b27ea78..d4e3fc14ef 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore @@ -1,24 +1,8 @@ -System.Collections.Immutable.*/ -System.Reflection.Metadata.*/ -Microsoft.Net.ToolsetCompilers.*/ -dotnetlibs/ -gen-all-files.txt -monad-src.diff -output.txt -string-resources-files.txt -string-resources-orig.txt -xunit.abstractions.*/ -xunit.core.*/ -xunit.extensibility.core.*/ -xunit.runner.console.*/ -TypeCatalogGen.exe -System.Collections.Immutable.dll -System.Reflection.Metadata.dll -commands-management-win.mk -commands-utility-win.mk -management-infrastructure-win.mk -system-automation-win.mk +*.txt +*.exe +*-tests.xml +*-win.mk CorePsTypeCatalog.cs +powershell.inc buildtemp/ exec_env/ - diff --git a/scripts/Makefile b/scripts/Makefile index a49c2bc637..b618553842 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -110,7 +110,7 @@ $(LIBPS_BUILD)/Makefile: ../src/monad-native/src/CMakeLists.txt cd $(LIBPS_BUILD) && cmake ../../../src/monad-native/src/ NATIVE_BINARIES=libps.so monad_native host_cmdline -$(addprefix dotnetlibs/, $(NATIVE_BINARIES)): $(LIBPS_BUILD)/Makefile dotnetlibs +$(addprefix dotnetlibs/, $(NATIVE_BINARIES)): $(LIBPS_BUILD)/Makefile $(MAKE) -j -C $(LIBPS_BUILD) cp $(addprefix $(LIBPS_BUILD)/, $(notdir $@)) dotnetlibs @@ -129,16 +129,11 @@ dotnetlibs/api-ms-win-core-registry-l1-1-0.dll: ../src/win-dll/lib-api-ms-win-co nuget.exe: wget 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' -dotnetlibs: - mkdir -p $@ - -buildtemp: nuget.exe dotnetlibs +# this creates the build output directories and restores packages from NuGet +buildtemp: nuget.exe mkdir -p $@ mono nuget.exe restore -PackagesDirectory buildtemp -# this is the execution environment from which all managed code is run -APP_BASE=exec_env/app_base - # this is an internal target, it's not intended to be called manually # # it will: @@ -149,6 +144,10 @@ APP_BASE=exec_env/app_base # # This rule does not copy coreclr, because the selection of debug or # release CoreCLR depends on the actual run target. + +# this is the execution environment from which all managed code is run +APP_BASE=exec_env/app_base + internal-prepare-exec_env: runps.sh $(POWERSHELL_RUN_TARGETS) rm -rf exec_env mkdir -p $(APP_BASE)/Modules @@ -228,11 +227,11 @@ clean-native: rm -rf buildtemp/libps-build clean: - rm -rf dotnetlibs exec_env powershell.inc + rm -rf dotnetlibs/* exec_env powershell.inc *-tests.xml # clean built stuff + buildtemp step cleanall: clean clean-native - rm -rf buildtemp *tests.xml + rm -rf buildtemp docker-build: docker build --no-cache=false -t image_ps . diff --git a/scripts/dotnetlibs/.gitignore b/scripts/dotnetlibs/.gitignore new file mode 100644 index 0000000000..72e8ffc0db --- /dev/null +++ b/scripts/dotnetlibs/.gitignore @@ -0,0 +1 @@ +*