From 16a2ae2fa8da42a2bc2572034f4bf05f3e4ad543 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Sun, 25 Oct 2015 20:37:36 -0700 Subject: [PATCH] Start build refactor with top-level Makefile - Recursively calls make in monad-linux and monad-build - Eventually will deprecate scripts dir - Makes monad-docker.sh shareable --- .gitignore | 15 +++----- Makefile | 42 +++++++++++++++++++++ scripts/monad-docker.sh => monad-docker.sh | 6 +-- scripts/packages.config => packages.config | 0 {scripts => tools}/nuget.exe | Bin 5 files changed, 51 insertions(+), 12 deletions(-) create mode 100644 Makefile rename scripts/monad-docker.sh => monad-docker.sh (88%) rename scripts/packages.config => packages.config (100%) rename {scripts => tools}/nuget.exe (100%) diff --git a/.gitignore b/.gitignore index d461991781..583886e2d4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,7 @@ -.idea -CMakeCache.txt -CMakeFiles/ -cmake_install.cmake -Makefile -!/scripts/Makefile +/.config +/.nuget\\packages\\/ /.bash_history -/.local/ -/.config/ -/indicationlog +/bin/ +/lib/ +/tools/ +*-tests.xml \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..e014f66543 --- /dev/null +++ b/Makefile @@ -0,0 +1,42 @@ +# the monad-linux superproject +export MONAD=$(realpath $(CURDIR)) + +all: powershell-native powershell-managed + +# managed code + +powershell-managed: + $(MAKE) -j -C src/monad-build all test + +# native code + +powershell-native: src/monad-native/Makefile + $(MAKE) -j -C src/monad-native + +src/monad-native/Makefile: + cd src/monad-native && cmake . + +# one-time setup + +tools/nuget.exe: + wget 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' + +bootstrap: tools/nuget.exe + mono $< restore -PackagesDirectory tools + +# run targets +export POWERSHELL=env LD_LIBRARY_PATH=$(MONAD)/lib CORE_ROOT=$(MONAD)/src/monad-ext/coreclr/Runtime PWRSH_ROOT=$(MONAD)/lib PSMODULEPATH=$(MONAD)/lib/Modules $(MONAD)/bin/powershell + +demo: + $(POWERSHELL) lib/powershell-simple.exe '"a","b","c","a","a" | Select-Object -Unique' + +shell: + $(POWERSHELL) lib/powershell-run.exe + +clean-monad: + $(MAKE) -C src/monad-build clean + +clean-native: + $(MAKE) -C src/monad-native clean + +clean: clean-monad diff --git a/scripts/monad-docker.sh b/monad-docker.sh similarity index 88% rename from scripts/monad-docker.sh rename to monad-docker.sh index e99b6505a3..676093260f 100755 --- a/scripts/monad-docker.sh +++ b/monad-docker.sh @@ -11,14 +11,14 @@ monad-tty() } # runs ephemeral andschwa/magrathea docker container with local -# directory mounted to /opt and workdir set to /opt/scripts +# directory mounted and workdir set to /opt monad-docker-run() { local CONSOLE=$1 shift 1 docker run --rm \ - --volume $(dirname $(pwd))/:/opt \ - --workdir /opt/scripts \ + --volume $(pwd)/:/opt \ + --workdir /opt \ $CONSOLE \ andschwa/magrathea:latest \ bash -c "$(monad-impersonate) bash -c '$*'" diff --git a/scripts/packages.config b/packages.config similarity index 100% rename from scripts/packages.config rename to packages.config diff --git a/scripts/nuget.exe b/tools/nuget.exe similarity index 100% rename from scripts/nuget.exe rename to tools/nuget.exe