Skip to content

Commit

Permalink
fixing cross platform support
Browse files Browse the repository at this point in the history
  • Loading branch information
nbingham1 committed Dec 4, 2024
1 parent 37dac1d commit 5b03b05
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 12 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ linux: lib
rm -rf debian lm-linux

windows: lib
mkdir -p lm-windows/bin
mkdir -p lm-windows/share
cp bin/ckt/lm.exe lm-windows/bin/lm.exe
cp -r tech lm-windows/share/tech
ldd lm-windows/bin/lm.exe | grep "mingw64" | sed 's/.*\/mingw64/\/mingw64/g' | sed 's/ (.*$$//g' | xargs -I{} cp {} lm-windows/bin
zip -r lm-windows.zip lm-windows
rm -rf lm-windows
mkdir -p Loom/bin
mkdir -p Loom/share
cp bin/ckt/lm.exe Loom/bin/lm.exe
cp -r tech Loom/share/tech
ldd Loom/bin/lm.exe | grep "mingw64" | sed 's/.*\/mingw64/\/mingw64/g' | sed 's/ (.*$$//g' | xargs -I{} cp {} Loom/bin
zip -r lm-windows.zip Loom
rm -rf Loom

macos: lib
mkdir -p lm-macos/bin
Expand Down
2 changes: 1 addition & 1 deletion bin/ckt
Submodule ckt updated 1 files
+10 −4 src/main.cpp
39 changes: 37 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,42 @@ elif [ "$OS" = "Darwin" ]; then
echo "Installation complete!"
echo "You can now use the 'lm' command."
else
curl -L https://github.com/broccolimicro/loom/releases/download/$TAG/lm-windows.zip -o lm-windows.zip
unzip lm-windows.zip
# Define target directories
BIN_DIR="C:\\Program Files (x86)"
TEMP_DIR="$(mktemp -d)"
TARBALL_URL="https://github.com/broccolimicro/loom/releases/download/$TAG/lm-windows.zip"

echo "Downloading installation files..."
if curl -L "$TARBALL_URL" -o "$TEMP_DIR/lm-windows.zip"; then
echo "Download successful."
else
echo "Failed to download tarball. Please check the URL or your internet connection."
exit 1
fi

echo "Extracting files..."
if unzip "$TEMP_DIR/lm-windows.zip" -d "$TEMP_DIR"; then
echo "Extraction complete."
else
echo "Failed to extract files. Exiting."
exit 1
fi

# Install binary
echo "Installing Loom to $BIN_DIR..."
if cp -r $TEMP_DIR/Loom "$BIN_DIR/"; then
chmod +x "$BIN_DIR/Loom/bin/lm"
chmod -R ug+rw "$BIN_DIR/Loom/share/tech"
echo "Loom installed successfully."
else
echo "Failed to install Loom. Please check permissions and try again."
exit 1
fi

rm -rf "$TEMP_DIR"

# Post-install message
echo "Installation complete!"
echo "You can now use the 'lm' command."
fi

2 changes: 1 addition & 1 deletion lib/common
Submodule common updated 2 files
+12 −0 common/text.cpp
+1 −0 common/text.h
2 changes: 1 addition & 1 deletion lib/phy
Submodule phy updated 1 files
+27 −4 phy/Script.cpp

0 comments on commit 5b03b05

Please sign in to comment.