-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
47 lines (27 loc) · 1.05 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
PYTHON ?= python
PINOCCHIO ?= $(PYTHON) -mpinocchio
EXAMPLE_SOURCES=$(filter-out %-test.c, $(wildcard examples/*.c))
EXAMPLE_OUTPUTS=$(subst examples/,build/,$(basename $(EXAMPLE_SOURCES)))
#######################################################################
all: $(addsuffix .o,$(EXAMPLE_OUTPUTS)) $(addsuffix .arith,$(EXAMPLE_OUTPUTS))
#######################################################################
build:
mkdir -p $@
build/%.o: examples/%.c build
$(CC) -c -o $@ $<
build/%.dot: build/%.arith
PYTHONPATH=. python -mpinocchio.drawcircuit --arith $< --out $@
build/%.arith: examples/%.c build
$(PINOCCHIO) --cpparg _I $(dir $<) --arith $@ $<
build/%.json: examples/%.c build
$(PINOCCHIO) --json $@ $<
#######################################################################
clean: python-clean
lint: python-pyflakes python-pylint
python-pyflakes:
$(PYTHON) -mpyflakes pinocchio
python-clean:
find . -name '*.pyc' -exec rm -f '{}' ';'
find . -name '__pycache__' -exec rm -rf '{}' ';'
python-pylint:
$(PYTHON) -mpylint pinocchio || true