blob: a1f6f1f3bb3e310c92cbdaba5784c8055ef8d264 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# Builds tool/go.exe, a thin wrapper that execs the Tailscale Go
# toolchain without going through cmd.exe (which mangles ^ and other
# special characters in arguments).
# See https://github.com/tailscale/tailscale/issues/19255
#
# Built as no_std Rust with raw Win32 API calls for minimal size (~17KB).
# The resulting go.exe is checked into the repo at tool/go.exe.
#
# Built as 32-bit x86 so one binary runs on x86, x64 (via WoW64),
# and ARM64 (via Windows x86 emulation).
#
# Requirements:
# rustup target add i686-pc-windows-gnu
# apt install gcc-mingw-w64-i686 (or equivalent)
RUST_TARGET = i686-pc-windows-gnu
.PHONY: all clean
all: go.exe
go.exe: src/main.rs Cargo.toml
cargo build --release --target $(RUST_TARGET)
cp target/$(RUST_TARGET)/release/go.exe $@
clean:
rm -f go.exe
rm -rf target
|