-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: Ifa31e557f6d0332d70aae40e2a48750955d64238 Signed-off-by: Ian Meyer (imeyer) <[email protected]>
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Detect OS | ||
UNAME_S := $(shell uname -s) | ||
ifeq ($(UNAME_S),Darwin) | ||
PLATFORM := darwin | ||
else ifeq ($(UNAME_S),Linux) | ||
PLATFORM := linux | ||
else | ||
$(error Unsupported platform: $(UNAME_S)) | ||
endif | ||
|
||
# Detect architecture | ||
UNAME_M := $(shell uname -m) | ||
ifeq ($(UNAME_M),arm64) | ||
ARCH := arm64 | ||
else ifeq ($(UNAME_M),x86_64) | ||
ARCH := amd64 | ||
else | ||
$(error Unsupported architecture: $(UNAME_M)) | ||
endif | ||
|
||
# Combine platform and architecture | ||
TARGET := tdiscuss-$(PLATFORM)-$(ARCH) | ||
|
||
# Bazel build command | ||
BAZEL := bazelisk | ||
BAZEL_ARGS := build --stamp --workspace_status_command="$${PWD}/status.sh" | ||
|
||
.PHONY: all clean | ||
|
||
all: build | ||
|
||
build: | ||
@echo "Building for $(PLATFORM)-$(ARCH)" | ||
$(BAZEL) $(BAZEL_ARGS) //:$(TARGET) | ||
|
||
clean: | ||
$(BAZEL) clean |