-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile
42 lines (32 loc) · 873 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
40
41
42
ifeq ($(shell uname -m),x86_64)
HOST_ARCH?=x86_64
ARCH?=amd64
else ifeq ($(shell uname -m),arm64)
HOST_ARCH?=aarch64
ARCH?=arm64
endif
ifeq ($(shell uname -o),Darwin)
OS?=darwin
else
OS?=linux
endif
VER=$(shell echo $(VERSION) | sed -e 's/\//_/g')
.PHONY: check
check: ## Run nix flake check
@sed -i 's/$$NHOST_PAT/$(NHOST_PAT)/' get_access_token.sh
nix flake check --print-build-logs
.PHONY: build
build: ## Build application and places the binary under ./result/bin
nix build $(docker-build-options) \
.\#cli-$(ARCH)-$(OS) \
--print-build-logs
.PHONY: build-docker-image
build-docker-image: ## Build docker image
nix build $(docker-build-options) \
.\#packages.$(HOST_ARCH)-linux.docker-image-$(ARCH) \
--print-build-logs
docker load < result
.PHONY: get-version
get-version: ## Return version
@echo $(VER) > VERSION
@echo $(VER)