RouxAntoine
a2b5884726
support rootfs : - archlinux - ubuntu kernel 5.10.204 from url amazon url Co-authored-by: RouxAntoine <antoinroux@hotmail.fr> Co-committed-by: RouxAntoine <antoinroux@hotmail.fr>
37 lines
697 B
Makefile
37 lines
697 B
Makefile
.PHONY: build run ci
|
|
.EXPORT_ALL_VARIABLES:
|
|
|
|
GOARCH=amd64
|
|
#GOARCH=arm
|
|
#GOOS=darwin
|
|
GOOS=linux
|
|
|
|
LDFLAGS=-w -s -X antoine-roux.tk/projects/go/firecracker-netns/internal/version.Version=$$(git rev-list -1 HEAD)
|
|
GOBUILDFLAGS=-tags dev
|
|
|
|
EXEC=out/main
|
|
|
|
build: $(EXEC)
|
|
|
|
run: $(EXEC)
|
|
@chmod +x $(EXEC)
|
|
sudo $(EXEC)
|
|
|
|
NS=practical_murdock
|
|
ssh:
|
|
sudo ip netns exec $(NS) ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeychecking=no 172.16.0.2
|
|
|
|
ci:
|
|
golangci-lint run --fix
|
|
|
|
publish:
|
|
scp $(EXEC) sf314:~/firecracker/
|
|
|
|
dependencies:
|
|
go mod download
|
|
go mod verify
|
|
|
|
$(EXEC): cmd/main.go dependencies
|
|
@echo "build for os $$GOOS and arch $$GOARCH"
|
|
go build -o $@ -ldflags="$(LDFLAGS)" $(GOBUILDFLAGS) $<
|