-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
56 lines (46 loc) · 1.76 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
.PHONY: build-in-container build-binaries sock_stress clean
DEPS:=$(wildcard pkg/*.go) $(wildcard cmd/sock_stress/*.go) $(wildcard cmd/vsudd/*.go) Dockerfile.build Makefile
build-in-container: $(DEPS) clean
@echo "+ $@"
@docker build -t hyvsock-build -f ./Dockerfile.build .
@docker run --rm \
-v ${CURDIR}/bin:/go/src/github.com/khulnasoft-lab/hyvsock/bin \
hyvsock-build
build-binaries: vsudd sock_stress
sock_stress: bin/sock_stress.darwin bin/sock_stress.linux bin/sock_stress.exe
vsudd: bin/vsudd.linux
bin/vsudd.linux: $(DEPS)
@echo "+ $@"
GOOS=linux GOARCH=amd64 \
go build -o $@ -buildmode pie --ldflags '-s -w -extldflags "-static"' \
github.com/khulnasoft-lab/hyvsock/cmd/vsudd
bin/sock_stress.linux: $(DEPS)
@echo "+ $@"
GOOS=linux GOARCH=amd64 \
go build -o $@ -buildmode pie --ldflags '-s -w -extldflags "-static"' \
github.com/khulnasoft-lab/hyvsock/cmd/sock_stress
bin/sock_stress.darwin: $(DEPS)
@echo "+ $@"
GOOS=darwin GOARCH=amd64 \
go build -o $@ --ldflags '-extldflags "-fno-PIC"' \
github.com/khulnasoft-lab/hyvsock/cmd/sock_stress
bin/sock_stress.exe: $(DEPS)
@echo "+ $@"
GOOS=windows GOARCH=amd64 \
go build -o $@ \
github.com/khulnasoft-lab/hyvsock/cmd/sock_stress
# Target to build a bootable EFI ISO and kernel+initrd
khulnasoft-lab: build-in-container Dockerfile.khulnasoft-lab hvtest.yml
$(MAKE) -C c build-in-container
docker build -t hvtest-local -f Dockerfile.khulnasoft-lab .
khulnasoft-lab build -format kernel+initrd,iso-efi hvtest.yml
clean:
rm -rf bin c/build
fmt:
@echo "+ $@"
@gofmt -s -l . 2>&1 | grep -v ^vendor/ | xargs gofmt -s -l -w
lint:
@echo "+ $@"
$(if $(shell which golint || echo ''), , \
$(error Please install golint))
@test -z "$$(golint ./... 2>&1 | grep -v ^vendor/ | grep -v mock/ | tee /dev/stderr)"