Jason Campbell | 18fdb82 | 2016-05-23 11:21:57 -0700 | [diff] [blame] | 1 | MAKEFLAGS += --warn-undefined-variables |
| 2 | SHELL := /bin/bash |
Jason Campbell | fd8ae76 | 2016-01-04 13:53:41 -0800 | [diff] [blame] | 3 | |
Jason Campbell | 18fdb82 | 2016-05-23 11:21:57 -0700 | [diff] [blame] | 4 | .SHELLFLAGS := -eu -o pipefail -c |
| 5 | .DEFAULT_GOAL := all |
| 6 | .SUFFIXES: |
| 7 | |
| 8 | DIRNAME := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) |
| 9 | FLUTTER_BIN := $(DIRNAME)/deps/flutter/bin |
| 10 | DART_BIN := $(FLUTTER_BIN)/cache/dart-sdk/bin |
| 11 | PATH := $(FLUTTER_BIN):$(DART_BIN):$(PATH) |
| 12 | |
| 13 | .PHONY: all |
| 14 | all: deps/flutter |
| 15 | @true # silences watch, do not remove. |
| 16 | |
| 17 | deps/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 Campbell | 3ba816a | 2016-05-27 19:07:00 -0700 | [diff] [blame] | 24 | clean: depclean |
Jason Campbell | 81ea28d | 2016-01-04 13:55:14 -0800 | [diff] [blame] | 25 | @true |
| 26 | |
Jason Campbell | 18fdb82 | 2016-05-23 11:21:57 -0700 | [diff] [blame] | 27 | .PHONY: depclean |
| 28 | depclean: |
| 29 | @rm -rf deps/flutter |
| 30 | |
| 31 | .PHONY: packages |
| 32 | packages: examples/todos/packages |
| 33 | |
| 34 | examples/todos/packages: examples/todos/pubspec.yaml deps/flutter |
| 35 | cd examples/todos && pub get |
| 36 | @touch $@ |
| 37 | |
| 38 | .PHONY: analyze |
| 39 | analyze: deps/flutter packages |
| 40 | cd examples/todos/ && flutter analyze |
| 41 | |
| 42 | .PHONY: test |
| 43 | test: packages analyze deps/flutter |
| 44 | cd examples/todos/ && flutter test |
| 45 | |
| 46 | .PHONY: fmt |
| 47 | fmt: packages deps/flutter |
| 48 | cd examples/todos/ && dartfmt --overwrite lib |