Skip to content

Commit

Permalink
Run make binaries-windows_amd64 clean on Windows (#3847)
Browse files Browse the repository at this point in the history
* Run make binaries-windows_amd64 clean on Windows

* nit: delete extra white line

Revert "nit: delete extra white line"

This reverts commit 80a5526727dd663f8c601ac292ff5318b3f5b6ce.

nit: delete extra white line
  • Loading branch information
pjanotti authored Oct 30, 2023
1 parent a484cf8 commit df5d407
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Makefile.Common
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# Explicitly define the shell we will use for commands.
SHELL?=/bin/bash

# Add support to use Makefile on Windows
SHELL_CASE_EXP = case "$$(uname -s)" in CYGWIN*|MINGW*|MSYS*) echo "true";; esac;
UNIX_SHELL_ON_WINDOWS := $(shell $(SHELL_CASE_EXP))

ifeq ($(UNIX_SHELL_ON_WINDOWS),true)
# The "sed" transformation below is needed on Windows, since commands like `go list -f '{{ .Dir }}'`
# return Windows paths and such paths are incompatible with other *nix tools, like `find`,
# used by the Makefile shell.
# The backslash needs to be doubled so its passed correctly to the shell.
NORMALIZE_DIRS = sed -e 's/^/\\//' -e 's/://' -e 's/\\\\/\\//g' | sort
NUM_CORES := ${NUMBER_OF_PROCESSORS}
else
NORMALIZE_DIRS = sort
NUM_CORES := $(shell getconf _NPROCESSORS_ONLN)
endif

# SRC_ROOT is the top of the source tree.
SRC_ROOT := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))

Expand All @@ -19,9 +35,8 @@ LINT=golangci-lint
IMPI=impi
# BUILD_TYPE should be one of (dev, release).
BUILD_TYPE?=release
NUM_CORES := $(shell getconf _NPROCESSORS_ONLN)

ALL_PKG_DIRS := $(shell $(GOCMD) list -f '{{ .Dir }}' ./... | sort)
ALL_PKG_DIRS := $(shell $(GOCMD) list -f '{{ .Dir }}' ./... | $(NORMALIZE_DIRS))

ALL_SRC := $(shell find $(ALL_PKG_DIRS) -name '*.go' \
-not -path '*/third_party/*' \
Expand Down

0 comments on commit df5d407

Please sign in to comment.