-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (54 loc) · 1.7 KB
/
Makefile
File metadata and controls
61 lines (54 loc) · 1.7 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
.PHONY: help
# Default target - show help
help:
@echo "Available commands:"
@echo ""
@echo "Directory forwarding syntax:"
@echo " make <directory>/<target> [args]"
@echo ""
@echo "Examples:"
@echo " make python/test"
@echo " make python/example"
@echo " make python/install"
@echo " make python/build"
@echo " make python/typecheck"
@echo " make python/pdocs"
@echo " make python/test tests/test_specific.py"
# Directory forwarding rule - handles patterns like python/target
%/:
$(MAKE) -C $* $(filter-out $@,$(MAKECMDGOALS))
# Handle directory/target patterns
python/%:
$(MAKE) -C python $* $(filter-out $@,$(MAKECMDGOALS))
# Build docs with optional language selection
# Usage: make build-docs [js] [py]
# Examples:
# make build-docs # builds all docs
# make build-docs js # builds only JavaScript docs
# make build-docs py # builds only Python docs
# make build-docs js py # builds both
build-docs:
@# Check if specific languages were requested
@BUILD_JS=false; BUILD_PY=false; \
if [ "$(words $(MAKECMDGOALS))" -eq 1 ]; then \
BUILD_JS=true; BUILD_PY=true; \
else \
for arg in $(filter-out build-docs,$(MAKECMDGOALS)); do \
case $$arg in \
js) BUILD_JS=true ;; \
py) BUILD_PY=true ;; \
esac; \
done; \
fi; \
if [ "$$BUILD_JS" = "true" ]; then \
echo "Building JavaScript docs..."; \
pnpm -F scenario-docs install && pnpm -F scenario-docs run build; \
pnpm -F @langwatch/scenario install && pnpm -F @langwatch/scenario run generate:api-reference; \
fi; \
if [ "$$BUILD_PY" = "true" ]; then \
echo "Building Python docs..."; \
make python/pdocs; \
fi
# Catch-all rule to prevent "No rule to make target" errors for additional arguments
%:
@: