forked from f4pga/prjxray
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (34 loc) · 1.31 KB
/
Makefile
File metadata and controls
41 lines (34 loc) · 1.31 KB
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
CLANG_FORMAT ?= clang-format-5.0
PYTHON_FORMAT ?= yapf
TCL_FORMAT ?= utils//tcl-reformat.sh
.PHONY: database format clean env
IN_ENV = if [ -e env/bin/activate ]; then . env/bin/activate; fi;
env:
virtualenv --python=python3 --system-site-packages env
$(IN_ENV) pip install -r requirements.txt
ln -sf $(PWD)/prjxray env/lib/python3.*/site-packages/
$(IN_ENV) python -c "import yaml" || (echo "Unable to find python-yaml" && exit 1)
build:
git submodule update --init --recursive
mkdir -p build
cd build; cmake ..; $(MAKE)
database: build
$(MAKE) -C $@
FORMAT_EXCLUDE = third_party .git env build
FIND_EXCLUDE = $(foreach x,$(FORMAT_EXCLUDE),-and -not -path './$(x)/*')
format:
find . -name \*.cc $(FIND_EXCLUDE) -print0 | xargs -0 -P $$(nproc) ${CLANG_FORMAT} -style=file -i
find . -name \*.h $(FIND_EXCLUDE) -print0 | xargs -0 -P $$(nproc) ${CLANG_FORMAT} -style=file -i
$(IN_ENV) find . -name \*.py $(FIND_EXCLUDE) -print0 | xargs -0 -P $$(nproc) yapf -p -i
find . -name \*.tcl $(FIND_EXCLUDE) -print0 | xargs -0 -P $$(nproc) -n 1 $(TCL_FORMAT)
checkdb:
@for DB in database/*; do if [ -d $$DB ]; then \
echo ; \
echo "Checking $$DB"; \
echo "============================"; \
$(IN_ENV) python3 utils/checkdb.py --db-root $$DB; \
fi; done
clean:
$(MAKE) -C database clean
$(MAKE) -C fuzzers clean
rm -rf build