PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/get-log-index.sed

https://code.google.com/p/latex-makefile/
sed | 19 lines | 10 code | 2 blank | 7 comment | 0 complexity | a0497dd38fe86526d7595206fbdcefc0 MD5 | raw file
 1#(##defaults(target_files="TARGET_FILES", stem="STEM")##)
 2
 3# Look for missing index or glossary files.
 4s/^No file \(.*\.ind\)\.$/TARGETS=\1/
 5s/^No file \(.*\.[gn]ls\)\.$/TARGETS=\1/
 6# Escape spaces in file names
 7s/[[:space:]]/\\&/g
 8
 9# If we have a target, rewrite it to be a make dependency rule
10/^TARGETS=/{
11  # Save it, rewrite to a make dependency
12  h
13  s!^TARGETS=!(##target_files##): !p
14  # Get the old one back, add yet another make dependency
15  g
16  s!^TARGETS=\(.*\)!\1: (##stem##).tex!p
17}
18# Anything else is trash
19d