Skip to content

Commit 8d71722

Browse files
committed
feat: add minimal makefile
1 parent b538867 commit 8d71722

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

Makefile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.PHONY: run_python run_npm open_browser all
2+
3+
# Define terminal emulator (adjust based on your OS)
4+
TERMINAL := gnome-terminal --tab -- bash -c
5+
# If on MacOS, use:
6+
# TERMINAL := osascript -e 'tell application "Terminal" to do script'
7+
8+
VENV_PATH := ~/virtualenvs/nglancer
9+
NPM_PROJECT_PATH := ../neuroglancer
10+
URL := 'http://localhost:8080/\#!%7B%22dimensions%22:%7B%22x%22:%5B4e-8%2C%22m%22%5D%2C%22y%22:%5B4e-8%2C%22m%22%5D%2C%22z%22:%5B4e-8%2C%22m%22%5D%7D%2C%22position%22:%5B128.5%2C128.5%2C30.5%5D%2C%22crossSectionScale%22:1%2C%22projectionScale%22:256%2C%22layers%22:%5B%7B%22type%22:%22image%22%2C%22source%22:%22http://localhost:9000/allen/%7Cneuroglancer-precomputed:%22%2C%22tab%22:%22source%22%2C%22channelDimensions%22:%7B%22c%5E%22:%5B1%2C%22%22%5D%7D%2C%22name%22:%22allen%22%7D%5D%2C%22selectedLayer%22:%7B%22visible%22:true%2C%22layer%22:%22allen%22%7D%2C%22layout%22:%224panel%22%7D'
11+
12+
13+
all: run_python run_npm open_browser
14+
15+
run_python:
16+
$(TERMINAL) "source $(VENV_PATH)/bin/activate && python3 examples/serve_default_dir.py; exec bash"
17+
18+
run_npm:
19+
$(TERMINAL) "cd $(NPM_PROJECT_PATH) && npm run dev-server; exec bash"
20+
21+
open_browser:
22+
xdg-open $(URL) >/dev/null 2>&1 &

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pip install .
1616

1717
## Usage
1818

19-
See [examples](examples) folder.
19+
See [examples](examples) folder. There is also a makefile that can be used by running `make all` to generate example data, run the server, and open the browser. You need to modify the variables in the makefile to point to the correct paths.
2020

2121
## Note
2222

0 commit comments

Comments
 (0)