From 3d89f5e5c4efb3a3e8fe05540ef4f7cf104d371f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Tue, 23 Jul 2013 01:37:49 +0200 Subject: Rename smokeqt -> smoketqt --- smoke/tqt/generate_makefile_am.pl | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 smoke/tqt/generate_makefile_am.pl (limited to 'smoke/tqt/generate_makefile_am.pl') diff --git a/smoke/tqt/generate_makefile_am.pl b/smoke/tqt/generate_makefile_am.pl new file mode 100755 index 00000000..61995278 --- /dev/null +++ b/smoke/tqt/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 () { + if (/^libsmoketqt_la_SOURCES/) + { + $found = 1; + $makeFileData .= "libsmoketqt_la_SOURCES = smokedata.cpp"; + } + $makeFileData .= $_ if (!$found); +} +close MAKEFILE; + +die "libsmoketqt_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; -- cgit v1.2.1