-
Notifications
You must be signed in to change notification settings - Fork 224
/
Makefile
36 lines (29 loc) · 1003 Bytes
/
Makefile
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
29
30
31
32
33
34
35
36
SHELL := $(shell if command -v bash > /dev/null; then echo /usr/bin/env bash -Eeuo pipefail; else echo /usr/bin/env sh -eu; fi)
true-asm: true.asm
nasm -o $@ $<
chmod +x $@
nasm --version > [email protected]
true-yolo: true-yolo.asm
nasm -o $@ $<
chmod +x $@
nasm --version > [email protected]
true-gcc: true.c
gcc -Wl,--strip-all -o $@ -static -Os -nostartfiles -fno-asynchronous-unwind-tables $<
gcc --version > [email protected]
true-go: true.go
CGO_ENABLED=0 go build -o $@ -ldflags '-d -s -w' $<
go version > [email protected]
# https://doc.rust-lang.org/edition-guide/rust-2018/platform-and-target-support/musl-support-for-fully-static-binaries.html
true-rust: true.rs
rustc --target x86_64-unknown-linux-musl -o $@ $<
strip $@ # hmm
rustc --version > [email protected]
true-tinygo: true.go
tinygo build -o $@ -no-debug -opt s $<
strip $@ # hmm
tinygo version > [email protected]
.PHONY: all
all: true-asm true-yolo true-gcc true-go true-rust true-tinygo
.PHONY: clean
clean:
set -x; rm -f true-{asm,yolo,gcc,go,rust,tinygo}{,.meta}