summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBobby <[email protected]>2026-01-15 15:53:17 +0530
committerBobby <[email protected]>2026-01-15 15:53:17 +0530
commitc8d0bbb5b54f5cec3ebb245f9a21d8a94b3bd944 (patch)
tree6a5c2500da90253ad07a0d5192071bb77f093d36 /Makefile
downloadcafe-c8d0bbb5b54f5cec3ebb245f9a21d8a94b3bd944.tar.xz
cafe-c8d0bbb5b54f5cec3ebb245f9a21d8a94b3bd944.zip
Add initial project structure with Go Fiber framework and environment configuration
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile44
1 files changed, 44 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..9a00c39
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,44 @@
+BINARY_NAME=cafe
+BUILD_PATH=bin/$(BINARY_NAME)
+MAIN_PATH=$(BINARY_NAME)/main.go
+
+.PHONY: setup clean tidy build run dev test all
+
+setup:
+ @echo "Setting up environment..."
+ @go mod download
+ @go mod tidy
+ @echo "Environment setup complete."
+
+clean:
+ @echo "Cleaning up..."
+ @rm -rf bin
+ @rm -rf tmp
+ @echo "Cleanup complete."
+
+tidy:
+ @echo "Tidying modules..."
+ @go mod tidy
+ @echo "Modules tidied."
+
+build:
+ @echo "Building..."
+ @go build -o $(BUILD_PATH) $(MAIN_PATH) || true
+ @echo "Build complete."
+
+run:
+ @if [ ! -f $(BUILD_PATH) ]; then echo "Binary not found. Building binary..."; $(MAKE) -s build; fi
+ @echo "Running..."
+ @$(BUILD_PATH) || true
+
+dev:
+ @echo "Running in development mode..."
+ @go run $(MAIN_PATH) || true
+
+test:
+ @echo "Running tests..."
+ @go test -v ./... || true
+
+all: setup clean build run
+
+.SILENT: \ No newline at end of file