diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 90825e2392b2d70e43c7a25b8a3752299a933894 (patch) | |
tree | e33aa27f02b74604afbfd0ea4f1cfca8833d882a /smoke/qt/generate_makefile_am.pl | |
download | tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.tar.gz tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'smoke/qt/generate_makefile_am.pl')
-rwxr-xr-x | smoke/qt/generate_makefile_am.pl | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/smoke/qt/generate_makefile_am.pl b/smoke/qt/generate_makefile_am.pl new file mode 100755 index 00000000..03f51747 --- /dev/null +++ b/smoke/qt/generate_makefile_am.pl @@ -0,0 +1,55 @@ +#!/usr/bin/perl -w + +use File::Basename; + +my $here = `pwd`; +chomp $here; +my $outdir = $here; +my $tempfile = "$outdir/.Makefile.am.tmpfile"; + +# Update list of source files in $outdir/Makefile.am +open( MAKEFILE, "<$outdir/Makefile.am" ) or die; +my $makeFileData = ''; +my $found = 0; +while (<MAKEFILE>) { + if (/^libsmokeqt_la_SOURCES/) + { + $found = 1; + $makeFileData .= "libsmokeqt_la_SOURCES = smokedata.cpp"; + } + $makeFileData .= $_ if (!$found); +} +close MAKEFILE; + +die "libsmokeqt_la_SOURCES not found" if (!$found); + +open( MAKEFILE, ">$tempfile" ) or die; +print MAKEFILE $makeFileData; + +my $count = 0; +opendir (FILES, $outdir) or die; +foreach $filename (readdir(FILES)) { + if ( $filename =~ /^x_.*\.cpp$/ ) { + if ( $count++ == 7 ) { + $count = 0; + print MAKEFILE " \\\n"; + } + print MAKEFILE " $filename"; + } +} + +print MAKEFILE "\n"; +close MAKEFILE; +closedir FILES; + +system "cmp -s $tempfile $outdir/Makefile.am"; +if ($? >> 8) { + system "cp -f $tempfile $outdir/Makefile.am"; + print STDERR "Makefile.am updated.\n"; +} +else { + print STDERR "Makefile.am unchanged.\n"; +} +system "rm -f $tempfile"; + +exit 0; |