Makefile: Add 'install' and 'uninstall' targets
I install to /usr/local by default, but this can be overridden by setting PREFIX when running `make` Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
This commit is contained in:
parent
8311cbe478
commit
b8460bfa60
17
Makefile
17
Makefile
|
@ -1,5 +1,9 @@
|
|||
# Copyright 2023 (c) Anna Schumaker.
|
||||
|
||||
export PREFIX = /usr/local
|
||||
export XFSTESTSDB_BIN = ${PREFIX}/bin
|
||||
export XFSTESTSDB_LIB = ${PREFIX}/lib/xfstestsdb
|
||||
|
||||
clean:
|
||||
find . -type d -name __pycache__ -exec rm -r {} \+
|
||||
|
||||
|
@ -7,9 +11,22 @@ clean:
|
|||
flake8:
|
||||
flake8
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
find ./xfstestsdb -type f -not -path "*/__pycache__/*" \
|
||||
-exec install -v -C -D -m 755 "{}" "$(XFSTESTSDB_LIB)/{}" \;
|
||||
install -C -v -m 644 xfstestsdb.py $(XFSTESTSDB_LIB)/xfstestsdb.py
|
||||
echo -e "#!/bin/bash\npython -O $(XFSTESTSDB_LIB)/xfstestsdb.py \$$*" > $(XFSTESTSDB_BIN)/xfstestsdb
|
||||
chmod 655 $(XFSTESTSDB_BIN)/xfstestsdb
|
||||
|
||||
.PHONY: pytest
|
||||
pytest:
|
||||
pytest
|
||||
|
||||
.PHONY: tests
|
||||
tests: pytest flake8
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
rm -v $(XFSTESTSDB_BIN)/xfstestsdb
|
||||
rm -rv $(XFSTESTSDB_LIB)
|
||||
|
|
Loading…
Reference in New Issue