Skip to content

Commit

Permalink
Fix Makefile indentation (#1629)
Browse files Browse the repository at this point in the history
Tabs should only be used for recipes. For `ifeq` and similar you need to use spaces. This is documented here: https://www.gnu.org/software/make/manual/html_node/Conditional-Syntax.html

> Extra spaces are allowed and ignored at the beginning of the conditional directive line, but a tab is not allowed.

Older versions of Make do not enforce this, but it seems like newer versions do (I'm using one built from source some time after 4.4.1).
  • Loading branch information
Timmmm authored Sep 5, 2024
1 parent 8b9dc50 commit af96175
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,32 @@ DOCS := riscv-privileged riscv-unprivileged
DATE ?= $(shell date +%Y-%m-%d)
DOCKER_IMG := riscvintl/riscv-docs-base-container-image:latest
ifneq ($(SKIP_DOCKER),true)
DOCKER_IS_PODMAN = \
$(shell ! docker -v 2>&1 | grep podman >/dev/null ; echo $$?)
ifeq "$(DOCKER_IS_PODMAN)" "1"
DOCKER_VOL_SUFFIX = :z
endif

DOCKER_CMD = \
docker run --rm \
-v ${PWD}/$@.workdir:/build${DOCKER_VOL_SUFFIX} \
-w /build \
${DOCKER_IMG} \
/bin/sh -c
DOCKER_QUOTE := "
DOCKER_IS_PODMAN = \
$(shell ! docker -v 2>&1 | grep podman >/dev/null ; echo $$?)
ifeq "$(DOCKER_IS_PODMAN)" "1"
DOCKER_VOL_SUFFIX = :z
endif

DOCKER_CMD = \
docker run --rm \
-v ${PWD}/$@.workdir:/build${DOCKER_VOL_SUFFIX} \
-w /build \
${DOCKER_IMG} \
/bin/sh -c
DOCKER_QUOTE := "
else
DOCKER_CMD = \
cd $@.workdir &&
DOCKER_CMD = \
cd $@.workdir &&
endif

WORKDIR_SETUP = \
rm -rf $@.workdir && \
mkdir -p $@.workdir && \
cp -r src docs-resources $@.workdir
rm -rf $@.workdir && \
mkdir -p $@.workdir && \
cp -r src docs-resources $@.workdir

WORKDIR_TEARDOWN = \
mv $@.workdir/$@ $@ && \
rm -rf $@.workdir
mv $@.workdir/$@ $@ && \
rm -rf $@.workdir

SRC_DIR := src
BUILD_DIR := build
Expand Down

0 comments on commit af96175

Please sign in to comment.