-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
40 lines (27 loc) · 849 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
37
38
39
.PHONY: install build assets release guest v86 kernel
VERSION=0.2dev
ifeq ($(OS),Windows_NT)
ASSETS_DIR := .\assets
ENV86 := .\env86.exe
else
ASSETS_DIR := ./assets
ENV86 := ./env86
endif
all: assets build
build:
go build -ldflags="-X 'main.Version=${VERSION}'" -o $(ENV86) ./cmd/env86
install: build
mv ./env86 /usr/local/bin/env86
release:
VERSION=$(VERSION) goreleaser release --snapshot --clean
assets: guest kernel v86
guest: export GOOS=linux
guest: export GOARCH=386
guest:
cd ./cmd/guest86 && go build -o ../../assets/guest86 .
kernel:
docker build --platform=linux/386 -t env86-kernel -f ./scripts/Dockerfile.kernel ./scripts
docker run --rm --platform=linux/386 -v $(ASSETS_DIR):/dst env86-kernel
v86:
docker build -t env86-v86 -f ./scripts/Dockerfile.v86 ./scripts
docker run --rm -v $(ASSETS_DIR):/dst env86-v86