-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
39 lines (27 loc) · 996 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
#
# sysbox-ipc Makefile
#
.PHONY: clean sysbox-ipc sysipc-grpc-fs-proto sysipc-grpc-mgr-proto lint list-packages
GO := go
SYSIPC_GRPC_FS_DIR := sysboxFsGrpc
SYSIPC_GRPC_MGR_DIR := sysboxMgrGrpc
sysbox-ipc: sysipc-grpc-fs-proto sysipc-grpc-mgr-proto
sysipc-grpc-fs-proto:
$(MAKE) -C $(SYSIPC_GRPC_FS_DIR)/sysboxFsProtobuf
sysipc-grpc-mgr-proto:
$(MAKE) -C $(SYSIPC_GRPC_MGR_DIR)/sysboxMgrProtobuf
# Note: we must build the protobuf before go mod tidy
gomod-tidy: sysipc-grpc-fs-proto sysipc-grpc-mgr-proto
$(GO) mod tidy
lint:
$(GO) vet $(allpackages)
$(GO) fmt $(allpackages)
listpackages:
@echo $(allpackages)
clean:
$(MAKE) -C $(SYSIPC_GRPC_FS_DIR)/sysboxFsProtobuf clean
$(MAKE) -C $(SYSIPC_GRPC_MGR_DIR)/sysboxMgrProtobuf clean
distclean: clean
# memoize allpackages, so that it's executed only once and only if used
_allpackages = $(shell $(GO) list ./... | grep -v vendor)
allpackages = $(if $(__allpackages),,$(eval __allpackages := $$(_allpackages)))$(__allpackages)