Advertisement
bryceman

update_file_list.sed

Mar 16th, 2012
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. # Collapse all /foo/../ sequences in paths
  2. s/(\/[^./]+){1}(\/\.\.){1}//g
  3. # Collapse all /foo/bar/../../ sequences in paths
  4. s/(\/[^./]+){2}(\/\.\.){2}//g
  5. # Collapse all /foo/../ sequences in paths again
  6. s/(\/[^./]+){1}(\/\.\.){1}//g
  7. # Collect line following line like 'foo.o <ignore>: \'
  8. /^\S+.o(\s+[^:]+)*:\s+\\$/N
  9. # Extract object source file from line like 'foo.o <ignore>: \nfoo.c'
  10. s/^\S+.o(\s+[^:]+)*:\s+\\\n\s*(\S+).*/\2/p
  11. # Extract object source file from line like 'foo.o <ignore>: foo.c'
  12. s/^\S+.o(\s+[^:]+)*:\s+(\S+).*/\2/p
  13. # Extract dependency file from line like 'foo.h:'
  14. s/^\s*([^/]\S+):\s*$/\1/p
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement