File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
source-code/cython/Primes Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 1
1
VERSION = $(shell python3-config --extension-suffix)
2
- PRIMES_LIBS = primes_cython.$(VERSION ) .so primes_cython3.$(VERSION ) .so \
3
- primes_pure_python.$(VERSION ) .so primes_pure_malloc.$(VERSION ) .so \
4
- primes_malloc.$(VERSION ) .so
2
+ SRC_FILES = primes_cython.pyx \
3
+ primes_malloc.pyx \
4
+ primes_pure_python.py \
5
+ primes_pure_malloc.py
6
+ PRIMES_LIBS = $(addsuffix $(VERSION ) , $(basename $(SRC_FILES ) ) )
7
+ C_FILES = $(addsuffix .c, $(basename $(SRC_FILES ) ) )
5
8
6
9
all : $(PRIMES_LIBS )
7
10
8
- $(PRIMES_LIBS ) : primes_cython.pyx primes_pure_python.py
11
+ % $(VERSION ) : % .pyx
12
+ python setup.py build_ext --inplace
13
+
14
+ % $(VERSION ) : % .py
9
15
python setup.py build_ext --inplace
10
16
11
17
clean :
12
18
python setup.py clean
13
- $(RM ) primes_cython.c primes_cython3.c primes_pure_python.c primes_malloc.c $(PRIMES_LIBS )
19
+ $(RM ) $(PRIMES_LIBS )
20
+ $(RM ) $(C_FILES )
14
21
$(RM ) -r build/
You can’t perform that action at this time.
0 commit comments