-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
35 lines (26 loc) · 768 Bytes
/
makefile
File metadata and controls
35 lines (26 loc) · 768 Bytes
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
GO=go
CARGO=cargo
GOFLAGS=-ldflags="-s -w"
ifeq ($(shell uname -s),Darwin)
GOFLAGS+=-buildmode=pie
endif
GO_COMPONENTS=$(shell find components -type d -depth 1 -exec basename {} \;)
RUST_COMPONENTS=$(shell find rust-components -type d -depth 1 -exec basename {} \;)
build-go-%:
$(GO) build $(GOFLAGS) -o bin/$* components/$*/cmd/main.go
build-rust-%:
$(CARGO) build --release --manifest-path=rust-components/$*/Cargo.toml
build:
@for component in $(GO_COMPONENTS); do \
$(MAKE) build-go-$$component; \
done
@for component in $(RUST_COMPONENTS); do \
$(MAKE) build-rust-$$component; \
done
test:
$(GO) test -v ./...
$(CARGO) test
work-init:
$(GO) work init
$(GO) work use . components/*
.PHONY: build-go-% build-rust-% build test deps work-init