~jojo/Carth

ref: 9449ab28c3742bcfbd7b371953481b9d42eef014 Carth/Makefile -rw-r--r-- 747 bytes
9449ab28JoJo Read env vars of lib path and module path at runtime 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
prefix=~/.carth
bin_dir=$(prefix)/bin
lib_dir=$(prefix)/lib
mod_dir=$(prefix)/mod

.PHONY: carth-bin
carth-bin: clean-stack
	stack build

.PHONY: foreign-core
foreign-core:
	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 lib-dir
	cp foreign-core/target/release/libcarth_foreign_core.a $(lib_dir)

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

.PHONY: bin-dir
bin-dir:
	mkdir -p $(bin_dir)

.PHONY: lib-dir
lib-dir:
	mkdir -p $(lib_dir)

.PHONY: mod-dir
mod-dir:
	mkdir -p $(mod_dir)

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