-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (31 loc) · 967 Bytes
/
Makefile
File metadata and controls
39 lines (31 loc) · 967 Bytes
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
export ROOT := $(shell pwd)
ifeq ($(shell uname),Darwin)
export LIBRARY_VARIABLE = DYLD_LIBRARY_PATH
export LIBRARY_SUFFIX = dylib
else
export LIBRARY_VARIABLE = LD_LIBRARY_PATH
export LIBRARY_SUFFIX = so
endif
export CARGO ?= $(shell which cargo)
ifeq (${CARGO},)
$(error Failed to find Cargo)
endif
export RUST_ROOT ?= $(subst /bin/rustc,,$(shell which rustc))
ifeq (${RUST_ROOT},)
$(error Failed to find Rust)
endif
export ENVIRONMENT := ${LIBRARY_VARIABLE}="${LIBRARY_VARIABLE}:${RUST_ROOT}/lib"
export CARGO := ${ENVIRONMENT} ${CARGO}
all: install
@hash tput && tput setaf 2
@echo 'Well done! Set your environment variables as follows:'
@hash tput && tput sgr0
@echo 'export PATH="${ROOT}/bin:$${PATH}"'
@echo 'export ${LIBRARY_VARIABLE}="${ROOT}/lib:$$${LIBRARY_VARIABLE}"'
clean install:
@${MAKE} -C src $@
update:
@git submodule init
@git submodule foreach git checkout master
@git submodule foreach git pull
.PHONY: all clean install update