Skip to content

Commit

Permalink
build: win: Add a new zephyr-env.cmd file
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
carlescufi authored and Anas Nashif committed Feb 13, 2018
1 parent 7a9b688 commit 980c0cf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions doc/getting_started/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -190,7 +190,7 @@ must be installed.
set ZEPHYR_GCC_VARIANT=
set ZEPHYR_SDK_INSTALL_DIR=
cd <zephyr git clone location>
set ZEPHYR_BASE=%cd%
zephyr-env.cmd
#. On UNIX platforms, Build Kconfig in :file:`$ZEPHYR_BASE/build` and add
Expand Down
10 changes: 7 additions & 3 deletions doc/getting_started/installation_win.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions zephyr-env.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
set ZEPHYR_BASE=%~dp0

0 comments on commit 980c0cf

Please sign in to comment.