summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoricecodder <git@icecodder.me>2023-01-14 17:58:00 +0100
committerGitHub <noreply@github.com>2023-01-14 17:58:00 +0100
commit25c434084038dfba446f483e4221682df4321ff0 (patch)
tree49cf0618e95858f9bc89f888b9c4dedb6cb462a4
parent82f760c3d03c352dd2d05983bef68e5456ddcad5 (diff)
ftw
-rw-r--r--Makefile18
1 files changed, 15 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 5427f19..8552afb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,19 @@
+ifeq ($(OS),Windows_NT)
+ detected_OS := Windows
+else
+ detected_OS := $(shell uname -s)
+endif
+
# Creates the bin folder for build artifacts
build/{bin,lib}:
@mkdir -p build/{lib,bin}
# Builds all rust targets
-ifeq ($(OS),Windows_NT)
build/lib/liball_in_one.a build/bin/{cache,gateway,ratelimit,rest,webhook}{,.exe}: build/{bin,lib}
@echo "Building rust project"
cargo build --release
@cp target/release/liball_in_one.a build/lib
@cp target/release/{cache,gateway,ratelimit,rest,webhook}{,.exe} build/bin
-endif
build/lib/liball_in_one.a build/bin/{cache,gateway,ratelimit,rest,webhook}: build/{bin,lib}
@echo "Building rust project"
@@ -24,7 +28,15 @@ internal/pkg/all-in-one/all-in-one.h: build/lib/liball_in_one.a
build/bin/nova: build/lib/liball_in_one.a internal/pkg/all-in-one/all-in-one.h
go build -a -ldflags '-s' -o build/bin/nova cmd/nova/nova.go
-all: build/bin/{cache,gateway,ratelimit,rest,webhook}{,.exe} build/bin/nova
+ifeq ($(detected_OS),Windows)
+ all: build/bin/{cache,gateway,ratelimit,rest,webhook}{,.exe} build/bin/nova
+endif
+ifeq ($(detected_OS),Linux)
+ all: build/bin/{cache,gateway,ratelimit,rest,webhook} build/bin/nova
+endif
+ifeq ($(detected_OS),Darwin)
+ all: build/bin/{cache,gateway,ratelimit,rest,webhook} build/bin/nova
+endif
docker-images:
docker-compose build