diff options
| author | Bobby <[email protected]> | 2026-03-29 22:52:46 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2026-03-29 22:52:46 +0530 |
| commit | 9eb9b7f4bd552a641235764f66483e1f940fcfd9 (patch) | |
| tree | da520b923b5e6758d5457b6233dd6671fc640914 /nexus/Makefile | |
| parent | 65a143a0871c35989b7c7ea6723d39a0585c089e (diff) | |
| download | echoes-of-vaelun-main.tar.xz echoes-of-vaelun-main.zip | |
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 |
