-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (55 loc) · 1.65 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright 2017 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
MAKEFLAGS += --warn-undefined-variables --no-print-directory
SHELL := /bin/bash
.SHELLFLAGS := -eu -o pipefail -c
.DEFAULT_GOAL := all
.DELETE_ON_ERROR:
.SUFFIXES:
root := $(shell pwd)
fuchsia_root := $(realpath $(root)/../..)
fuchsia_out := $(realpath $(fuchsia_root)/out)
flutter_bin := $(fuchsia_root)/lib/flutter/bin
flutter := $(flutter_bin)/flutter
sources := $(shell find $(root) \
-name "*.dart" \
-o -name "*.fidl" \
-o -name "*.gn" \
-o -name "*.sh" \
-o -name "*.yaml")
PHONY: all
all: build
PHONY: build
build: ## Build Fuchsia (including this app).
./tools/build.sh
PHONY: test
test: ## Run the tests.
@true
PHONY: test
presubmit: lint test
PHONY: run
run: ## Run on Fuchsia.
./tools/run.sh
PHONY: lint
lint: dart-lint copyright-check ## Lint the code.
PHONY: flutter
flutter-run: ## Run via `flutter run`.
# TODO(jasoncampbell): Trap and remove .packages when this process is
# done.
cd $(root)/modules/chat && \
$(flutter) upgrade && \
$(flutter) build clean && \
$(flutter) run --hot
PHONY: dart-lint
dart-lint: build
$(fuchsia_root)/scripts/run-dart-analysis.py \
--out=$(fuchsia_out)/debug-x86-64 \
--tree=//apps/chat/* \
--lints --fatal-lints --fatal-warnings
PHONY: copyright-check
copyright-check: ## Check source files for missing copyright.
@./tools/copyright-check.sh $(sources)
.PHONY: help
help: ## Displays this help message.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%-20s %s\n", $$1, $$2}'