-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
122 lines (107 loc) · 3.42 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Default configuration, can be customized on the command line or in config.mk.
#
# Example using environemnt variables:
#
# export FLUTTER_SDK_ROOT := $(dirname $(which flutter))
# make -e
#
# Example using the command line:
#
# make OUTDIR="$( mktemp -d )" TMPDIR="$( mktemp -d )"
#
# Example using config.mk:
#
# echo 'FLUTTER_BUILD := web android' >> config.mk
# echo 'FLUTTER_SDK_ROOT := ~/flutter' >> config.mk
# make
#
DEBUG = 1
COVERAGE = 1
OUTDIR = out
TMPDIR = tmp
FLUTTER_BUILD = web # appbundle ios linux macos windows ...?
FLUTTER_DEVICE = #web-server
FLUTTER_SDK_ROOT = $(TMPDIR)/flutter
GOMOBILE_TAGS = #android ios macos
TMPBINDIR := $(TMPDIR)/bin
ifneq ($(realpath config.mk),)
include config.mk
endif
# Set the default target, which is the first defined target.
#
# Later, the real-all target will be defined to depend on targets defined in
# other files.
#
.PHONY: default
default: download lint test build
# Clear out the default rules:
.SUFFIXES:
$(OUTDIR):
mkdir -p $@
$(TMPDIR):
mkdir -p $@
# Make it easy to build temporary binaries that can be found on $PATH during
# later build steps. Required for `gomobile` to be able to find `gobind`.
export PATH := $(TMPBINDIR):$(PATH)
# Flutter as wrapped for Nix sometimes tries to write to a read-only path. This
# is a work-around to make it write to the default Linux/OSX location.
ifeq ($(shell [ -w $HOME ] && echo home),home)
export PUB_CACHE := $(HOME)/.pub-cache
else
export PUB_CACHE := $(TMPDIR)/.pub-cache
endif
# Initialize variables that will accumulate names of targets defined in other
# files.
#
DOWNLOAD_TARGETS :=
FORMAT_TARGETS :=
LINT_TARGETS :=
BUILD_TARGETS :=
TEST_TARGETS :=
CLEAN_TARGETS :=
include build/make/version_globals.mk
include build/make/cc_globals.mk
include build/make/gomobile_globals.mk
include build/make/common.mk
include build/make/go.mk
#include build/make/dart.mk # not in use right now
#include build/make/flutter.mk # not in use right now
# TODO: resolve build problems with keychain module on OSX
#include cmd/note-maps/build.mk
# TODO: bring third_party/zefyr customizations up to date or remove it.
#include dart/nm_delta/build.mk
#include dart/nm_delta_notus/build.mk
#include flutter/nm_app/build.mk
# TODO: resolve build problems with nm_gql_go_link
#include flutter/nm_gql_go_link/build.mk
.PHONY: clean test real-all
download: $(OUTDIR) $(TMPDIR) $(DOWNLOAD_TARGETS)
format: $(FORMAT_TARGETS)
lint: $(LINT_TARGETS)
build: $(BUILD_TARGETS)
clean: $(CLEAN_TARGETS)
rm -rf $(OUTDIR)
test: $(TEST_TARGETS)
.PHONY: fdroid
fdroid: $(OUTDIR)/fdroid/fdroid/repo/index.xml
$(OUTDIR)/fdroid/fdroid/repo/index.xml: $(OUTDIR)/flutter/nm_app/app/outputs/apk/release/*.apk
mkdir -p fdroid/repo
cp $^ fdroid/repo/
cd fdroid ; fdroid update
rm -rf $(OUTDIR)/fdroid
mkdir -p $(OUTDIR)/fdroid/fdroid
mv fdroid/repo $(OUTDIR)/fdroid/fdroid/repo
mv fdroid/archive $(OUTDIR)/fdroid/archive