From 1954fd2d32aab89a4c1b59b9dc0483f493721f89 Mon Sep 17 00:00:00 2001 From: Matthias Fasching <5011972+fasmat@users.noreply.github.com> Date: Wed, 25 Sep 2024 15:08:39 +0000 Subject: [PATCH] Cleanup Makefiles (#6352) ## Motivation Follow up for #6351: variables used in the makefile should be defined where they are used if possible. Specifically I moved `EXE` and `ULIMIT` from `Makefile-libs.Inc` to `Makefile`. --- Makefile | 8 ++++++++ Makefile-libs.Inc | 2 -- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4317805262..6c2acbcb1e 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,14 @@ LDFLAGS = -ldflags "$(C_LDFLAGS)" include Makefile-libs.Inc +# Set the correct extension for the executable based on the OS +# and set the correct ulimit command for the OS +ifeq ($(OS),Windows_NT) + EXE := .exe +else + ULIMIT := ulimit -n 4096; +endif + UNIT_TESTS ?= $(shell go list ./... | grep -v systest/tests | grep -v genvm/cmd) export CGO_ENABLED := 1 diff --git a/Makefile-libs.Inc b/Makefile-libs.Inc index aa3c7139a8..b1fd2ecf45 100644 --- a/Makefile-libs.Inc +++ b/Makefile-libs.Inc @@ -27,7 +27,6 @@ ifeq ($(GOOS),windows) platform := windows export PATH := $(PATH):$(BIN_DIR) CGO_LDFLAGS := $(CGO_LDFLAGS) -Wl,-Bstatic -lpthread -Wl,-Bdynamic - EXE := .exe else TEMP := /tmp ifeq ($(GOOS),darwin) @@ -37,7 +36,6 @@ else platform := macos endif CGO_LDFLAGS := $(CGO_LDFLAGS) -Wl,-rpath,@loader_path - ULIMIT := ulimit -n 9999; else ifeq ($(GOARCH),arm64) platform := linux-arm64