-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
62 lines (41 loc) · 1.26 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
PYTHON = bin/python
PREPROCESS = ./preprocess
MOD_NAMES = _core cipher ecc hash mac pkcs1 pkcs5 prng rsa utils
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.%)
VERSION := $(shell python setup.py --version)
REMOTE_DOCS_HOST = mikeboers.com
REMOTE_DOCS_PATH = /srv/mikeboers.com/docs/pytomcrypt
.PHONY : default build test readme clean clean-all docs
default : build
# Evaluating Mako templates.
build/src/tomcrypt.%: src/%
@ mkdir -p build/src
PYTHONPATH=. ./scripts/preprocess $< > $@
# Translating Cython to C.
tomcrypt/%.c: build/src/tomcrypt.%.pyx
cython -o [email protected] $<
mv [email protected] $@
# 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
PYTHONPATH=tests nose2
readme: README.html
README.html: README.md
markdown $< > $@
clean:
- rm tomcrypt/*.so
- rm tomcrypt/*.pyc
- rm -rf dist
- rm -rf build/src build/*/tomcrypt build/*/vendor
clean-all: clean
- rm -rf build
docs: build
PYTHONPATH=.. make -C docs html
deploy-docs: docs
./scripts/sphinx-to-github docs