aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBobby <[email protected]>2024-11-16 14:49:31 -0500
committerBobby <[email protected]>2024-11-16 14:49:31 -0500
commitc7e9ca772b03c2edc3a1893e9c9ac2eeba90acfa (patch)
treedb69398c0109aa8b14a0dfc68212d7bad659c4a5 /Makefile
downloadyuzaki-c7e9ca772b03c2edc3a1893e9c9ac2eeba90acfa.tar.xz
yuzaki-c7e9ca772b03c2edc3a1893e9c9ac2eeba90acfa.zip
Initial Setup
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile38
1 files changed, 38 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f424ab7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,38 @@
+# Variables
+BINARY_NAME=yuzaki
+BINARY_BUILD_PATH=bin/$(BINARY_NAME)
+MAIN_PATH=yuzaki/main.go
+ENV_FILE=.env
+
+.PHONY: all build clean dev run setup
+
+setup:
+ @echo "Setting up environment..."
+ @if [ ! -f $(ENV_FILE) ]; then \
+ cp .env.example $(ENV_FILE); \
+ echo "Created .env file from example"; \
+ fi
+ go mod download
+
+build:
+ @echo "Building binary..."
+ go build -o $(BINARY_BUILD_PATH) $(MAIN_PATH)
+
+clean:
+ @echo "Cleaning up..."
+ rm -rf bin
+
+dev:
+ @echo "Running with air in development mode..."
+ air
+
+run:
+ @echo "Checking if binary exists..."
+ @if [ ! -f $(BINARY_BUILD_PATH) ]; then \
+ make build; \
+ fi
+ @echo "Running binary..."
+ $(BINARY_BUILD_PATH)
+
+all: clean setup build
+ @echo "Build complete!" \ No newline at end of file