File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
arm-software/embedded/llvmlibc-samples/src/llvmlibc/baremetal-semihosting Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments