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

Detect version of sed in Makefile #12319

Merged
merged 5 commits into from
Jul 27, 2020
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ IMPORT := code.gitea.io/gitea
export GO111MODULE=on

GO ?= go
SED_INPLACE := sed -i
SHASUM ?= shasum -a 256
HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
COMMA := ,
Expand All @@ -42,18 +41,16 @@ ifeq ($(HAS_GO), GO)
CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
endif


ifeq ($(OS), Windows_NT)
EXECUTABLE ?= gitea.exe
else
EXECUTABLE ?= gitea
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SED_INPLACE := sed -i ''
endif
ifeq ($(UNAME_S),FreeBSD)
SED_INPLACE := sed -i ''
endif
endif

ifeq ($(shell sed --version | grep -q GNU && echo gnu),gnu)
silverwind marked this conversation as resolved.
Show resolved Hide resolved
SED_INPLACE := sed -i
else
SED_INPLACE := sed -i ''
endif

GOFMT ?= gofmt -s
Expand Down