Skip to content

Commit

Permalink
make: Fix detection of intermediate targets where make has changed it…
Browse files Browse the repository at this point in the history
…s database whitespace
  • Loading branch information
code5hot authored and scop committed May 18, 2015
1 parent 1950590 commit 4b209b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions completions/make
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ function _make_target_extract_script()
fi

cat <<EOF
1,/^# Files/ d; # skip until files section
/^# Not a target/,/^$/ d; # skip not target blocks
1,/^# * Files/ d; # skip until files section
/^# * Not a target/,/^$/ d; # skip not target blocks
/^${prefix_pat}/,/^$/! d; # skip anything user dont want
# The stuff above here describes lines that are not
# explicit targets or not targets other than special ones
# The stuff below here decides whether an explicit target
# should be output.
/^# File is an intermediate prerequisite/ {
/^# * File is an intermediate prerequisite/ {
s/^.*$//;x; # unhold target
d; # delete line
}
Expand Down
6 changes: 4 additions & 2 deletions test/fixtures/make/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ NAME := sample
.PHONY: all
all: $(NAME)

$(NAME): sample.c
cc -o $@ $^
$(NAME): sample.o

.INTERMEDIATE: sample.o
sample.o: sample.c

.PHONY: install
install: all
Expand Down

0 comments on commit 4b209b0

Please sign in to comment.