-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (42 loc) · 1.35 KB
/
Copy pathMakefile
File metadata and controls
59 lines (42 loc) · 1.35 KB
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
# SPDX-FileCopyrightText: 2025 Victor Freire <https://gluer.org>
#
# SPDX-License-Identifier: MIT
MLTON = mlton
SMLFMT = smlfmt
LUNARML = lunarml
LUA = lua
SRC_ROOT = lib/github.com/PerplexSystems/commandry
PATHMAP = smlpm.pathmap
SOURCES = lib.mlb \
$(wildcard $(SRC_ROOT)/*.sml) \
$(wildcard $(SRC_ROOT)/*.mlb) \
$(wildcard $(SRC_ROOT)/**/*.sml) \
$(wildcard $(SRC_ROOT)/**/*.mlb)
TESTS_SOURCES = $(SOURCES) \
$(wildcard tests/*.sml) \
$(wildcard tests/*.mlb) \
$(wildcard tests/**/*.sml) \
$(wildcard tests/**/*.mlb) \
$(wildcard docs/**/*.sml) \
$(wildcard docs/**/*.mlb)
all: build/mlton build/lunarml test
build:
mkdir -p $@/test
$(PATHMAP):
smlpm sync --dev
build/mlton: $(PATHMAP) $(SOURCES) build
$(MLTON) -mlb-path-map $(PATHMAP) -output $@ lib.mlb
build/lunarml: $(PATHMAP) $(SOURCES) build
$(LUNARML) --mlb-path-map $(PATHMAP) -B $$LUNARML_LIB compile --output $@ lib.mlb
build/test/mlton: $(PATHMAP) $(TESTS_SOURCES) build
$(MLTON) -mlb-path-map $(PATHMAP) -output $@ tests/tests.mlb
build/test/lunarml: $(PATHMAP) $(TESTS_SOURCES) build
$(LUNARML) --mlb-path-map $(PATHMAP) -B $$LUNARML_LIB compile --output $@ tests/tests.mlb
test: build/test/mlton build/test/lunarml
./build/test/mlton
$(LUA) ./build/test/lunarml
format: $(SOURCES) $(TEST_SOURCES)
$(SMLFMT) --force **/*.mlb
clean:
rm -rf build
.PHONY: all format clean test