Like 'top', but with a capital 'T' and a graphical user interface. Top is an outerframe app built especially for Outer Loop.
It's built from two pieces:
Top: the macOS user interface inFrontend/.TopBackend: the HTTP server inBackend/main.c.
From this directory:
xcodebuild -project Top.xcodeproj -scheme Top -configuration Release build
xcodebuild -project Top.xcodeproj -scheme TopBackend -configuration Release buildPORT=7351
BUILD_ROOT="$PWD/build/macos"
RUN_ROOT="$PWD/build/run"
xcodebuild -project Top.xcodeproj -scheme Top -configuration Release SYMROOT="$BUILD_ROOT" build
xcodebuild -project Top.xcodeproj -scheme TopBackend -configuration Release SYMROOT="$BUILD_ROOT" build
rm -rf "$RUN_ROOT"
mkdir -p "$RUN_ROOT/bundles"
Scripts/archive_top_bundle.sh "$BUILD_ROOT/Release/Top.bundle" "$RUN_ROOT/bundles"
"$BUILD_ROOT/Release/TopBackend" --port "$PORT" --bundles-dir "$RUN_ROOT/bundles"
# or use sudo to see more processes and details
sudo "$BUILD_ROOT/Release/TopBackend" --port "$PORT" --bundles-dir "$RUN_ROOT/bundles"Open http://127.0.0.1:7351/ in Outer Loop or Outer Frame.
Top's frontend is a macOS outerframe bundle, so build the frontend archives on macOS first:
BUILD_ROOT="$PWD/build/frontend"
PACKAGE_ROOT="$PWD/build/linux-package"
xcodebuild -project Top.xcodeproj -scheme Top -configuration Release \
SYMROOT="$BUILD_ROOT" \
ARCHS="arm64 x86_64" \
ONLY_ACTIVE_ARCH=NO \
build
rm -rf "$PACKAGE_ROOT"
mkdir -p "$PACKAGE_ROOT/bundles"
Scripts/archive_top_bundle.sh "$BUILD_ROOT/Release/Top.bundle" "$PACKAGE_ROOT/bundles"Then build the backend on Linux from this directory:
cc -std=gnu17 -O2 -o TopBackend Backend/main.c -lmCopy TopBackend and the bundles directory from build/linux-package onto the Linux machine, then run:
PORT=7351
./TopBackend --port "$PORT" --bundles-dir ./bundles
# or use sudo to see more processes and details
sudo ./TopBackend --port "$PORT" --bundles-dir ./bundlesTopBackend binds TCP ports to loopback only. If you are running it on a remote Linux machine and you're using Outer Frame, connect with SSH port forwarding:
ssh -L 7351:127.0.0.1:7351 user@linux-hostThen open http://127.0.0.1:7351/ on your local machine. You can avoid all of this if you use Outer Loop to launch and connect to Top over SSH.
TopBackend serves the frontend from TopContent.bundle.macos-arm.aar and TopContent.bundle.macos-x86.aar. The --bundles-dir argument must point to the directory containing those .aar files, not to the built Top.bundle directory.