blob: 7129b17c8a72d3928111234f084dfef08170321c [file] [log] [blame]
Jason Campbell18fdb822016-05-23 11:21:57 -07001MAKEFLAGS += --warn-undefined-variables
2SHELL := /bin/bash
Jason Campbellfd8ae762016-01-04 13:53:41 -08003
Jason Campbell18fdb822016-05-23 11:21:57 -07004.SHELLFLAGS := -eu -o pipefail -c
5.DEFAULT_GOAL := all
6.SUFFIXES:
7
8DIRNAME := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
9FLUTTER_BIN := $(DIRNAME)/deps/flutter/bin
10DART_BIN := $(FLUTTER_BIN)/cache/dart-sdk/bin
11PATH := $(FLUTTER_BIN):$(DART_BIN):$(PATH)
12
13.PHONY: all
14all: deps/flutter
15 @true # silences watch, do not remove.
16
17deps/flutter:
18 git clone https://github.com/flutter/flutter.git -b alpha $@
19 cd $@ && git checkout $(shell echo -e `cat FLUTTER_VERSION`)
20 flutter doctor
21 @touch $@
22
23.PHONY: clean
Jason Campbell3ba816a2016-05-27 19:07:00 -070024clean: depclean
Jason Campbell81ea28d2016-01-04 13:55:14 -080025 @true
26
Jason Campbell18fdb822016-05-23 11:21:57 -070027.PHONY: depclean
28depclean:
29 @rm -rf deps/flutter
30
31.PHONY: packages
32packages: examples/todos/packages
33
34examples/todos/packages: examples/todos/pubspec.yaml deps/flutter
35 cd examples/todos && pub get
36 @touch $@
37
38.PHONY: analyze
39analyze: deps/flutter packages
40 cd examples/todos/ && flutter analyze
41
42.PHONY: test
43test: packages analyze deps/flutter
44 cd examples/todos/ && flutter test
45
46.PHONY: fmt
47fmt: packages deps/flutter
48 cd examples/todos/ && dartfmt --overwrite lib