MAKE_RECURSIVE_DIRS := openapi examples frontend proxy
SECRET_DIR_AGE := secret secret.age
define MAKE_RECURSIVE
if [ -n "$${MAKE_RECURSIVE_PARALLEL}" ]; then
trap 'kill 0' EXIT INT TERM
time printf '%s\n' $(MAKE_RECURSIVE_DIRS) | xargs -P0 -IX sh -c '$(MAKE) -C X $@ || exit 255'
wait
else
time printf '%s\n' $(MAKE_RECURSIVE_DIRS) | xargs -IX sh -c '$(MAKE) -C X $@ || exit 255'
fi
endef
export
generate:
bash -c "$${MAKE_RECURSIVE}"
run:
MAKE_RECURSIVE_PARALLEL=1 bash -c "$${MAKE_RECURSIVE}"
deploy:
bash -c "$${MAKE_RECURSIVE}"
test:
cargo test
doc:
cargo doc --open
rage:
tmp=$$(mktemp) && tar czvf $${tmp} -C $(firstword $(SECRET_DIR_AGE)) . && rage -p -o $(lastword $(SECRET_DIR_AGE)) $${tmp}
unrage:
type rage || cargo install rage
ls $(firstword $(SECRET_DIR_AGE)) || ( mkdir -p $(firstword $(SECRET_DIR_AGE)) ; rage -d -o - $(lastword $(SECRET_DIR_AGE)) | tar xzv -C $(firstword $(SECRET_DIR_AGE)) )