Skip to content

Commit

Permalink
Add Makefile
Browse files Browse the repository at this point in the history
Change-Id: Ifa31e557f6d0332d70aae40e2a48750955d64238
Signed-off-by: Ian Meyer (imeyer) <[email protected]>
  • Loading branch information
imeyer committed Sep 15, 2024
1 parent 1f412d9 commit 05d1b31
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Makefile
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

0 comments on commit 05d1b31

Please sign in to comment.