-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
104 lines (84 loc) · 2.53 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
en: setup
ifeq (,$(wildcard bin/kvrasm))
@echo "Building kvrasm executable."
@gcc src/kvrasm.c -o bin/kvrasm
endif
all: en es eo tok
setup:
ifeq (,$(wildcard bin))
@echo "Creating bin directory."
@mkdir bin
endif
ifeq (,$(wildcard roms))
@echo "Creating roms directory."
@mkdir roms
endif
es: setup
ifeq (,$(wildcard bin/kvrasm-es))
@echo "Building kvrasm-es executable."
@gcc src/kvrasm.c -o bin/kvrasm-es -D LANG_ES
endif
eo: setup
ifeq (,$(wildcard bin/kvrasm-eo))
@echo "Building kvrasm-eo executable."
@gcc src/kvrasm.c -o bin/kvrasm-eo -D LANG_EO
endif
tok: setup
ifeq (,$(wildcard bin/kvrasm-tok))
@echo "Building kvrasm-tok executable."
@gcc src/kvrasm.c -o bin/kvrasm-tok -D LANG_TOK
endif
test-all: test test-es test-eo test-tok
test: en
@echo "Testing kvrasm."
@bin/kvrasm examples/english/sierpinski.kvr roms/sierpinski.rom
@utils/uxncli roms/sierpinski.rom
@bin/kvrasm examples/english/tests.kvr roms/tests.rom
@utils/uxncli roms/tests.rom
test-es: es
@echo "Testing kvrasm-es."
@bin/kvrasm-es examples/spanish/sierpinski.kvres roms/sierpinski-es.rom
@utils/uxncli roms/sierpinski-es.rom
@bin/kvrasm-es examples/spanish/tests.kvres roms/tests-es.rom
@utils/uxncli roms/tests-es.rom
test-eo: eo
@echo "Testing kvrasm-eo."
@bin/kvrasm-eo examples/esperanto/sierpinski.kvreo roms/sierpinski-eo.rom
@utils/uxncli roms/sierpinski-eo.rom
@bin/kvrasm-eo examples/esperanto/tests.kvreo roms/tests-eo.rom
@utils/uxncli roms/tests-eo.rom
test-tok: tok
@echo "Testing kvrasm-tok."
@bin/kvrasm-tok examples/toki-pona/sierpinski.kvrtok roms/sierpinski-tok.rom
@utils/uxncli roms/sierpinski-tok.rom
@bin/kvrasm-tok examples/toki-pona/tests.kvrtok roms/tests-tok.rom
@utils/uxncli roms/tests-tok.rom
install-all: all install install-es install-eo install-tok
install: en install-setup install-path
@echo "Installing kvrasm at ~/bin directory."
@cp bin/kvrasm ~/bin
install-es: es install-setup install-path
@echo "Installing kvrasm-es at ~/bin directory."
@cp bin/kvrasm-es ~/bin
install-eo: eo install-setup install-path
@echo "Installing kvrasm-eo at ~/bin directory."
@cp bin/kvrasm-eo ~/bin
install-tok: tok install-setup install-path
@echo "Installing kvrasm-tok at ~/bin directory."
@cp bin/kvrasm-tok ~/bin
install-path:
@echo "Make sure that ~/bin is in your PATH."
install-setup:
ifeq (,$(wildcard ~/bin))
@echo "Creating ~/bin directory."
@mkdir ~/bin
endif
clean:
ifneq (,$(wildcard bin))
@echo "Deleting bin directory."
@rm -rf bin
endif
ifneq (,$(wildcard roms))
@echo "Deleting roms directory."
@rm -rf roms
endif