@@ -10,35 +10,35 @@ REPOROOT=$(git rev-parse --show-toplevel)
10
10
TOOLSROOT=$REPOROOT /Tools
11
11
12
12
# Setup tools and build flags
13
- SWIFT_EXEC=${SWIFT_EXEC:- ` xcrun -f swift` }
14
- CLANG=${CLANG:- ` xcrun -f clang` }
13
+ SWIFT_EXEC=${SWIFT_EXEC:- $( xcrun -f swift) }
14
+ CLANG=${CLANG:- $( xcrun -f clang) }
15
15
SWIFT_FLAGS=" -enable-experimental-feature Embedded -disable-stack-protector"
16
16
CLANG_FLAGS=" -D__MACH__ -ffreestanding -mcpu=cortex-m0plus -mthumb"
17
17
LD_FLAGS=" -static -Wl,-e,_reset -dead_strip -Wl,-no_zero_fill_sections -Wl,-segalign,4 -Wl,-segaddr,__RESET,0x20000000 -Wl,-segaddr,__VECTORS,0x20000100 -Wl,-seg1addr,0x20000200 -Wl,-pagezero_size,0"
18
18
19
19
SWIFT_BUILD_FLAGS=" --triple armv6m-apple-none-macho --configuration release --verbose"
20
20
for SWIFT_FLAG in $SWIFT_FLAGS ; do
21
- SWIFT_BUILD_FLAGS+= " -Xswiftc $SWIFT_FLAG "
21
+ SWIFT_BUILD_FLAGS= " $SWIFT_BUILD_FLAGS -Xswiftc $SWIFT_FLAG "
22
22
done
23
23
24
24
for CLANG_FLAG in $CLANG_FLAGS ; do
25
- SWIFT_BUILD_FLAGS+= " -Xcc $CLANG_FLAG "
25
+ SWIFT_BUILD_FLAGS= " $SWIFT_BUILD_FLAGS -Xcc $CLANG_FLAG "
26
26
done
27
27
28
- PYTHON_EXEC=${PYTHON_EXEC:- ` xcrun -f python3` }
28
+ PYTHON_EXEC=${PYTHON_EXEC:- $( xcrun -f python3) }
29
29
MACHO2UF2=$TOOLSROOT /macho2uf2.py
30
30
31
31
# Build with Swift package manager
32
- $SWIFT_EXEC build $SWIFT_BUILD_FLAGS
32
+ $SWIFT_EXEC build " $SWIFT_BUILD_FLAGS "
33
33
34
34
# Get the output directory
35
- BUILDROOT=$( $SWIFT_EXEC build $SWIFT_BUILD_FLAGS --show-bin-path)
35
+ BUILDROOT=$( $SWIFT_EXEC build " $SWIFT_BUILD_FLAGS " --show-bin-path)
36
36
37
37
# Link
38
- $CLANG .build/release/Support.build/{ Support.c, crt0.S} .o .build/release/Blinky.build/* .o -target armv6m-apple-none-macho -o $BUILDROOT /blinky $LD_FLAGS
38
+ $CLANG .build/release/Support.build/Support.c.o .build/release/Support.build/ crt0.S.o .build/release/Blinky.build/* .o -target armv6m-apple-none-macho -o " $BUILDROOT " /blinky " $LD_FLAGS "
39
39
40
40
# Extract sections from executable into flashable binary
41
- $PYTHON_EXEC $MACHO2UF2 --pico-family $PICO_FAMILY $BUILDROOT /blinky $BUILDROOT /blinky.uf2 --base-address 0x20000000 --segments ' __TEXT,__DATA,__VECTORS,__RESET'
41
+ $PYTHON_EXEC " $MACHO2UF2 " --pico-family $PICO_FAMILY " $BUILDROOT " /blinky " $BUILDROOT " /blinky.uf2 --base-address 0x20000000 --segments ' __TEXT,__DATA,__VECTORS,__RESET'
42
42
43
43
# Echo final binary path
44
- ls -al $BUILDROOT /blinky.uf2
44
+ ls -al " $BUILDROOT " /blinky.uf2
0 commit comments