-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
60 lines (47 loc) · 2.79 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
SHELL= /bin/bash
PYTHON ?= python
.PHONY: all gen cy ss inplace clean cleangen cleanall test_import test_importss
all: clean cleangen gen inplace test_import test_importss
# For now, assume we are using a conda environment with graphblas and pycparser
scripts/GraphBLAS.h:
conda list -f graphblas | grep graphblas
conda list -f pycparser | grep pycparser
cp `python -c 'import pycparser, os ; print(os.path.join(os.path.dirname(pycparser.__file__), "..", "..", "..", "..", "include", "GraphBLAS.h"))'` scripts/GraphBLAS.h
scripts/GraphBLAS-processed.h: scripts/GraphBLAS.h
conda list -f pycparser | grep pycparser
gcc -nostdinc -E \
-I`python -c 'import pycparser, os ; print(os.path.join(os.path.dirname(pycparser.__file__), "utils", "fake_libc_include"))'` \
scripts/GraphBLAS.h | \
sed 's/ complex / _Complex /g' > scripts/GraphBLAS-processed.h
gen: scripts/GraphBLAS-processed.h
$(PYTHON) scripts/automate.py
cy:
$(PYTHON) setup.py build_ext --inplace
ss:
$(PYTHON) setup_ss.py build_ext --inplace
inplace: cy ss
clean:
rm -rf build/
find cygraphblas cygraphblas_ss -name __pycache__ -print
find cygraphblas cygraphblas_ss -name __pycache__ -print0 | xargs -0 rm -rf
find cygraphblas cygraphblas_ss -name '*.so' -print
find cygraphblas cygraphblas_ss -name '*.so' -print0 | xargs -0 rm -rf
find cygraphblas cygraphblas_ss -name '*.c' -print
find cygraphblas cygraphblas_ss -name '*.c' -print0 | xargs -0 rm -rf
cleangen:
-git grep -l '^# This file is automatically generated' cygraphblas/ cygraphblas_ss/
-git grep -l '^# This file is automatically generated' cygraphblas/ cygraphblas_ss/ | xargs rm
cleanall: clean cleangen
rm -f scripts/GraphBLAS.h scripts/GraphBLAS-processed.h
find cygraphblas cygraphblas_ss -name '*.html' -print
find cygraphblas cygraphblas_ss -name '*.html' -print0 | xargs -0 rm -rf
# Make sure all base modules are imported
test_import:
find cygraphblas -name '*.pyx' -print | sed -e 's/\/__init__//g' -e 's/.pyx/"/g' -e 's/^/python -c "import cygraphblas ; /g' -e 's/\//./g'
find cygraphblas -name '*.pyx' -print | sed -e 's/\/__init__//g' -e 's/.pyx/"/g' -e 's/^/python -c "import cygraphblas ; /g' -e 's/\//./g' | sh
find cygraphblas -name '*.py' -print | grep -v ss | sed -e 's/\/__init__//g' -e 's/.py/"/g' -e 's/^/python -c "import cygraphblas ; /g' -e 's/\//./g'
find cygraphblas -name '*.py' -print | grep -v ss | sed -e 's/\/__init__//g' -e 's/.py/"/g' -e 's/^/python -c "import cygraphblas ; /g' -e 's/\//./g' | sh
# If cygraphblas_ss is imported, make sure all `.ss` modules are as well
test_importss:
find cygraphblas -name 'ss.py' -print | sed -e 's/.py/"/g' -e 's/^/python -c "import cygraphblas_ss, cygraphblas ; /g' -e 's/\//./g'
find cygraphblas -name 'ss.py' -print | sed -e 's/.py/"/g' -e 's/^/python -c "import cygraphblas_ss, cygraphblas ; /g' -e 's/\//./g' | sh