1
- .PHONY : install deps compile test livebook
1
+ # EngineSystem Makefile
2
2
3
- # Default target
4
- all : deps compile
3
+ .PHONY : help docs livebook test compile clean deps check
5
4
6
- # Compile the project
5
+ # Default target
6
+ help :
7
+ @echo " EngineSystem Development Commands:"
8
+ @echo " "
9
+ @echo " 📚 Documentation & Tutorials:"
10
+ @echo " docs - Generate ExDoc documentation"
11
+ @echo " livebook - Start Livebook with the interactive tutorial"
12
+ @echo " "
13
+ @echo " 🔧 Development:"
14
+ @echo " compile - Compile the project"
15
+ @echo " test - Run tests"
16
+ @echo " check - Run quality checks (credo, dialyzer)"
17
+ @echo " deps - Get dependencies"
18
+ @echo " clean - Clean build artifacts"
19
+ @echo " "
20
+ @echo " 🚀 Quick Start:"
21
+ @echo " make livebook # Start the interactive tutorial"
22
+ @echo " make docs # Generate documentation"
23
+
24
+ # Documentation generation
25
+ docs :
26
+ @echo " 📚 Generating ExDoc documentation..."
27
+ mix docs
28
+ @echo " ✅ Documentation generated at doc/index.html"
29
+ @echo " You can also view it online after publishing to hex.pm"
30
+
31
+ # Start Livebook with the tutorial
32
+ livebook :
33
+ @echo " 🚀 Starting Livebook with EngineSystem tutorial..."
34
+ @echo " The tutorial will open at: http://localhost:8080"
35
+ @echo " 📓 Interactive examples and guided learning ahead!"
36
+ @echo " "
37
+ livebook server README.livemd --open
38
+
39
+ # Alternative livebook command for systems without livebook installed
40
+ livebook-docker :
41
+ @echo " 🐳 Starting Livebook via Docker..."
42
+ docker run -p 8080:8080 -v $(PWD ) :/data livebook/livebook
43
+
44
+ # Development tasks
7
45
compile :
46
+ @echo " 🔨 Compiling EngineSystem..."
8
47
mix compile
9
48
10
- # Run tests
11
49
test :
50
+ @echo " 🧪 Running tests..."
12
51
mix test
13
52
14
- # Format code
15
- format :
16
- @echo " Formatting code..."
17
- @mix format
53
+ deps :
54
+ @echo " 📦 Getting dependencies..."
55
+ mix deps.get
56
+
57
+ clean :
58
+ @echo " 🧹 Cleaning build artifacts..."
59
+ mix clean
60
+ rm -rf doc/
61
+ rm -rf _build/
62
+
63
+ # Quality checks
64
+ check : credo dialyzer
65
+ @echo " ✅ All quality checks completed"
66
+
67
+ credo :
68
+ @echo " 🔍 Running Credo..."
69
+ mix credo
18
70
19
- # Run dialyzer
20
71
dialyzer :
21
- @echo " Running dialyzer..."
22
- @mix dialyzer
23
-
24
- # Check if code is properly formatted
25
- check.format :
26
- @echo " Checking code format..."
27
- @mix format --check-formatted
28
-
29
- # Run linting
30
- lint : deps
31
- @echo " Running linter..."
32
- @mix credo --strict
33
-
34
- # Run all checks
35
- check : check.format
36
- @echo " Running compilation check..."
37
- @mix compile --warnings-as-errors
38
- @mix test
39
- @mix dialyzer
40
- @mix credo --strict
41
- @mix format --check-formatted
42
-
43
- # Generate documentation
44
- docs :
45
- @echo " Generating documentation..."
46
- @mix docs
72
+ @echo " 🔬 Running Dialyzer..."
73
+ mix dialyzer
74
+
75
+ # Setup for new developers
76
+ setup : deps compile test docs
77
+ @echo " "
78
+ @echo " 🎉 EngineSystem development environment setup complete!"
79
+ @echo " "
80
+ @echo " Next steps:"
81
+ @echo " 📓 Start learning: make livebook"
82
+ @echo " 📚 View docs: open doc/index.html"
83
+ @echo " 🧪 Run tests: make test"
84
+
85
+ # Publishing (for maintainers)
86
+ publish-docs : docs
87
+ @echo " 📤 Publishing documentation to hex.pm..."
88
+ @echo " Note: This happens automatically when publishing the package"
89
+
90
+ # Development server (if you want to serve docs locally)
91
+ serve-docs : docs
92
+ @echo " 🌐 Serving documentation locally..."
93
+ @echo " Available at: http://localhost:8000"
94
+ cd doc && python -m http.server 8000
95
+
96
+ # Install development dependencies
97
+ dev-deps :
98
+ @echo " 🛠️ Installing development dependencies..."
99
+ mix deps.get
100
+ @echo " Consider installing:"
101
+ @echo " - Livebook: https://livebook.dev/"
102
+ @echo " - ExDoc: included in deps"
47
103
48
- # Install dependencies
49
- deps :
50
- @echo " Installing dependencies..."
51
- @mix deps.get
52
-
53
- # Update dependencies
54
- deps.update :
55
- @echo " Updating dependencies..."
56
- @mix deps.update --all
57
-
58
- # Check for outdated dependencies
59
- outdated :
60
- @echo " Checking for outdated dependencies..."
61
- @mix hex.outdated --all
62
-
63
- # Ensure notebooks directory exists
64
- ensure-notebooks-dir :
65
- @mkdir -p notebooks
66
-
67
- # Install Livebook if not already installed
68
- install-livebook :
69
- @if ! ls ~ /.mix/escripts/livebook > /dev/null 2>&1 ; then \
70
- echo " Installing Livebook..." ; \
71
- mix escript.install hex livebook --force; \
72
- else \
73
- echo " Livebook is already installed." ; \
74
- fi
75
-
76
- # Start Livebook with the engine examples notebook
77
- livebook : install-livebook ensure-notebooks-dir
78
- @echo " Starting Livebook..."
79
- @~/.mix/escripts/livebook server
80
-
81
- # Start Livebook in detached mode (background)
82
- livebook-detached : install-livebook ensure-notebooks-dir
83
- @echo " Starting Livebook in the background..."
84
- @~/.mix/escripts/livebook server --no-auto-shutdown &
85
-
86
- # Start Livebook with notebooks directory as home
87
- livebook-home : install-livebook ensure-notebooks-dir
88
- @echo " Starting Livebook with notebooks directory as home..."
89
- @~/.mix/escripts/livebook server --home notebooks
90
- # Help target
91
- help :
92
- @echo " Available targets:"
93
- @echo " deps - Install dependencies"
94
- @echo " deps.update - Update dependencies"
95
- @echo " compile - Compile the project"
96
- @echo " test - Run tests"
97
- @echo " check - Run all checks (format, compile)"
98
- @echo " check.format - Check code formatting"
99
- @echo " docs - Generate documentation"
100
- @echo " install-livebook - Install Livebook if not already installed"
101
- @echo " livebook - Start Livebook"
102
- @echo " livebook-detached - Start Livebook in detached mode"
103
- @echo " livebook-home - Start Livebook with notebooks directory as home"
104
- @echo " help - Show this help"
104
+ # Format code
105
+ format :
106
+ @echo " 💅 Formatting code..."
107
+ mix format
108
+
109
+ # Run all checks before committing
110
+ pre-commit : format compile test credo
111
+ @echo " ✅ Pre-commit checks completed successfully!"
112
+ @echo " Ready to commit! 🚀"
0 commit comments