-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
51 lines (44 loc) · 1.2 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
DEPS := **/*.go
ifeq ($(OS),Windows_NT)
MACHINE = WIN32
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
MACHINE += amd64
endif
ifeq ($(PROCESSOR_ARCHITECTURE),x86)
MACHINE += amd64
endif
ifeq ($(PROCESSOR_ARCHITECTURE),ARM64)
MACHINE += arm64
endif
ifeq ($(PROCESSOR_ARCHITECTURE),ARM)
MACHINE += arm64
endif
else
UNAME_S := $(shell uname -s)
UNAME_P := $(shell uname -p)
ifeq ($(UNAME_P),x86_64)
MACHINE += amd64
endif
ifneq ($(filter %86,$(UNAME_P)),)
MACHINE += amd64
endif
ifneq ($(filter arm%,$(UNAME_P)),)
MACHINE += arm64
endif
endif
PLATFORM ?= linux/$(MACHINE)
.PHONY: build
build:
@echo "building candice ${DEPS}"
cd cmd/build && go build . && bash build.sh
.PHONY: test
test: build
@echo "testing candice suite"
cd internals/tests && go test -v ./.
docker:
docker build --platform=$(PLATFORM) -t candice:latest .
docker-init: docker
docker run --platform=$(PLATFORM) -v .:/context candice:latest bash -c "cd context && candice init ."
RUN_CMD ?= run . --release
docker-run: docker
docker run --platform=$(PLATFORM) -v .:/context candice:latest bash -c "cd context && candice $(RUN_CMD)"