-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
145 lines (122 loc) · 4.78 KB
/
Makefile
File metadata and controls
145 lines (122 loc) · 4.78 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# SLAMTEC Aurora Python SDK Makefile
# Provides convenient commands for common development tasks
.PHONY: help docs docs-clean docs-html docs-markdown test clean build install dev-install
# Default target
help:
@echo "SLAMTEC Aurora Python SDK - Available commands:"
@echo ""
@echo "Documentation:"
@echo " make docs - Generate both HTML and Markdown documentation"
@echo " make docs-html - Generate HTML documentation only"
@echo " make docs-markdown - Generate Markdown documentation only"
@echo " make docs-clean - Clean and regenerate documentation"
@echo " make docs-check - Check if documentation needs updating"
@echo ""
@echo "Development:"
@echo " make dev-install - Install SDK in development mode"
@echo " make build - Build wheel packages for all platforms"
@echo " make build-current - Build wheel package for current platform"
@echo " make clean - Clean build artifacts"
@echo ""
@echo "Testing:"
@echo " make test - Run basic SDK tests"
@echo " make examples - List available examples"
@echo ""
# Documentation targets
docs:
@echo "Generating API documentation (HTML + Markdown)..."
python3 tools/update_docs.py --format both
docs-html:
@echo "Generating HTML documentation..."
python3 tools/update_docs.py --format html
docs-markdown:
@echo "Generating Markdown documentation..."
python3 tools/update_docs.py --format markdown
docs-clean:
@echo "Cleaning and regenerating documentation..."
python3 tools/update_docs.py --clean --format both
docs-check:
@echo "Checking if documentation needs updating..."
python3 tools/update_docs.py --check-only
# Build targets
build:
@echo "Building wheel packages for all platforms..."
python3 tools/build_package.py --all-platforms --clean
build-current:
@echo "Building wheel package for current platform..."
python3 tools/build_package.py --clean
build-test:
@echo "Building and testing wheel package..."
python3 tools/build_package.py --test --clean
# Development targets
dev-install:
@echo "Installing SDK in development mode..."
cd python_bindings && pip install -e .
install:
@echo "Installing SDK from built wheel..."
@if [ -d "wheels" ]; then \
latest_wheel=$$(ls -t wheels/*.whl | head -n1); \
echo "Installing $$latest_wheel"; \
pip install "$$latest_wheel"; \
else \
echo "No wheels found. Run 'make build' first."; \
exit 1; \
fi
# Clean targets
clean:
@echo "Cleaning build artifacts..."
rm -rf python_bindings/build
rm -rf python_bindings/dist
rm -rf python_bindings/*.egg-info
find python_bindings -name "*.pyc" -delete
find python_bindings -name "__pycache__" -type d -exec rm -rf {} +
@echo "Cleaned build artifacts"
clean-docs:
@echo "Cleaning documentation..."
rm -rf docs/*.html docs/*.md
@echo "Documentation cleaned"
clean-all: clean clean-docs
@echo "Cleaned all generated files"
# Testing targets
test:
@echo "Running basic SDK tests..."
@echo "Testing package imports..."
cd python_bindings && python3 -c "import slamtec_aurora_sdk; print('✓ SDK import successful')"
@echo "Testing SDK initialization..."
cd python_bindings && python3 -c "from slamtec_aurora_sdk import AuroraSDK; sdk = AuroraSDK(); print('✓ SDK initialization successful'); sdk.release()"
@echo "All tests passed!"
examples:
@echo "Available examples:"
@find examples -name "*.py" | sort | sed 's/^/ /'
@echo ""
@echo "Run examples with: python examples/<example_name>.py [device_ip]"
# Utility targets
version:
@python3 -c "import sys; sys.path.insert(0, 'python_bindings'); from slamtec_aurora_sdk import __version__; print('Aurora SDK Version:', __version__)"
check-deps:
@echo "Checking Python dependencies..."
@python3 -c "import numpy; print('✓ numpy')"
@python3 -c "import cv2; print('✓ opencv-python')" 2>/dev/null || echo "⚠ opencv-python (optional)"
@python3 -c "import open3d; print('✓ open3d')" 2>/dev/null || echo "⚠ open3d (optional)"
@echo "Dependency check complete"
# Git integration
docs-commit:
@echo "Committing documentation changes..."
git add docs/
git commit -m "Update API documentation" || echo "No documentation changes to commit"
# Combined targets
full-build: clean build docs
@echo "Full build completed (packages + documentation)"
release-prep: clean build docs test
@echo "Release preparation completed"
@echo "- Packages built: $$(ls wheels/*.whl | wc -l) wheels"
@echo "- Documentation: $$(ls docs/*.html docs/*.md | wc -l) files"
@echo "- Tests: passed"
# Development workflow
dev-setup:
@echo "Setting up development environment..."
pip install -r requirements-dev.txt
pip install -r python_bindings/requirements.txt
make dev-install
make docs
@echo "Development environment ready!"