diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..932d913 --- /dev/null +++ b/Makefile @@ -0,0 +1,92 @@ +name = 'Dodge Bolt' +version = 0.1.0 +love_version = 11.4 +itchio = rokaspuz/dodge-bolt + +LOVE_WIN32_DIR = build/love-$(love_version)-win32 +LOVE_WIN64_DIR = build/love-$(love_version)-win64 + +all: win32 win64 linux + +love: clean_love + mkdir -p build + cd src && zip -9 -r ../build/$(name).love . + +win32: clean_windows download-love-win32 love + mkdir -p build/win32/$(name) + cp -r $(LOVE_WIN32_DIR)/*.dll build/win32/$(name) + cp -r $(LOVE_WIN32_DIR)/license.txt build/win32/$(name) + cat $(LOVE_WIN32_DIR)/love.exe build/$(name).love > build/win32/$(name)/$(name).exe + +win64: clean_windows download-love-win64 love + mkdir -p build/win64/$(name) + cp -r $(LOVE_WIN64_DIR)/*.dll build/win64/$(name) + cp -r $(LOVE_WIN64_DIR)/license.txt build/win64/$(name) + cat $(LOVE_WIN64_DIR)/love.exe build/$(name).love > build/win64/$(name)/$(name).exe + +linux: clean_linux download-appimage love + mkdir -p build/linux + cd build/linux && ../love.AppImage --appimage-extract + cat build/linux/squashfs-root/bin/love build/$(name).love > build/linux/squashfs-root/bin/game + chmod +x build/linux/squashfs-root/bin/game + cp -f love.desktop build/linux/squashfs-root/love.desktop + appimagetool build/linux/squashfs-root build/linux/$(name) + rm -rf build/linux/squashfs-root + +deploy: deploy-win32 deploy-win64 deploy-linux + +deploy-win32: download-butler win32 + cd build/win32 && zip -9 -r $(name).zip . + ./build/butler push build/win32/$(name).zip $(itchio):win32 --userversion $(version) + +deploy-win64: download-butler win64 + cd build/win64 && zip -9 -r $(name).zip . + ./build/butler push build/win64/$(name).zip $(itchio):win64 --userversion $(version) + +deploy-linux: download-butler linux + cd build/linux && zip -9 -r $(name).zip . + ./build/butler push build/linux/$(name).zip $(itchio):linux --userversion $(version) + +clean: + rm -rf build + +clean_windows: + rm -rf build/windows + +clean_linux: + rm -rf build/linux + +clean_love: + rm -f build/$(name).love + +download-love-win32: +ifeq (,$(wildcard ./build/love-${love_version}-win32/)) + mkdir -p build + wget -O build/love-win32.zip https://github.com/love2d/love/releases/download/${love_version}/love-${love_version}-win32.zip + unzip build/love-win32.zip -d build + rm build/love-win32.zip +endif + +download-love-win64: +ifeq (,$(wildcard ./build/love-${love_version}-win64/)) + mkdir -p build + wget -O build/love-win64.zip https://github.com/love2d/love/releases/download/${love_version}/love-${love_version}-win64.zip + unzip build/love-win64.zip -d build + rm build/love-win64.zip +endif + +download-appimage: +ifeq (,$(wildcard ./build/love.AppImage)) + mkdir -p build + wget -O build/love.AppImage https://github.com/love2d/love/releases/download/${love_version}/love-${love_version}-x86_64.AppImage + chmod +x build/love.AppImage +endif + +download-butler: +ifeq (,$(wildcard ./build/butler)) + mkdir -p build + wget -O build/butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default + unzip build/butler.zip -d build + chmod +x build/butler + rm build/butler.zip +endif diff --git a/build.sh b/build.sh deleted file mode 100755 index 1b2da94..0000000 --- a/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -BUILD_NAME="love2d-project" -ZIP_OPTIONS="-x '*.xcf' -x '*.kra'" - -# Remove existing contents -rm -r build -mkdir build - -# Build project -echo Building project... -cd src -zip -q $ZIP_OPTIONS -r ../build/$BUILD_NAME.love * -cd - > /dev/null - -# Jobs done -echo Done. diff --git a/love.desktop b/love.desktop new file mode 100644 index 0000000..5e3516e --- /dev/null +++ b/love.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Dodge Bolt +Comment=A fast paced multiplayer top-down shooter +MimeType=application/x-love-game; +Exec=game %f +Type=Application +Categories=Development;Game; +Terminal=false +Icon=love +NoDisplay=true