This repository was archived by the owner on Feb 21, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (56 loc) · 1.36 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
# cliq
# The Jule CLI Library
# https://github.com/adamperkowski/cliq
# Copyright (c) 2025, Adam Perkowski
# BSD 3-Clause License
JULEC = julec
JULEFMT = julefmt
NAME = cliq
MODULES = internal
ALL = . $(MODULES)
LIB = $(NAME).jule $(MODULES) jule.mod LICENSE README.md
EXAMPLES = simple autoHelp defaultValues
examples:
mkdir -p examples/bin
@for example in $(EXAMPLES); do \
cd examples/$$example; \
echo "Building $$example ..."; \
$(JULEC) . -o ../bin/$$example; \
cd ../..; \
done
run-examples: examples
echo
@for example in $(EXAMPLES); do \
echo "Running $$example ..."; \
./examples/bin/$$example $(TESTARGS); \
echo; \
done
format:
@for module in $(ALL); do \
echo "Formatting $$module ..."; \
$(JULEFMT) -w $$module; \
done
@for example in $(EXAMPLES); do \
echo "Formatting examples/$$example ..."; \
$(JULEFMT) -w examples/$$example; \
done
test:
mkdir -p bin
@for module in $(ALL); do \
echo -e "Testing $$module ...\n"; \
if $(JULEC) test $$module -o bin/$(NAME)_$$module-test; then \
if ! ./bin/$(NAME)_$$module-test; then \
exit 1; \
fi; \
else \
true; \
fi; \
done
package:
mkdir -p $(NAME)
cp -R $(LIB) $(NAME)
tar -czf $(NAME)-$(VERSION).tar.gz $(NAME)
zip -r $(NAME)-$(VERSION).zip $(NAME)
clean:
rm -rf bin examples/bin tests/bin $(NAME) *.tar.gz *.zip
.PHONY: examples run-examples format test clean