diff options
| author | Bobby <[email protected]> | 2025-06-15 00:10:25 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2025-06-15 00:10:25 +0530 |
| commit | 60718f2895524f82db4fa1748daa4a078345a04a (patch) | |
| tree | 7f3d0715eec75708f2120db4464a4ec29592ee7b | |
| parent | 905bcaada8bb1b9db452c415230baead31cb1a20 (diff) | |
| download | imageboard-60718f2895524f82db4fa1748daa4a078345a04a.tar.xz imageboard-60718f2895524f82db4fa1748daa4a078345a04a.zip | |
added makefile for easier project execution
| -rw-r--r-- | Makefile | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8596a96 --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +BINARY_NAME=imageboard +BUILD_PATH=bin/$(BINARY_NAME) +MAIN_PATH=$(BINARY_NAME)/main.go + +.PHONY: setup clean build run dev all + +setup: + @echo "Setting up environment..." + @go mod download + @echo "Environment setup complete." + +clean: + @echo "Cleaning up..." + @rm -rf bin + @echo "Cleanup complete." + +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 + +all: setup clean build run + +.SILENT:
\ No newline at end of file |
