-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (42 loc) · 1.22 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
PACKAGE=fpfind
DIR=src/${PACKAGE}
LIB=${DIR}/lib
# For 'read' and 'readx' rules, parse command line arguments
# from $(MAKECMDGOALS) and turn them into do-nothing targets.
# https://stackoverflow.com/questions/2214575/passing-arguments-to-make-run
ifneq (,$(findstring read,$(firstword $(MAKECMDGOALS))))
READ_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(READ_ARGS):;@:)
endif
.SILENT: shell
.PHONY: clean,read,readx
all:
gcc -o ${DIR}/freqcd ${DIR}/freqcd.c ${LIB}/getopt.c -lm
shell:
-poetry shell
fpfind-shell:
-poetry run python -ic "import fpfind"
# Package-related stuff
test:
poetry run pytest
test64:
poetry run pytest --float64
clean:
find . -type d -name ".pytest_cache" | xargs rm -rf
find . -type d -name "__pycache__" | xargs rm -rf
rm -f ${DIR}/freqcd
compile-schematic:
java -jar docs/plantuml* docs/schematic.wsg
# Python package management
install: install-poetry
poetry install
install-poetry:
pip install -U poetry
uninstall:
poetry run pip uninstall ${PACKAGE}
# Read timestamp as hex / binary (little-endian 32-bit words)
read:
@-xxd -e -g 4 -c 8 $(READ_ARGS) | cut -b11-27 |\
xxd -r -p - | xxd -b -g 4 -c 8 | cut -b1-75
readx:
@-xxd -e -g 4 -c 8 $(READ_ARGS) | cut -b1-27