~jojo/Carth

ref: e3dddf9c3a1dda00a3a054bfdfe157f36eced471 Carth/Makefile -rw-r--r-- 934 bytes
e3dddf9cJoJo Allow string literals as patterns 2 years ago
                                                                                
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
CARTH_DIR=~/.carth
BIN_DIR=$(CARTH_DIR)/bin
LIB_DIR=$(CARTH_DIR)/lib
MOD_DIR=$(CARTH_DIR)/mod

.PHONY: carth-bin
carth-bin: clean-stack
	(export CARTH_LIB_DIR=$(LIB_DIR); export CARTH_MOD_DIR=$(MOD_DIR); stack build)

.PHONY: foreign-core
foreign-core: lib-dir
	cd foreign-core; cargo build --release

.PHONY: install
install: install-bin install-lib install-mods

.PHONY: install-bin
install-bin: carth-bin bin-dir
	stack install --local-bin-path $(BIN_DIR)

.PHONY: install-lib
install-lib: foreign-core
	cp foreign-core/target/release/libcarth_foreign_core.a $(LIB_DIR)

.PHONY: install-mods
install-mods: mod-dir
	cp std/* $(MOD_DIR)/
	cp LICENSE $(MOD_DIR)/

.PHONY: bin-dir
bin-dir: carth-dir
	mkdir -p $(BIN_DIR)

.PHONY: lib-dir
lib-dir: carth-dir
	mkdir -p $(LIB_DIR)

.PHONY: mod-dir
mod-dir: carth-dir
	mkdir -p $(MOD_DIR)

.PHONY: carth-dir
carth-dir:
	mkdir -p $(CARTH_DIR)

.PHONY: clean-stack
clean-stack:
	stack clean