Skip to content

Commit cf74f5f

Browse files
authored
Fix build errors on BSD (in BSDMakefile) (go-gitea#27594)
1. `make build` fails because `||` and `&&` have the same precedence in sh/bash, so the `false` command always evaluated (leading to an error). ``` + which gmake /usr/local/bin/gmake + false *** Failed target: .BEGIN *** Failed command: which "gmake" || printf "Error: GNU Make is required!\n\n" 1>&2 && false *** Error code 1 ``` 2. When `GPREFIX` is set to an empty string with quotation marks, `gmake` mistakenly thinks that it's a file name: ``` gmake: *** empty string invalid as file name. Stop. ```
1 parent 532f166 commit cf74f5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

BSDmakefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ GARGS = "--no-print-directory"
4242

4343
# The GNU convention is to use the lowercased `prefix` variable/macro to
4444
# specify the installation directory. Humor them.
45-
GPREFIX = ""
45+
GPREFIX =
4646
.if defined(PREFIX) && ! defined(prefix)
4747
GPREFIX = 'prefix = "$(PREFIX)"'
4848
.endif
4949

5050
.BEGIN: .SILENT
51-
which $(GMAKE) || printf "Error: GNU Make is required!\n\n" 1>&2 && false
51+
which $(GMAKE) || (printf "Error: GNU Make is required!\n\n" 1>&2 && false)
5252

5353
.PHONY: FRC
5454
$(.TARGETS): FRC

0 commit comments

Comments
 (0)