Repos / gorts / 075d95a887
commit 075d95a8874f6742270a89a2031e2cf9331e1fc4
Author: Nhân <hi@imnhan.com>
Date:   Mon Jun 19 20:15:38 2023 +0700

    tweak makefile, add "watch" target

diff --git a/Makefile b/Makefile
index 9419560..f75ed60 100644
--- a/Makefile
+++ b/Makefile
@@ -1,22 +1,23 @@
-all: dist-linux dist-windows
-
-dist-linux:
-	CGO_ENABLED=0 GOOS=linux go build -o dist/linux/gorts
-	cp -r web dist/linux/web
-
-dist-windows:
+windows:
 	CGO_ENABLED=0 GOOS=windows \
 		go build -o dist/windows/gorts.exe -ldflags -H=windowsgui
 	cp -r web dist/windows/web
 
-dist/GORTS-Linux.zip: dist-linux
-	cd dist/linux; zip -r ../GORTS-Linux.zip .
+linux:
+	CGO_ENABLED=0 GOOS=linux go build -o dist/linux/gorts
+	cp -r web dist/linux/web
 
-dist/GORTS-Windows.zip: dist-windows
+dist/GORTS-Windows.zip: windows
 	cd dist/windows; \
 		curl -L 'https://tclkits.rkeene.org/fossil/raw/tclkit-8.6.3-win32-x86_64.exe?name=403c507437d0b10035c7839f22f5bb806ec1f491' > tclkit.exe; \
 		zip -r ../GORTS-Windows.zip .
 
+dist/GORTS-Linux.zip: linux
+	cd dist/linux; zip -r ../GORTS-Linux.zip .
+
+watch:
+	find . -name '*.go' -o -name '*.tcl' | entr -rc go run .
+
 gorts.png: gorts.svg
 	convert -background transparent -density 300 -resize 256x256 gorts.svg gorts.png