-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
44 lines (36 loc) · 781 Bytes
/
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
# Makefile styleguide at http://clarkgrubb.com/makefile-style-guide
MAKEFLAGS += --warn-undefined-variables
SHELL := bash
.SHELLFLAGS := -eu -o pipefail -c
.DEFAULT_GOAL := test
.DELETE_ON_ERROR:
.SUFFIXES:
UNAME?=$(shell uname)
PWD=$(shell pwd)
ifeq ($(UNAME), Linux)
DYLIB_EXT=so
TARGET_DIR=target
STRIP=strip
endif
ifeq ($(UNAME), Darwin)
DYLIB_EXT=dylib
TARGET_DIR=target-$(UNAME)
STRIP=strip -x
endif
CARGO:=CARGO_TARGET_DIR=$(TARGET_DIR) cargo
LIB:=$(TARGET_DIR)/release/libmidas.$(DYLIB_EXT)
.PHONY: test
test: out.csv test.out.csv
diff -q $^
.PHONY: clean
clean:
$(CARGO) clean
rm -f midas.so test.out.csv
test.out.csv: test.py in.csv midas.so
python3 test.py
midas.so: $(LIB)
cp $< $@
$(STRIP) $@
.PHONY: $(LIB)
$(LIB):
$(CARGO) build --release