From 099be4ede6e6623182fca7979780537692d71cc3 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sun, 11 Jan 2026 16:02:27 -0500 Subject: [PATCH 1/7] refactor: rename Makefile target from it to build Renamed the 'it' target to 'build' for better clarity and conventional naming. Updated all target dependencies (run, profile, explain) to reference the new build target. --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index fa74ef9..de2c0fa 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,20 @@ BINARY_NAME=lambda.exe -.PHONY: it run profile explain graph docs +.PHONY: build run profile explain graph docs -it: +build: @ go build -o ${BINARY_NAME} ./cmd/lambda @ chmod +x ${BINARY_NAME} TEST=simple -run: it +run: build @ ./lambda.exe - < ./samples/$(TEST).txt > program.out -profile: it +profile: build @ ./lambda.exe -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out -explain: it +explain: build @ ./lambda.exe -x -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out graph: -- 2.49.1 From e31fb88077fcf97a20b34336b7db25d2e68b17bb Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sun, 11 Jan 2026 16:03:28 -0500 Subject: [PATCH 2/7] feat: add help target as default Makefile goal Added a help target that displays all available Makefile targets with descriptions. Set help as the default goal so running 'make' without arguments shows usage information. --- Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index de2c0fa..7317dd3 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,17 @@ BINARY_NAME=lambda.exe -.PHONY: build run profile explain graph docs +.PHONY: help build run profile explain graph docs + +.DEFAULT_GOAL := help + +help: + @ echo "Available targets:" + @ echo " build - Build the lambda executable" + @ echo " run - Build and run the lambda interpreter (use TEST= to specify sample)" + @ echo " profile - Build and run with CPU profiling enabled" + @ echo " explain - Build and run with explanation mode and profiling" + @ echo " graph - Generate and open CPU profile visualization" + @ echo " docs - Start local godoc server on port 6060" build: @ go build -o ${BINARY_NAME} ./cmd/lambda -- 2.49.1 From 0260a065cbdc9009a0cfefd914b364c72bd6f3bc Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sun, 11 Jan 2026 16:04:11 -0500 Subject: [PATCH 3/7] refactor: move TEST variable to top of Makefile Moved TEST variable declaration to the top with other configuration variables for better organization. --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7317dd3..6275bc8 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ BINARY_NAME=lambda.exe +TEST=simple .PHONY: help build run profile explain graph docs @@ -17,8 +18,6 @@ build: @ go build -o ${BINARY_NAME} ./cmd/lambda @ chmod +x ${BINARY_NAME} -TEST=simple - run: build @ ./lambda.exe - < ./samples/$(TEST).txt > program.out -- 2.49.1 From 24a74e625dbbe79ecee1813533b315bf5e3cf809 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sun, 11 Jan 2026 16:05:50 -0500 Subject: [PATCH 4/7] refactor: update binary name from lambda.exe to lambda Changed BINARY_NAME from lambda.exe to lambda and updated all execution references to use the ${BINARY_NAME} variable. Added lambda binary to .gitignore. --- .gitignore | 1 + Makefile | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 71b2ceb..0b209db 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore # # Binaries for programs and plugins +lambda *.exe *.exe~ *.dll diff --git a/Makefile b/Makefile index 6275bc8..92a61a1 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -BINARY_NAME=lambda.exe +BINARY_NAME=lambda TEST=simple .PHONY: help build run profile explain graph docs @@ -19,13 +19,13 @@ build: @ chmod +x ${BINARY_NAME} run: build - @ ./lambda.exe - < ./samples/$(TEST).txt > program.out + @ ./${BINARY_NAME} - < ./samples/$(TEST).txt > program.out profile: build - @ ./lambda.exe -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out + @ ./${BINARY_NAME} -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out explain: build - @ ./lambda.exe -x -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out + @ ./${BINARY_NAME} -x -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out graph: @ go tool pprof -raw -output=profile/cpu.raw profile/cpu.prof -- 2.49.1 From 0fe4636c377222890fa562cac6a4f665af1c530b Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sun, 11 Jan 2026 16:06:34 -0500 Subject: [PATCH 5/7] refactor: use .SILENT directive instead of @ prefixes Replaced all @ prefixes with the .SILENT directive for cleaner Makefile syntax. --- Makefile | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 92a61a1..35f4779 100644 --- a/Makefile +++ b/Makefile @@ -2,36 +2,36 @@ BINARY_NAME=lambda TEST=simple .PHONY: help build run profile explain graph docs - .DEFAULT_GOAL := help +.SILENT: help: - @ echo "Available targets:" - @ echo " build - Build the lambda executable" - @ echo " run - Build and run the lambda interpreter (use TEST= to specify sample)" - @ echo " profile - Build and run with CPU profiling enabled" - @ echo " explain - Build and run with explanation mode and profiling" - @ echo " graph - Generate and open CPU profile visualization" - @ echo " docs - Start local godoc server on port 6060" + echo "Available targets:" + echo " build - Build the lambda executable" + echo " run - Build and run the lambda interpreter (use TEST= to specify sample)" + echo " profile - Build and run with CPU profiling enabled" + echo " explain - Build and run with explanation mode and profiling" + echo " graph - Generate and open CPU profile visualization" + echo " docs - Start local godoc server on port 6060" build: - @ go build -o ${BINARY_NAME} ./cmd/lambda - @ chmod +x ${BINARY_NAME} + go build -o ${BINARY_NAME} ./cmd/lambda + chmod +x ${BINARY_NAME} run: build - @ ./${BINARY_NAME} - < ./samples/$(TEST).txt > program.out + ./${BINARY_NAME} - < ./samples/$(TEST).txt > program.out profile: build - @ ./${BINARY_NAME} -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out + ./${BINARY_NAME} -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out explain: build - @ ./${BINARY_NAME} -x -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out + ./${BINARY_NAME} -x -p profile/cpu.prof - < ./samples/$(TEST).txt > program.out graph: - @ go tool pprof -raw -output=profile/cpu.raw profile/cpu.prof - @ go tool pprof -svg profile/cpu.prof > profile/cpu.svg - @ open profile/cpu.svg + go tool pprof -raw -output=profile/cpu.raw profile/cpu.prof + go tool pprof -svg profile/cpu.prof > profile/cpu.svg + open profile/cpu.svg docs: - @ echo ">>> View at 'http://localhost:6060/pkg/git.maximhutz.com/max/lambda/'" - @ go run golang.org/x/tools/cmd/godoc@latest -http=:6060 + echo ">>> View at 'http://localhost:6060/pkg/git.maximhutz.com/max/lambda/'" + go run golang.org/x/tools/cmd/godoc@latest -http=:6060 -- 2.49.1 From a13c5602dc2d4d4b2d98cf0e180ec33b7a5607f5 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sun, 11 Jan 2026 16:07:39 -0500 Subject: [PATCH 6/7] feat: add clean target to remove build artifacts Added clean target that removes the binary, program.out, and profile directory. --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 35f4779..c7bf396 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ BINARY_NAME=lambda TEST=simple -.PHONY: help build run profile explain graph docs +.PHONY: help build run profile explain graph docs clean .DEFAULT_GOAL := help .SILENT: @@ -13,6 +13,7 @@ help: echo " explain - Build and run with explanation mode and profiling" echo " graph - Generate and open CPU profile visualization" echo " docs - Start local godoc server on port 6060" + echo " clean - Remove all build artifacts" build: go build -o ${BINARY_NAME} ./cmd/lambda @@ -35,3 +36,8 @@ graph: docs: echo ">>> View at 'http://localhost:6060/pkg/git.maximhutz.com/max/lambda/'" go run golang.org/x/tools/cmd/godoc@latest -http=:6060 + +clean: + rm -f ${BINARY_NAME} + rm -f program.out + rm -rf profile/ -- 2.49.1 From 2673092b32c6c092087b6c8ed25b89544f95028f Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Sun, 11 Jan 2026 16:10:47 -0500 Subject: [PATCH 7/7] refactor: make graph target cross-platform Replaced macOS-specific open command with file:// URL echo for cross-platform compatibility. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c7bf396..45742d2 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ explain: build graph: go tool pprof -raw -output=profile/cpu.raw profile/cpu.prof go tool pprof -svg profile/cpu.prof > profile/cpu.svg - open profile/cpu.svg + echo ">>> View at 'file://$(PWD)/profile/cpu.svg'" docs: echo ">>> View at 'http://localhost:6060/pkg/git.maximhutz.com/max/lambda/'" -- 2.49.1