Makefile: make the .d rule portable
The \+ syntax is not POSIX and supported only by GNU sed. This changes both the grep and sed commands to use extended regex. Note: sed -E option is not POSIX either, but widely supported.
This commit is contained in:
parent
a30cd09e8e
commit
6938d8c061
5
Makefile
5
Makefile
@ -146,8 +146,9 @@ graph.svg: Makefile
|
||||
# dependencies (ie. the dependency graph is a DAG);
|
||||
$(OBJDIR)/%.d: $(SRCDIR)/%.f90 | $(OBJDIR)
|
||||
@printf '$(@:d=o): $< \\\n' > '$@'
|
||||
@grep -v 'use iso_' '$<' | \
|
||||
sed -n 's@^[^!].*use \([^,]\+\),.*@$(OBJDIR)/\1.o \\@p' | \
|
||||
@grep -vE '^[[:blank:]]*use.*(intrinsic|iso_)' '$<' | \
|
||||
sed -nE 's@^[[:blank:]]*use[[:blank:]]+'\
|
||||
'([^,[:blank:]&]+).*@$(OBJDIR)/\1.o \\@p' | \
|
||||
sort -u >> '$@'
|
||||
|
||||
# Load the generated rules
|
||||
|
Loading…
Reference in New Issue
Block a user