Skip to content

Commit 231ac39

Browse files
ankohuuraiden00pl
authored andcommitted
canutils/lely-canopen: avoid patch reapply on repeated builds.
The patch step currently uses a phony target, so it is executed again when the build is repeated in the same source tree. In that case `patch -N` detects previously applied patches and returns 1, which make treats as a failure. Replace the phony patch target with a stamped `.patched` file so the patch step is not re-run unnecessarily. Fixes #3188 Signed-off-by: Shunchao Hu <ankohuu@gmail.com>
1 parent 5c867b2 commit 231ac39

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

canutils/lely-canopen/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ $(LELYCANOPEN_SRCNAME): $(LELYCANOPEN_TARBALL)
179179
@echo "Unpacking: $(LELYCANOPEN_TARBALL) -> $(LELYCANOPEN_UNPACKNAME)"
180180
$(Q) $(UNPACK) $(LELYCANOPEN_TARBALL)
181181

182-
patch_src: $(LELYCANOPEN_SRCNAME)
182+
$(LELYCANOPEN_SRCNAME)/.patched : $(LELYCANOPEN_SRCNAME)
183183
# Get the name of the directory created by the tar command
184184
$(eval LELYCANOPEN_UNPACKNAME := $(shell ls -d lely-core-master*))
185185
$(Q) mv $(LELYCANOPEN_UNPACKNAME) $(LELYCANOPEN_SRCNAME)
@@ -188,9 +188,10 @@ patch_src: $(LELYCANOPEN_SRCNAME)
188188
$(Q) cat 0003-src-co-nmt.c-fix-compilation.patch | patch -s -N -d $(LELYCANOPEN_SRCNAME) -p1
189189
$(Q) cat 0004-tools-coctl.c-add-missing-mutex-init.patch | patch -s -N -d $(LELYCANOPEN_SRCNAME) -p1
190190
$(Q) cat 0005-add-NuttX-support.patch | patch -s -N -d $(LELYCANOPEN_SRCNAME) -p1
191+
$(Q) touch $@
191192
$(Q) echo "Patching $(LELYCANOPEN_SRCNAME)"
192193

193-
context:: patch_src
194+
context:: $(LELYCANOPEN_SRCNAME)/.patched
194195
else
195196
context:: $(LELYCANOPEN_SRCNAME)
196197
endif

0 commit comments

Comments
 (0)