22
33.DEFAULT_GOAL := help
44
5+ BIN_DIR ?= dist
6+ DOCS_DIR ?= docs
7+
58# Extract arguments for build, build_docs, run
69ifeq ($(firstword $(MAKECMDGOALS ) ) ,build)
7- BIN_DIR := $(word 2,$(MAKECMDGOALS ) )
8- ifeq ($(BIN_DIR),)
9- BIN_DIR := dist
10- else
10+ ifneq ($(word 2,$(MAKECMDGOALS)),)
11+ BIN_DIR := $(word 2,$(MAKECMDGOALS ) )
1112 $(eval $(BIN_DIR ) :;@:)
1213 endif
1314endif
1415
1516ifeq ($(firstword $(MAKECMDGOALS ) ) ,build_docs)
16- DOCS_DIR := $(word 2,$(MAKECMDGOALS ) )
17- ifeq ($(DOCS_DIR),)
18- DOCS_DIR := docs
19- else
17+ ifneq ($(word 2,$(MAKECMDGOALS)),)
18+ DOCS_DIR := $(word 2,$(MAKECMDGOALS ) )
2019 $(eval $(DOCS_DIR ) :;@:)
2120 endif
2221endif
@@ -40,7 +39,7 @@ install_deps:
4039build_docs :
4140 @echo " Building docs in $( DOCS_DIR) "
4241 @mkdir -p $(DOCS_DIR )
43- .venv/bin/python3 -m pdoc src/openapi_client -o $( DOCS_DIR ) || pdoc src/openapi_client -o $(DOCS_DIR )
42+ pdoc src/openapi_client -o $(DOCS_DIR )
4443
4544build :
4645 @echo " Building binary/package in $( BIN_DIR) "
@@ -50,13 +49,12 @@ build:
5049build_wasm :
5150 @echo " Building WASM to bin/"
5251 @mkdir -p bin
53- if [ -d .venv ]; then .venv/bin/python3 -m py2wasm src/openapi_client/cli.py -o bin/cdd-python-all.wasm; else py2wasm src/openapi_client/cli.py -o bin/cdd-python-all.wasm; fi
54-
52+ py2wasm src/openapi_client/cli.py -o bin/cdd-python-all.wasm
5553test :
56- .venv/bin/python3 -m pytest tests/ || pytest tests/
54+ pytest tests/
5755
5856run : build
59- .venv/bin/ python3 -m openapi_client.cli $(RUN_ARGS ) || cdd-python $(RUN_ARGS )
57+ python3 -m openapi_client.cli $(RUN_ARGS ) || cdd-python $(RUN_ARGS )
6058
6159help :
6260 @echo " Available tasks:"
0 commit comments