Skip to content

Commit 4c86e46

Browse files
committed
8256810: Incremental rebuild broken on Macosx
Reviewed-by: mikael, ihse
1 parent 02ba519 commit 4c86e46

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

make/common/NativeCompilation.gmk

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,15 @@ ifeq ($(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT)-$(FILE_MACRO_CFLAGS), false-)
237237
) \
238238
)
239239

240-
# When compiling with relative paths, the deps file comes out with relative
241-
# paths.
240+
# When compiling with relative paths, the deps file may come out with relative
241+
# paths, and that path may start with './'. First remove any leading ./, then
242+
# add WORKSPACE_ROOT to any line not starting with /, while allowing for
243+
# leading spaces.
242244
define fix-deps-file
243-
$(SED) -e 's|^\([ ]*\)|\1$(WORKSPACE_ROOT)|' $1.tmp > $1
245+
$(SED) \
246+
-e 's|^\([ ]*\)\./|\1|' \
247+
-e '/^[ ]*[^/ ]/s|^\([ ]*\)|\1$(WORKSPACE_ROOT)/|' \
248+
$1.tmp > $1
244249
endef
245250
else
246251
# By default the MakeCommandRelative macro does nothing.

0 commit comments

Comments
 (0)