-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (23 loc) · 672 Bytes
/
Makefile
File metadata and controls
31 lines (23 loc) · 672 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
PYTHON?=python
ARCH:=$(shell uname -m)
SYS:=$(shell uname -s | tr '[:upper:]' '[:lower:]')
PY_VER:=$(shell $(PYTHON) -c 'import sys; print("%d.%d"%(sys.version_info.major, sys.version_info.minor));')
SOABI:=$(shell $(PYTHON) -c 'import sysconfig; print(sysconfig.get_config_var("SOABI") or "")')
ifeq (,$(SOABI))
EXTENSION:=cec.so
else
EXTENSION:=cec.$(SOABI).so
endif
BUILD_DIR:=build/lib.$(SYS)-$(ARCH)-$(PY_VER)
all: $(EXTENSION)
$(EXTENSION): $(BUILD_DIR)/$(EXTENSION)
cp $< $@
$(BUILD_DIR)/$(EXTENSION): cec.cpp setup.py device.h device.cpp
$(PYTHON) setup.py build
test: all
./test.py
.PHONY: test
clean:
rm -rf build
rm -f $(EXTENSION)
.PHONY: clean