-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
108 lines (93 loc) · 3.13 KB
/
Copy pathMakefile
File metadata and controls
108 lines (93 loc) · 3.13 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
# PoMa - YANG Model Analysis Makefile
# Accelerated development workflow
.PHONY: help setup setup-fast setup-ci setup-full clean validate test docs
# Default target
help:
@echo "🎯 PoMa - YANG Model Analysis"
@echo ""
@echo "📦 Setup Commands:"
@echo " make setup - Full setup (env + fast submodules + bgp models)"
@echo " make setup-fast - Fast submodule setup only (shallow clone)"
@echo " make setup-ci - CI-optimized setup (fastest)"
@echo " make setup-full - Complete setup with full git history"
@echo ""
@echo "🧪 Development Commands:"
@echo " make validate - Validate all BGP models"
@echo " make test - Run YANG tools tests"
@echo " make docs - Build documentation"
@echo " make clean - Clean temporary files"
@echo ""
@echo "⚡ Quick start: make setup && make validate"
# Full setup workflow (recommended)
setup: setup-env setup-fast setup-bgp
@echo "✅ Complete PoMa setup finished!"
@echo "🧪 Run 'make validate' to test everything"
# Setup Python environment
setup-env:
@echo "🔧 Setting up Python environment..."
./scripts/setup-dev-env.sh
# Fast submodule setup (default)
setup-fast:
@echo "📦 Setting up submodules with shallow clone..."
./scripts/setup-submodules-fast.sh shallow
# CI-optimized setup (fastest)
setup-ci:
@echo "🏗️ Setting up submodules for CI..."
./scripts/setup-submodules-fast.sh ci
# Full submodule setup (complete git history)
setup-full:
@echo "📚 Setting up submodules with full history..."
./scripts/setup-submodules-fast.sh full
# Setup BGP model symlinks
setup-bgp:
@echo "🔗 Setting up BGP model symlinks..."
./scripts/setup-bgp-models.sh
# Validate all BGP models
validate:
@echo "🧪 Validating BGP models..."
./validate-bgp.sh
./validate-nokia-bgp.sh
./validate-openconfig-bgp.sh
# Test YANG tools
test:
@echo "🔬 Testing YANG tools..."
@if [ -f venv/bin/activate ]; then \
source venv/bin/activate && python scripts/test-yang-tools.py; \
else \
echo "❌ Virtual environment not found. Run 'make setup-env' first."; \
fi
# Build documentation
docs:
@echo "📖 Building documentation..."
@if [ -f venv/bin/activate ]; then \
source venv/bin/activate && mkdocs build; \
else \
echo "❌ Virtual environment not found. Run 'make setup-env' first."; \
fi
# Serve documentation locally
docs-serve:
@echo "🌐 Serving documentation locally..."
@if [ -f venv/bin/activate ]; then \
source venv/bin/activate && mkdocs serve; \
else \
echo "❌ Virtual environment not found. Run 'make setup-env' first."; \
fi
# Clean temporary files
clean:
@echo "🧹 Cleaning temporary files..."
rm -rf tmp/*.txt tmp/*.log
rm -rf site/
find . -name "*.pyc" -delete
find . -name "__pycache__" -delete
# Show submodule status and sizes
status:
@echo "📊 Submodule Status:"
@git submodule status
@echo ""
@echo "📈 Repository Sizes:"
@du -sh nokia/ open-config/ 2>/dev/null || echo "Some submodules not initialized"
# Quick benchmark of setup times
benchmark:
@echo "⏱️ Benchmarking setup methods..."
@echo "Testing shallow clone speed..."
@time ./scripts/setup-submodules-fast.sh ci > /dev/null 2>&1 || echo "Benchmark failed"