File: fix-makefile

package info (click to toggle)
liblivemedia 2006.03.17-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,928 kB
  • ctags: 4,588
  • sloc: cpp: 35,064; ansic: 979; makefile: 78; sh: 73
file content (26 lines) | stat: -rwxr-xr-x 544 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"

set makefileName [lindex $argv 0]
set tmpfileName /tmp/rsftmp

set inFid [open $makefileName r]
set outFid [open $tmpfileName w]

while {![eof $inFid]} {
	set line [gets $inFid]
	if {[string match *\)\$* $line]} {
		set pos [string first \)\$ $line]
		set prefix [string range $line 0 $pos]
		incr pos
		set suffix [string range $line $pos end]
		set line $prefix\ $suffix
	}

	puts $outFid $line
}

close $inFid
close $outFid
file rename -force $tmpfileName $makefileName