# this file will clean up ONE makefile dependency rule in a file. It must # be run on every rule as it is generated by the compiler. # older sed may convert newline character from 0x0d+0x0a to 0x0a # latest sed keeps \r (0x0d) characters of input file, so just '$' doesn't work # remove all 0x0d characters s/\r//g # change all back slashes sX\\X/Xg # replace slash at end of line with a backslash sX/$X\\Xg # eliminate quotes sX"XXg # change all runs of white space to a single tab s/[ ][ ]*/ /g # change drive path sX\([a-zA-Z]\+\):\/X\/cygdrive\/\1\/Xg # We supplement this below to remove the actual target source file itself, since sometimes # people change a .c file into a .cpp file (or vice versa), and this would break things. # The actual source file is already a dependency of the object, so no need to list it again. # only do on first three lines 1,3 s/[^ ]*[.]c // 1,3 s/[^ ]*[.]cp // 1,3 s/[^ ]*[.]cpp // 1,3 s/[^ ]*[.]s // # delete empty lines /^[ ]*$/d /^[ ]*\\$/d # lines containing a : followed by white space remove leading white space /^[ ].*:[ ]/s/^[ ][ ]*//