Skip to content

Commit 76c1c34

Browse files
authored
Add make.bat for the llvmlibc sample (#235) (#237)
This adapts the existing make.bat files from the picolibc samples to the llvmlibc sample so that it can run on Windows.
1 parent 2d561d5 commit 76c1c34

File tree

1 file changed

+45
-0
lines changed
  • arm-software/embedded/llvmlibc-samples/src/llvmlibc/baremetal-semihosting

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
@REM Copyright (c) 2025, Arm Limited and affiliates.
2+
@REM
3+
@REM Part of the Arm Toolchain project, under the Apache License v2.0 with LLVM Exceptions.
4+
@REM See https://llvm.org/LICENSE.txt for license information.
5+
@REM SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
7+
@if [%1]==[] goto :target_empty
8+
@set target=%1
9+
@goto :make
10+
:target_empty
11+
@set target=build
12+
13+
:make
14+
@if [%target%]==[build] goto :build
15+
@if [%target%]==[run] goto :run
16+
@if [%target%]==[clean] goto :clean
17+
@echo Error: unknown target "%target%"
18+
@exit /B 1
19+
20+
:build
21+
@if [%BIN_PATH%]==[] goto :bin_path_empty
22+
@call :build_fn
23+
@exit /B
24+
25+
:run
26+
@if exist hello.hex goto :do_run
27+
@if [%BIN_PATH%]==[] goto :bin_path_empty
28+
@call :build_fn
29+
:do_run
30+
qemu-system-arm.exe -M microbit -semihosting -nographic -device loader,file=hello.hex
31+
@exit /B
32+
33+
:clean
34+
if exist hello.elf del /q hello.elf
35+
if exist hello.hex del /q hello.hex
36+
@exit /B
37+
38+
:bin_path_empty
39+
@echo Error: BIN_PATH environment variable is not set
40+
@exit /B 1
41+
42+
:build_fn
43+
%BIN_PATH%\clang.exe --config=llvmlibc.cfg --target=armv6m-none-eabi -mfloat-abi=soft -march=armv6m -mfpu=none -nostartfiles -lsemihost -lsemihost -fno-exceptions -fno-rtti -g -T microbit-llvmlibc.ld -lm -o hello.elf hello.c vector.c crt0llvmlibc.c
44+
%BIN_PATH%\llvm-objcopy.exe -O ihex hello.elf hello.hex
45+
@exit /B

0 commit comments

Comments
 (0)