Skip to content

Commit 14dc06c

Browse files
committed
fix makefile
1 parent 8cb1158 commit 14dc06c

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

CONTRIBUTING.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ platform) which actually implements the database functionality. The library shou
2929
#### Initial setup
3030
If you're just getting started, run the following simple steps to set up the repository on your machine
3131
* clone this repository
32-
* `python3 -m pip install --user virtualenv` install [virtualenv](https://pypi.org/project/virtualenv/) if you don't have it yet
3332
* `make depend` to initialize `virtualenv` and get dependencies (objectbox-c shared library)
3433
* `make` to build and test
3534

Makefile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ endif
1212
export PATH := $(abspath ${VENVBIN}):${PATH}
1313

1414

15-
.PHONY: init test build benchmark publish ${VENV}-init
15+
.PHONY: init test build benchmark publish venv-init
1616

1717
# Default target executed when no arguments are given to make.
1818
default_target: build test
@@ -25,30 +25,36 @@ help: ## Show this help
2525
all: depend build test ## Get dependencies, clean, build and test
2626

2727
build: ${VENV} clean ## Clean and build
28-
${PYTHON} setup.py bdist_wheel
28+
set -e ; \
29+
${PYTHON} setup.py bdist_wheel ; \
2930
ls -lh dist
3031

3132
${VENV}: ${VENVBIN}/activate
3233

33-
${VENV}-init:
34-
if [ ! -d "${VENV}" ] ; then ${PYTHON} -m virtualenv ${VENV} ; fi
34+
venv-init:
35+
${PIP} install --user virtualenv
36+
${PYTHON} -m virtualenv ${VENV}
3537

3638
# remove packages not in the requirements.txt
3739
# install and upgrade based on the requirements.txt
3840
# let make know this is the last time requirements changed
39-
${VENVBIN}/activate: ${VENV}-init requirements.txt
41+
${VENVBIN}/activate: requirements.txt
4042
set -e ; \
43+
if [ ! -d "${VENV}" ] ; then make venv-init ; fi ; \
4144
${PIP} freeze | grep -v -f requirements.txt - | grep -v '^#' | grep -v '^-e ' | xargs ${PIP} uninstall -y || echo "never mind" ; \
4245
${PIP} install --upgrade -r requirements.txt ; \
4346
touch ${VENVBIN}/activate
4447

4548
depend: ${VENV} ## Prepare dependencies
49+
set -e ; \
4650
${PYTHON} download-c-lib.py
4751

4852
test: ${VENV} ## Test all targets
53+
set -e ; \
4954
${PYTHON} -m pytest --capture=no --verbose
5055

5156
benchmark: ${VENV} ## Run CRUD benchmarks
57+
set -e ; \
5258
${PYTHON} -m benchmark
5359

5460
clean: ## Clean build artifacts
@@ -57,4 +63,5 @@ clean: ## Clean build artifacts
5763
rm -rf *.egg-info
5864

5965
publish: ## Publish the package built by `make build`
66+
set -e ; \
6067
${PYTHON} -m twine upload --verbose dist/objectbox*.whl

0 commit comments

Comments
 (0)