1+ # Based on https://github.com/cdzombak/nativefier-app-template
2+
13SHELL: =/usr/bin/env bash
24
3- VERSION =1.1.0
5+ VERSION =1.1.1
46URL ="https://lofi.cafe/"
57define BUILD_FLAGS
68-n "Lofi Cafe" \
@@ -17,37 +19,42 @@ define BUILD_FLAGS
1719-i icon.icns
1820endef
1921
22+ # Also define name below; you may want its name on the filesystem to differ:
23+ APPFILENAME ="Lofi Cafe"
24+
2025default : help
2126# via https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
2227.PHONY : help
2328help :
2429 @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
2530
2631.PHONY : check-deps
27- check-deps : # # Verify build dependencies are installed
32+ check-deps : # # Verify build-time dependencies are installed
2833 @command -v npm > /dev/null 2>&1 || echo " [!] Missing npm"
2934 @npm install
3035
36+ .PHONY : update-deps
37+ update-deps : check-deps # # Update the application's dependencies (eg. nativefier)
38+ npm update
39+
3140.PHONY : clean
3241clean : # # Clean build output directory
3342 rm -rf ./out
3443
3544.PHONY : build
36- build : clean check-deps # # Build app for the current platform
45+ build : clean check-deps update-deps # # Build app for the current platform
3746 mkdir -p ./out
3847 npm exec nativefier -- ${URL} ${BUILD_FLAGS} ./out
3948
49+ .PHONY : install-mac
50+ install-mac : build # # Build & install to /Applications (on macOS, Intel or Apple Silicon)
51+ cp -R " ./out/${APPFILENAME} -darwin-x64/${APPFILENAME} .app" /Applications || cp -R " ./out/${APPFILENAME} -darwin-arm64/${APPFILENAME} .app" /Applications
52+ rm -rf ./out
53+
4054.PHONY : build-all
41- build-all : clean check-deps # # Build app for many supported platforms
55+ build-all : clean check-deps # # Build app for supported platforms
4256 mkdir -p ./out
4357 npm exec nativefier -- ${URL} ${BUILD_FLAGS} -p mac -a x64 ./out
44- pushd " ./out/Lofi Cafe -darwin-x64" && zip -r ../lofi-cafe-${VERSION} -macos-x64.zip " ./Lofi Cafe .app" && popd
58+ pushd " ./out/${APPFILENAME} -darwin-x64" && zip -r " ../lofi-cafe-${VERSION} -macos-x64.zip" " ./${APPFILENAME} .app" && popd
4559 npm exec nativefier -- ${URL} ${BUILD_FLAGS} -p mac -a arm64 ./out
46- pushd " ./out/Lofi Cafe-darwin-arm64" && zip -r ../lofi-cafe-${VERSION} -macos-arm.zip " ./Lofi Cafe.app" && popd
47- # npm exec nativefier -- ${URL} ${BUILD_FLAGS} -p windows -a x64 ./out/windows-x64
48- # npm exec nativefier -- ${URL} ${BUILD_FLAGS} -p windows -a arm64 ./out/windows-arm
49-
50- .PHONY : install-mac
51- install-mac : build # # Build & install to /Applications (for macOS, x64 or arm)
52- cp -R " ./out/Lofi Cafe-darwin-x64/Lofi Cafe.app" /Applications || cp -R " ./out/Lofi Cafe-darwin-arm64/Lofi Cafe.app" /Applications
53- rm -rf ./out
60+ pushd " ./out/${APPFILENAME} -darwin-arm64" && zip -r " ../lofi-cafe-${VERSION} -macos-arm.zip" " ./${APPFILENAME} .app" && popd
0 commit comments