-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (56 loc) · 1.63 KB
/
Copy pathMakefile
File metadata and controls
62 lines (56 loc) · 1.63 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
.PHONY: install build serve clean help venv
# Default target
help:
@echo "SEC-bench Leaderboard - Build Commands"
@echo ""
@echo "Available commands:"
@echo " make venv - Create virtual environment"
@echo " make install - Install dependencies in venv"
@echo " make build - Build static site"
@echo " make serve - Build and serve site locally"
@echo " make clean - Remove build artifacts"
@echo ""
@echo "If data/results.json is missing, set SEC_BENCH_TRAJECTORIES_DIR=/path/to/trajectories before make build."
@echo ""
# Create virtual environment
venv:
@echo "Creating virtual environment..."
python3 -m venv .venv
@echo "Virtual environment created. Run: source .venv/bin/activate"
# Install dependencies
install:
@echo "Installing dependencies..."
@if [ -f .venv/bin/pip ]; then \
.venv/bin/pip install -r requirements.txt; \
else \
pip install -r requirements.txt; \
fi
# Build static site
build:
@echo "Building site..."
@set -e; \
if [ -f .venv/bin/python ]; then \
PY=.venv/bin/python; \
else \
PY=python3; \
fi; \
$$PY make_results.py; \
$$PY build.py
# Build and serve locally
serve: build
@echo ""
@PORT=8888; \
while ! python3 -c "import socket, sys; s = socket.socket(); s.bind(('127.0.0.1', int(sys.argv[1]))); s.close()" $$PORT >/dev/null 2>&1; do \
PORT=$$((PORT + 1)); \
done; \
echo "Starting local server at http://localhost:$$PORT"; \
echo "Press Ctrl+C to stop"; \
echo ""; \
cd dist && python3 -m http.server $$PORT --bind 127.0.0.1
# Clean build artifacts
clean:
@echo "Cleaning build artifacts..."
rm -rf dist/
rm -rf *.pyc __pycache__
rm -rf .venv/
@echo "Done!"