diff options
Diffstat (limited to 'nexus/Makefile')
| -rw-r--r-- | nexus/Makefile | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/nexus/Makefile b/nexus/Makefile new file mode 100644 index 0000000..db75a79 --- /dev/null +++ b/nexus/Makefile @@ -0,0 +1,47 @@ +BINARY_NAME = nexus
+MAIN_PATH = ./$(BINARY_NAME)
+
+ifeq ($(OS),Windows_NT)
+ BUILD_PATH = bin/$(BINARY_NAME).exe
+ AIR_CONFIG = .air.windows.toml
+else
+ BUILD_PATH = bin/$(BINARY_NAME)
+ AIR_CONFIG = .air.toml
+endif
+
+.PHONY: setup clean tidy build run dev all
+
+setup:
+ @echo "Setting up environment..."
+ @go mod download
+ @go mod tidy
+ @which air > /dev/null 2>&1 || go install github.com/air-verse/air@latest
+ @echo "Environment setup complete."
+
+clean:
+ @echo "Cleaning up..."
+ @rm -rf bin
+ @echo "Cleanup complete."
+
+tidy:
+ @echo "Tidying modules..."
+ @go mod tidy
+ @echo "Modules tidied."
+
+build:
+ @echo "Building..."
+ @go build -o $(BUILD_PATH) $(MAIN_PATH)
+ @echo "Build complete."
+
+run:
+ @if [ ! -f $(BUILD_PATH) ]; then echo "Binary not found. Building..."; $(MAKE) -s build; fi
+ @echo "Running..."
+ @$(BUILD_PATH)
+
+dev:
+ @echo "Running in development mode..."
+ @air -c $(AIR_CONFIG)
+
+all: setup clean build run
+
+.SILENT:
\ No newline at end of file |
