-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
57 lines (43 loc) · 1.72 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
idris2dart = build/exec/idris2dart
.PHONY: all
all: $(idris2dart) flutter
.PHONY: install
install: all
$(idris2dart): $(shell find src -type f -iname "*.idr") idris2dart.ipkg
idris2 --build idris2dart.ipkg
dart-ffi-dir = ./packages/dart-ffi
dart-ffi-install-cookie = $(dart-ffi-dir)/build/installed
dart-ffi-sources = $(shell find $(dart-ffi-dir) -type f -iname "*.idr")
flutter-dir = ./packages/flutter
flutter-install-cookie = $(flutter-dir)/build/installed
flutter-sources = $(shell find $(flutter-dir) -type f -iname "*.idr")
.PHONY: flutter
flutter: $(flutter-install-cookie)
$(flutter-install-cookie): $(flutter-sources) $(dart-ffi-install-cookie)
cd $(flutter-dir) && idris2 --install-with-src ./flutter.ipkg
touch $(flutter-install-cookie)
$(dart-ffi-install-cookie): $(dart-ffi-sources)
cd $(dart-ffi-dir) && idris2 --install-with-src ./dart-ffi.ipkg
touch $(dart-ffi-install-cookie)
runtests = ./tests/build/exec/runtests
.PHONY: check
check: test examples
.PHONY: test
test: $(idris2dart) $(runtests)
cd tests && $(realpath $(runtests)) $(realpath $(idris2dart))
$(runtests): ./tests/*.idr ./tests/tests.ipkg $(dart-ffi-install-cookie)
cd tests && idris2 --build ./tests.ipkg
.PHONY: examples
examples: $(idris2dart) flutter
cd examples/sqlite3_example && $(realpath $(idris2dart)) --build sqlite3-example.ipkg
cd examples/fluttertemplate && $(realpath $(idris2dart)) --build fluttertemplate.ipkg
cd examples/flutterdoodle && $(realpath $(idris2dart)) --build flutterdoodle.ipkg
.PHONY: clean
clean:
rm -fr ./build/
rm -fr ./examples/sqlite3_example/build/
rm -fr ./examples/fluttertemplate/build/
rm -fr ./examples/flutterdoodle/build/
rm -fr ./tests/build/
rm -fr $(dart-ffi-dir)/build/
rm -fr $(flutter-dir)/build/