summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: bf12d685c44f4aefe8dbf769f8e24ca6694db59f (plain)
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
DART ?= dart

.DEFAULT_GOAL := help
.PHONY: help install test lint format build check clean

help:
	@echo 'Targets:'
	@echo '  install    resolve the dependencies'
	@echo '  test       run the test suite (dart test)'
	@echo '  lint       dart format --set-exit-if-changed + dart analyze (read-only)'
	@echo '  format     apply dart format (writes)'
	@echo '  build      compile the CLI to build/cepis'
	@echo '  check      lint + test + build, in that order'
	@echo '  clean      remove build artefacts'

.dart_tool/package_config.json: pubspec.yaml
	$(DART) pub get

install: .dart_tool/package_config.json

test: install
	$(DART) test

lint: install
	$(DART) format --output=none --set-exit-if-changed .
	$(DART) analyze --fatal-infos

format: install
	$(DART) format .

build: install
	@mkdir -p build
	$(DART) compile exe bin/cepis.dart -o build/cepis

check: lint test build

clean:
	rm -rf build .dart_tool