From 980c0cf4acb6956db320533f78425dcbf3ce2d7c Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Mon, 12 Feb 2018 14:33:59 +0100 Subject: [PATCH] build: win: Add a new zephyr-env.cmd file Add a new zephyr-env.cmd that mirrors the functionality of zephyr-env.sh but on Windows platforms. It sets ZEPHYR_BASE to the location of the script. Signed-off-by: Carles Cufi --- doc/getting_started/getting_started.rst | 4 ++-- doc/getting_started/installation_win.rst | 10 +++++++--- zephyr-env.cmd | 2 ++ 3 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 zephyr-env.cmd diff --git a/doc/getting_started/getting_started.rst b/doc/getting_started/getting_started.rst index 20883f6b790..a16cbb11015 100644 --- a/doc/getting_started/getting_started.rst +++ b/doc/getting_started/getting_started.rst @@ -111,7 +111,7 @@ To build an example application follow these steps: # On Linux/macOS source zephyr-env.sh # On Windows - set ZEPHYR_BASE=%cd% + zephyr-env.cmd #. Build the :ref:`hello_world` example for the `arduino_101` board, enter: @@ -190,7 +190,7 @@ must be installed. set ZEPHYR_GCC_VARIANT= set ZEPHYR_SDK_INSTALL_DIR= cd - set ZEPHYR_BASE=%cd% + zephyr-env.cmd #. On UNIX platforms, Build Kconfig in :file:`$ZEPHYR_BASE/build` and add diff --git a/doc/getting_started/installation_win.rst b/doc/getting_started/installation_win.rst index f7a80b550c5..ec573a2651c 100644 --- a/doc/getting_started/installation_win.rst +++ b/doc/getting_started/installation_win.rst @@ -134,12 +134,16 @@ packages from their respective websites. set ZEPHYR_GCC_VARIANT=gccarmemb set GCCARMEMB_TOOLCHAIN_PATH=c:\gccarmemb - And for either, set the `ZEPHYR_BASE` environment variable to the root - of the Zephyr repository you cloned: + To use the same toolchain in new sessions in the future you can set the + variables in a ``.cmd`` file and run that every time you open a new + Command Prompt. + + And for either, run the :file:`zephyr-env.cmd` file in order to set the + :makevar:`ZEPHYR_BASE` environment variable: .. code-block:: console - set ZEPHYR_BASE=%userprofile%\zephyr + zephyr-env.cmd #. Finally, you can try building the :ref:`hello_world` sample to check things out. diff --git a/zephyr-env.cmd b/zephyr-env.cmd new file mode 100644 index 00000000000..28208a5cc2c --- /dev/null +++ b/zephyr-env.cmd @@ -0,0 +1,2 @@ +@echo off +set ZEPHYR_BASE=%~dp0