Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: improve makefile to be os agnostic #52866

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 19 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,26 @@ CLOUDFLARE_ENDPOINT ?= https://07be8d2fbc940503ca1be344714cb0d1.r2.cloudflaresto
CLOUDFLARE_BUCKET ?= dist-staging
CLOUDFLARE_PROFILE ?= worker
LOGLEVEL ?= silent
OSTYPE := $(shell uname -s | tr '[:upper:]' '[:lower:]')
ifeq ($(findstring os/390,$OSTYPE),os/390)
OSTYPE ?= os390
ifeq ($(OS),Windows_NT)
OSTYPE := windows

ifeq ($(PROCESSOR_ARCHITEW6432),AMD64)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks wrong to me. You compare against AMD64 and if so, you set arm64, and so forth.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this was meant to be ARM64?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ifeq ($(PROCESSOR_ARCHITEW6432),AMD64)
ifeq ($(PROCESSOR_ARCHITEW6432),ARM64)

ARCHTYPE := arm64
else
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
ARCHTYPE := arm64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ARCHTYPE := arm64
ARCHTYPE := amd64

else ifeq ($(PROCESSOR_ARCHITECTURE),x86)
ARCHTYPE := x86
endif
endif
else
ARCHTYPE := $(shell uname -m | tr '[:upper:]' '[:lower:]')
OSTYPE := $(shell uname -s | tr '[:upper:]' '[:lower:]')

ifeq ($(findstring os/390,$OSTYPE),os/390)
OSTYPE ?= os390
endif
endif
ARCHTYPE := $(shell uname -m | tr '[:upper:]' '[:lower:]')
COVTESTS ?= test-cov
COV_SKIP_TESTS ?= core_line_numbers.js,testFinalizer.js,test_function/test.js
GTEST_FILTER ?= "*"
Expand Down