forked from mikeboers/PyTomCrypt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (31 loc) · 918 Bytes
/
Makefile
File metadata and controls
44 lines (31 loc) · 918 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
40
41
42
43
PYTHON = bin/python
PREPROCESS = ./preprocess
MOD_NAMES = _core cipher ecc hash mac pkcs1 pkcs5 prng rsa
SO_NAMES = $(MOD_NAMES:%=tomcrypt/%.so)
C_NAMES = $(MOD_NAMES:%=tomcrypt/%.c)
MAKO_SRCS := $(wildcard src/*.pyx) $(wildcard src/*.pxd)
CYTHON_SRCS = $(MAKO_SRCS:src/%=build/src/tomcrypt.%)
default : build
# Evaluating Mako templates.
build/src/tomcrypt.%: src/%
@ mkdir -p build/src
$(PYTHON) ./preprocess $< > $@
# Translating Cython to C.
tomcrypt/%.c: build/src/tomcrypt.%.pyx
cython -o $@.tmp $<
mv $@.tmp $@
# Requirements for the core.
build/src/tomcrypt._core.c: $(filter %-core.pxd,$(CYTHON_SRCS))
sources: $(CYTHON_SRCS) $(C_NAMES)
build: $(CYTHON_SRCS) $(C_NAMES)
python setup.py build_ext --inplace
test: build
python -m unittest discover -v
readme: README.html
README.html: README.md
markdown $< > $@
clean:
- rm tomcrypt/*.so
- rm tomcrypt/*.pyc
- rm -rf dist
- rm -rf build