am_edit
上传用户:center1979
上传日期:2022-07-26
资源大小:50633k
文件大小:87k
- #!/usr/bin/perl -w
- # Expands the specialised KDE tags in Makefile.in to (hopefully) valid
- # make syntax.
- # When called without file parameters, we work recursively on all Makefile.in
- # in and below the current subdirectory. When called with file parameters,
- # only those Makefile.in are changed.
- # The currently supported tags are
- #
- # {program}_METASOURCES
- # where you have a choice of two styles
- # {program}_METASOURCES = name1.moc name2.moc ... []
- # {program}_METASOURCES = AUTO
- # The second style requires other tags as well.
- #
- # To install icons :
- # KDE_ICON = iconname iconname2 ...
- # KDE_ICON = AUTO
- #
- # For documentation :
- # http://developer.kde.org/documentation/other/developer-faq.html
- #
- # and more new tags TBD!
- #
- # The concept (and base code) for this program came from automoc,
- # supplied by the following
- #
- # Matthias Ettrich <ettrich@kde.org> (The originator)
- # Kalle Dalheimer <kalle@kde.org> (The original implementator)
- # Harri Porten <porten@tu-harburg.de>
- # Alex Zepeda <jazepeda@pacbell.net>
- # David Faure <faure@kde.org>
- # Stephan Kulow <coolo@kde.org>
- # Dirk Mueller <mueller@kde.org>
- use Cwd;
- use File::Find;
- use File::Basename;
- # Prototype the functions
- sub initialise ();
- sub processMakefile ($);
- sub updateMakefile ();
- sub restoreMakefile ();
- sub removeLine ($$);
- sub appendLines ($);
- sub substituteLine ($$);
- sub findMocCandidates ();
- sub pruneMocCandidates ($);
- sub checkMocCandidates ();
- sub addMocRules ();
- sub findKcfgFile($);
- sub tag_AUTOMAKE ();
- sub tag_META_INCLUDES ();
- sub tag_METASOURCES ();
- sub tag_POFILES ();
- sub tag_DOCFILES ();
- sub tag_LOCALINSTALL();
- sub tag_IDLFILES();
- sub tag_UIFILES();
- sub tag_KCFGFILES();
- sub tag_SUBDIRS();
- sub tag_ICON();
- sub tag_CLOSURE();
- sub tag_NO_UNDEFINED();
- sub tag_NMCHECK();
- sub tag_DIST();
- sub tag_KDEINIT();
- # Some global globals...
- $verbose = 0; # a debug flag
- $thisProg = "$0"; # This programs name
- $topdir = cwd(); # The current directory
- @makefiles = (); # Contains all the files we'll process
- @foreignfiles = ();
- $start = (times)[0]; # some stats for testing - comment out for release
- $version = "v0.2";
- $errorflag = 0;
- $cppExt = "(cpp|cc|cxx|C|c\+\+)";
- $hExt = "(h|H|hh|hxx|hpp|h\+\+)";
- $progId = "KDE tags expanded automatically by " . basename($thisProg);
- $automkCall = "n";
- $printname = ""; # used to display the directory the Makefile is in
- $use_final = 1; # create code for --enable-final
- $cleantarget = "clean";
- $dryrun = 0;
- $pathoption = 0;
- $foreign_libtool = 0;
- while (defined ($ARGV[0]))
- {
- $_ = shift;
- if (/^--version$/)
- {
- print STDOUT "n";
- print STDOUT basename($thisProg), " $versionn",
- "This is really free software, unencumbered by the GPL.n",
- "You can do anything you like with it except sueing me.n",
- "Copyright 1998 Kalle Dalheimer <kalle@kde.org>n",
- "Concept, design and unnecessary questions about perln",
- " by Matthias Ettrich <ettrich@kde.org>nn",
- "Making it useful by Stephan Kulow <coolo@kde.org> andn",
- "Harri Porten <porten@kde.org>n",
- "Updated (Feb-1999), John Birch <jb.nz@writeme.com>n",
- "Fixes and Improvements by Dirk Mueller <mueller@kde.org>n",
- "Current Maintainer Stephan Kulownn";
- exit 0;
- }
- elsif (/^--verbose$|^-v$/)
- {
- $verbose = 1; # Oh is there a problem...?
- }
- elsif (/^(?:-p|--path=)(.+)$/)
- {
- my $p = $1;
- $thisProg = $p . "/". basename($thisProg);
- warn ("$thisProg doesn't existn") if (!(-f $thisProg));
- $thisProg .= " -p".$p;
- $pathoption=1;
- }
- elsif (/^--help$|^-h$/)
- {
- print STDOUT "Usage $thisProg [OPTION] ... [dir/Makefile.in]...n",
- "n",
- "Patches dir/Makefile.in generated by automaken",
- "(where dir can be an absolute or relative directory name)n",
- "n",
- " -v, --verbose verbosely list files processedn",
- " -h, --help print this help, then exitn",
- " --version print version number, then exitn",
- " -p, --path= use the path to am_edit if the pathn",
- " called from is not the one to be usedn",
- " --no-final don't patch for --enable-finaln";
-
- exit 0;
- }
- elsif (/^--no-final$/)
- {
- $use_final = 0;
- $thisProg .= " --no-final";
- }
- elsif (/^--foreign-libtool$/)
- {
- $foreign_libtool = 1;
- $thisProg .= " --foreign-libtool";
- }
- elsif (/^-n$/)
- {
- $dryrun = 1;
- }
- else
- {
- # user selects what input files to check
- # add full path if relative path is given
- $_ = cwd()."/".$_ if (! /^//);
- print "User wants $_n" if ($verbose);
- push (@makefiles, $_);
- }
- }
- if ($thisProg =~ /^// && !$pathoption )
- {
- print STDERR "Illegal full pathname call performed...n",
- "The call to "$thisProg"nwould be inserted in some Makefile.in.n",
- "Please use option --path.n";
- exit 1;
- }
- # Only scan for files when the user hasn't entered data
- if (!@makefiles)
- {
- print STDOUT "Scanning for Makefile.inn" if ($verbose);
- find (&add_makefile, cwd());
- #chdir('$topdir');
- } else {
- print STDOUT "Using input files specified by usern" if ($verbose);
- }
- foreach $makefile (sort(@makefiles))
- {
- processMakefile ($makefile);
- last if ($errorflag);
- }
- # Just some debug statistics - comment out for release as it uses printf.
- printf STDOUT "Time %.2f CPU secn", (times)[0] - $start if ($verbose);
- exit $errorflag; # causes make to fail if erroflag is set
- #-----------------------------------------------------------------------------
- # In conjunction with the "find" call, this builds the list of input files
- sub add_makefile ()
- {
- push (@makefiles, $File::Find::name) if (/Makefile.in$/);
- }
- #-----------------------------------------------------------------------------
- # Processes a single make file
- # The parameter contains the full path name of the Makefile.in to use
- sub processMakefile ($)
- {
- # some useful globals for the subroutines called here
- local ($makefile) = @_;
- local @headerdirs = ('.');
- local $haveAutomocTag = 0;
- local $MakefileData = "";
- local $cxxsuffix = "KKK";
- local @programs = (); # lists the names of programs and libraries
- local $program = "";
- local @kdeinits = (); # lists the kdeinit targets
- local %realObjs = (); # lists the objects compiled into $program
- local %sources = (); # lists the sources used for $program
- local %finalObjs = (); # lists the objects compiled when final
- local %realname = (); # the binary name of program variable
- local %idlfiles = (); # lists the idl files used for $program
- local %globalmocs = ();# list of all mocfiles (in %mocFiles format)
- local %important = (); # list of files to be generated asap
- local %uiFiles = ();
- local %kcfgFiles = ();
- local $allidls = "";
- local $idl_output = "";# lists all idl generated files for cleantarget
- local $ui_output = "";# lists all uic generated files for cleantarget
- local $kcfg_output = "";# lists all kcfg generated files for cleantarget
- local %dependmocs = ();
-
- local $metasourceTags = 0;
- local $dep_files = "";
- local $dep_finals = "";
- local %target_adds = (); # the targets to add
- local %rule_adds = ();
- local $kdelang = "";
- local @cleanfiles = ();
- local $cleanMoc = "";
- local $closure_output = "";
- local %varcontent = ();
- $makefileDir = dirname($makefile);
- chdir ($makefileDir);
- $printname = $makefile;
- $printname =~ s/^Q$topdirE///;
- $makefile = basename($makefile);
- print STDOUT "Processing makefile $printnamen" if ($verbose);
- # Setup and see if we need to do this.
- return if (!initialise());
- tag_AUTOMAKE (); # Allows a "make" to redo the Makefile.in
- tag_META_INCLUDES (); # Supplies directories for src locations
- foreach $program (@programs) {
- $sources_changed{$program} = 0;
- $dependmocs{$program} = "";
- $important{$program} = "";
- tag_IDLFILES(); # Sorts out idl rules
- tag_NO_UNDEFINED();
- tag_CLOSURE();
- tag_NMCHECK();
- tag_UIFILES(); # Sorts out ui rules
- tag_KCFGFILES(); # Sorts out kcfg rules
- tag_METASOURCES (); # Sorts out the moc rules
- if ($sources_changed{$program}) {
- my $lookup = $program . '_SOURCESs*=[ t]*(.*)';
- if($program =~ /libkdeinit_(.*)/) {
- my $prog = $1;
- substituteLine($prog . '_SOURCESs*=[ t]*(.*)',
- "${prog}_SOURCES = ${prog}_dummy.$cxxsuffixn" .
- "libkdeinit_${prog}_SOURCES = " . $sources{$program});
- $sources{$prog} = "${prog}_dummy.$cxxsuffix";
- }
- else {
- substituteLine($lookup, "$program_SOURCES=" . $sources{$program});
- }
- }
- if ($important{$program}) {
- local %source_dict = ();
- for $source (split(/[ 34s]+/, $sources{$program})) {
- $source_dict{$source} = 1;
- }
- for $source (@cleanfiles) {
- $source_dict{$source} = 0;
- }
- for $source (keys %source_dict) {
- next if (!$source);
- if ($source_dict{$source}) {
- # sanity check
- if (! -f $source) {
- print STDERR "Error: $source is listed in a _SOURCE line in $printname, but doesn't exist yet. Put it in DISTCLEANFILES!n";
- } else {
- $target_adds{"$(srcdir)/$source"} .= $important{$program};
- }
- }
- }
- }
- }
- if ($cleanMoc) {
- # Always add dist clean tag
- # Add extra *.moc.cpp files created for USE_AUTOMOC because they
- # aren't included in the normal *.moc clean rules.
- appendLines ("$cleantarget-metasources:nt-rm -f $cleanMocn");
- $target_adds{"$cleantarget-am"} .= "$cleantarget-metasources ";
- }
-
- tag_DIST() unless ($kdeopts{"noautodist"});
- if ($idl_output) {
- appendLines ("$cleantarget-idl:nt-rm -f $idl_outputn");
- $target_adds{"$cleantarget-am"} .= "$cleantarget-idl ";
- }
- if ($ui_output) {
- appendLines ("$cleantarget-ui:nt-rm -f $ui_outputn");
- $target_adds{"$cleantarget-am"} .= "$cleantarget-ui ";
- }
- if ($kcfg_output) {
- appendLines ("$cleantarget-kcfg:nt-rm -f $kcfg_outputn");
- $target_adds{"$cleantarget-am"} .= "$cleantarget-kcfg ";
- }
- if ($closure_output) {
- appendLines ("$cleantarget-closures:nt-rm -f $closure_outputn");
- $target_adds{"$cleantarget-am"} .= "$cleantarget-closures ";
- }
- if ($MakefileData =~ /nKDE_LANGs*=s*(S*)s*n/) {
- $kdelang = '$(KDE_LANG)'
- } else {
- $kdelang = '';
- }
- tag_POFILES (); # language rules for po directory
- tag_DOCFILES (); # language rules for doc directories
- tag_LOCALINSTALL(); # add $(DESTDIR) before all kde_ dirs
- tag_ICON();
- tag_SUBDIRS();
- my $tmp = "force-reedit:n";
- $tmp .= "t$automkCallntcd $(top_srcdir) && perl $thisProg $printnamenn";
- appendLines($tmp);
- make_bcheck_target();
- make_meta_classes();
- tag_COMPILE_FIRST();
- tag_FINAL() if (!$kdeopts{"nofinal"});
- my $final_lines = "final:nt$(MAKE) ";
- my $final_install_lines = "final-install:nt$(MAKE) ";
- my $nofinal_lines = "no-final:nt$(MAKE) ";
- my $nofinal_install_lines = "no-final-install:nt$(MAKE) ";
- foreach $program (@programs) {
- my $lookup = $program . '_OBJECTSs*=[ t]*.*';
- my $new = "";
- my @list = split(/[ 34s]+/, $realObjs{$program});
- if (!$kdeopts{"nofinal"} && @list > 1 && $finalObjs{$program}) {
- $new .= "$program_final_OBJECTS = " . $finalObjs{$program};
- $new .= "n$program_nofinal_OBJECTS = " . $realObjs{$program};
- $new .= "n@KDE_USE_FINAL_FALSE@$program_OBJECTS = $($program_nofinal_OBJECTS)";
- $new .= "n@KDE_USE_FINAL_TRUE@$program_OBJECTS = $($program_final_OBJECTS)";
- $final_lines .= "$program_OBJECTS="$($program_final_OBJECTS)" ";
- $final_install_lines .= "$program_OBJECTS="$($program_final_OBJECTS)" ";
- $nofinal_lines .= "$program_OBJECTS="$($program_nofinal_OBJECTS)" ";
- $nofinal_install_lines .= "$program_OBJECTS="$($program_nofinal_OBJECTS)" ";
- } else {
- $new = "$program_OBJECTS = " . $realObjs{$program};
- }
- if($MakefileData =~ m/n$lookup/) {
- substituteLine ($lookup, $new);
- }
- else {
- appendLines("$newn");
- }
- }
- appendLines($final_lines . "all-amn");
- appendLines($final_install_lines . "install-amn");
- appendLines($nofinal_lines . "all-amn");
- appendLines($nofinal_install_lines . "install-amn");
- my $lookup = '(@S+@)?DEP_FILESs*=[ t]*(.*)';
- if ($MakefileData =~ /n$lookup/) {
- my $condition = $1;
- my $depfiles = $2;
- my $workfiles;
- if ($dep_finals) {
- # Add the conditions on every line, since
- # there may be line continuations in the list.
- $workfiles = "$dep_files $dep_finals $depfiles";
- $workfiles =~ s/ 34/ 34$condition@KDE_USE_FINAL_TRUE@t/g;
- $lines = "$condition@KDE_USE_FINAL_TRUE@DEP_FILES = $workfilesn";
- $workfiles = "$dep_files $depfiles";
- $workfiles =~ s/ 34/ 34$condition@KDE_USE_FINAL_FALSE@t/g;
- $lines .= "$condition@KDE_USE_FINAL_FALSE@DEP_FILES = $workfiles";
- } else {
- $workfiles = "$dep_files $depfiles";
- $workfiles =~ s/ 34/ 34$conditiont/g;
- $lines = $condition . "DEP_FILES = $workfiles";
- }
- substituteLine($lookup, $lines);
- }
- # new recursive targets
- $target_adds{ "nmcheck" } .= ""; # always create nmcheck target
- $target_adds{ "nmcheck-am" } .= "nmcheck";
- $lookup = 'RECURSIVE_TARGETSs*=[ t]*(.*)';
- if ($MakefileData =~ /n$lookup/) {
- substituteLine($lookup, "RECURSIVE_TARGETS = $1 nmcheck-recursive bcheck-recursive");
- }
- $cvs_lines = "kde-rpo-clean:n";
- $cvs_lines .= "t-rm -f *.rpon";
- appendLines($cvs_lines);
- $target_adds{"clean"} .= "kde-rpo-clean ";
- my %target_dels = ("install-data-am" => "");
- # some strange people like to do a install-exec, and expect that also
- # all modules are installed. automake doesn't know this, so we need to move
- # this here from install-data to install-exec.
- if ($MakefileData =~ m/nkde_module_LTLIBRARIESs*=/) {
- # $target_adds{"install-exec-am"} .= "install-kde_moduleLTLIBRARIES ";
- # don't use $target_adds here because we need to append the dependency, not
- # prepend it. Fixes #44342 , when a module depends on a lib in the same dir
- # and libtool needs it during relinking upon install (Simon)
- my $lookup = "install-exec-am:([^n]*)";
- if($MakefileData =~ /n$lookupn/) {
- substituteLine("$lookup", "install-exec-am: $1 install-kde_moduleLTLIBRARIES");
- }
- $target_dels{"install-data-am"} .= "install-kde_moduleLTLIBRARIES ";
- $target_adds{"install-data-am"} .= " ";
- }
- my $lines = "";
- foreach $add (keys %target_adds) {
- my $lookup = quotemeta($add) . ':([^n]*)';
- if ($MakefileData =~ /n$lookupn/) {
- my $newlines = $1;
- my $oldlines = $lookup;
- if (defined $target_dels{$add}) {
- foreach $del (split(' ', $target_dels{$add})) {
- $newlines =~ s/s*$dels*/ /g;
- }
- }
- substituteLine($oldlines, "$add: " . $target_adds{$add} . $newlines);
- } else {
- $lines .= "$add: " . $target_adds{$add} . "n";
- }
- }
- appendLines($lines) if ($lines);
- $lines = join("n", values %rule_adds);
- appendLines($lines) if ($lines);
- my $found = 1;
- while ($found) {
- if ($MakefileData =~ m/n(.*)$(CXXFLAGS)(.*)n/) {
- my $stuff_before = $1;
- my $stuff_after = $2;
- my $lookup = quotemeta("$1$(CXXFLAGS)$2");
- my $replacement = "$1$(KCXXFLAGS)$2";
- $MakefileData =~ s/$lookup/$replacement/;
- $lookup =~ s/\$\(CXXFLAGS\)/\$\(KCXXFLAGS\)/;
- $replacement = "$stuff_before$(KCXXFLAGS) $(KDE_CXXFLAGS)$stuff_after";
- next if ($stuff_before =~ /$(KDE_CXXFLAGS)/ or $stuff_after =~ /$(KDE_CXXFLAGS)/);
- substituteLine($lookup, $replacement);
- } else {
- $found = 0;
- }
- }
- if($foreign_libtool == 0) {
- $lookup = '(n[^#].*$(LIBTOOL) --mode=link) ($(CXXLD).*$(KCXXFLAGS))';
- if ($MakefileData =~ m/$lookup/ ) {
- $MakefileData =~ s/$lookup/$1 --tag=CXX $2/;
- }
- $lookup = '(n[^#].*$(LIBTOOL) --mode=compile)s+($(CXX)s+)';
- if ($MakefileData =~ m/$lookup/ ) {
- $MakefileData =~ s/$lookup/$1 --tag=CXX $2/;
- }
- }
- $MakefileData =~ s/$(KCXXFLAGS)/$(CXXFLAGS)/g;
- $lookup = '(.*)cp -pr $$/$$file $(distdir)/$$file(.*)';
- if ($MakefileData =~ m/n$lookupn/) {
- substituteLine($lookup, "$1cp -pr $$d/$$file $(distdir)/$$file$2");
- }
- # Always update the Makefile.in
- updateMakefile ();
- return;
- }
- #-----------------------------------------------------------------------------
- # Beware: This procedure is not complete. E.g. it also parses lines
- # containing a '=' in rules (for instance setting shell vars). For our
- # usage this us enough, though.
- sub read_variables ()
- {
- while ($MakefileData =~ /ns*(S+)s*=([^n]*)/g) {
- $varcontent{$1} = $2;
- }
- }
- # Check to see whether we should process this make file.
- # This is where we look for tags that we need to process.
- # A small amount of initialising on the tags is also done here.
- # And of course we open and/or create the needed make files.
- sub initialise ()
- {
- if (! -r "Makefile.am") {
- print STDOUT "found Makefile.in without Makefile.amn" if ($verbose);
- return 0;
- }
- # Checking for files to process...
- open (FILEIN, $makefile) || die "Can't open $makefileDir/$makefile: $!n";
- # perl bug in 5.8.0: in utf8 mode it badly screws up
- binmode(FILEIN, ":bytes") if ($] >= 5.008);
- # Read the file
- # stat(FILEIN)[7] might look more elegant, but is slower as it
- # requires stat'ing the file
- seek(FILEIN, 0, 2);
- my $fsize = tell(FILEIN);
- seek(FILEIN, 0, 0);
- read FILEIN, $MakefileData, $fsize;
- close FILEIN;
- print "DOS CRLF within $makefileDir/$makefile!n" if($MakefileData =~ y/r//d);
- # Remove the line continuations, but keep them marked
- # Note: we lose the trailing spaces but that's ok.
- # Don't mangle line-leading spaces (usually tabs)
- # since they're important.
- $MakefileData =~ s/\s*n/ 34/g;
- # If we've processed the file before...
- restoreMakefile () if ($MakefileData =~ /$progId/);
- foreach $dir (@foreignfiles) {
- if (substr($makefileDir,0,length($dir)) eq $dir) {
- return 0;
- }
- }
- %kdeopts = ();
- $kdeopts{"foreign"} = 0;
- $kdeopts{"qtonly"} = 0;
- $kdeopts{"noautodist"} = 0;
- $kdeopts{"foreign-libtool"} = $foreign_libtool;
- $kdeopts{"nofinal"} = !$use_final; # default
- read_variables();
- if ($MakefileData =~ /nKDE_OPTIONSs*=[ t]*([^n]*)n/) {
- my $kde_options_str = $1;
- local @kde_options = split(/[ 34s]+/, $kde_options_str);
- if (grep(/^foreign$/, @kde_options)) {
- push(@foreignfiles, $makefileDir . "/");
- return 0; # don't touch me
- }
- for $opt (@kde_options) {
- if (!defined $kdeopts{$opt}) {
- print STDERR "Warning: unknown option $opt in $printnamen";
- } else {
- $kdeopts{$opt} = 1;
- }
- }
- }
- # Look for the tags that mean we should process this file.
- $metasourceTags = 0;
- $metasourceTags++ while ($MakefileData =~ /n[^=#]*METASOURCESs*=/g);
- my $pofileTag = 0;
- $pofileTag++ while ($MakefileData =~ /nPOFILESs*=/g);
- if ($pofileTag > 1)
- {
- print STDERR "Error: Only one POFILES tag allowedn";
- $errorflag = 1;
- }
- while ($MakefileData =~ /n.SUFFIXES:([^n]+)n/g) {
- my $suffixes_str = $1;
- my @list=split(' ', $suffixes_str);
- foreach $ext (@list) {
- if ($ext =~ /^.$cppExt$/) {
- $cxxsuffix = $ext;
- $cxxsuffix =~ s/.//g;
- print STDOUT "will use suffix $cxxsuffixn" if ($verbose);
- last;
- }
- }
- }
- tag_KDEINIT();
- while ($MakefileData =~ /n(S*)_OBJECTSs*=[ 34 t]*([^n]*)n/g) {
- my $program = $1;
- my $objs = $2; # safe them
- my $ocv = 0;
- my @objlist = split(/[ 34s]+/, $objs);
- foreach $obj (@objlist) {
- if ($obj =~ /(S*)$((S+))/ ) {
- my $pre = $1;
- my $variable = $2;
- if ($pre eq '' && exists($varcontent{$variable})) {
- my @addlist = split(/[ 34s]+/, $varcontent{$variable});
- push(@objlist, @addlist);
- } elsif ($variable !~ 'OBJEXT' && $variable !~ /am__objects_d+/ ) {
- $ocv = 1;
- }
- }
- }
- next if ($ocv);
- next if ($program =~ /^am_libkdeinit_/);
- $program =~ s/^am_// if ($program =~ /^am_/);
- my $sourceprogram = $program;
- $sourceprogram =~ s/@am_/@/ if($sourceprogram =~ /^.*@am_.+/);
- print STDOUT "found program $programn" if ($verbose);
- push(@programs, $program);
- $realObjs{$program} = $objs;
- if ($MakefileData =~ /n$sourceprogram_SOURCESs*=[ t]*(.*)n/) {
- $sources{$program} = $1;
- }
- else {
- $sources{$program} = "";
- print STDERR "found program with no _SOURCES: $programn";
- }
-
- my $realprogram = $program;
- $realprogram =~ s/_/./g; # unmask to regexp
- if ($MakefileData =~ /n($realprogram)($(EXEEXT)?)?:.*$($program_OBJECTS)/) {
- $realname{$program} = $1;
- } else {
- # not standard Makefile - nothing to worry about
- $realname{$program} = "";
- }
- }
- my $lookup = 'DEPDIRs*=.*';
- if ($MakefileData !~ /n$lookup/) {
- $lookup = 'bindirs*=[ t]*.*';
- substituteLine($lookup, "DEPDIR = .depsn$1") if ($MakefileData =~ /n($lookup)/);
- }
- my @marks = ('MAINTAINERCLEANFILES', 'CLEANFILES', 'DISTCLEANFILES');
- foreach $mark (@marks) {
- while ($MakefileData =~ /n($mark)s*=[ t]*([^n]*)/g) {
- my $clean_str = $2;
- foreach $file (split('[ 34s]+', $clean_str)) {
- $file =~ s/.///;
- push(@cleanfiles, $file);
- }
- }
- }
- my $localTag = 0;
- $localTag++ if ($MakefileData =~ /ninstall-S+-local:/);
-
- return (!$errorflag);
- }
- #-----------------------------------------------------------------------------
- # Gets the list of user defined directories - relative to $srcdir - where
- # header files could be located.
- sub tag_META_INCLUDES ()
- {
- my $lookup = '[^=n]*META_INCLUDESs*=[ t]*(.*)';
- return 1 if ($MakefileData !~ /($lookup)n/);
- print STDOUT "META_INCLUDE processing <$1>n" if ($verbose);
- my $headerStr = $2;
- removeLine ($lookup, $1);
- my @headerlist = split(/[ 34s]+/, $headerStr);
- foreach $dir (@headerlist)
- {
- $dir =~ s#$(srcdir)#.#;
- if (! -d $dir)
- {
- print STDERR "Warning: $dir can't be found. ",
- "Must be a relative path to $(srcdir)n";
- }
- else
- {
- push (@headerdirs, $dir);
- }
- }
- return 0;
- }
- #-----------------------------------------------------------------------------
- sub tag_FINAL()
- {
- my @final_names = ();
-
- foreach $program (@programs) {
-
- if ($sources{$program} =~ /(/) {
- print STDOUT "found ( in $program_SOURCES. skippingn" if ($verbose);
- next;
- }
- my $mocs = ""; # Moc files (in this program)
- my $moc_cpp_added = 0; # If we added some .moc.cpp files, due to
- # no other .cpp file including the .moc one.
-
- my @progsources = split(/[ 34s]+/, $sources{$program});
- my %shash = ();
- @shash{@progsources} = 1; # we are only interested in the existence
- my %sourcelist = ();
- my %extradeps = ();
-
- foreach $source (@progsources) {
- my $suffix = $source;
- $suffix =~ s/^.*.([^.]+)$/$1/;
-
- $sourcelist{$suffix} .= "$source ";
- }
- foreach my $mocFile (keys (%globalmocs))
- {
- my ($dir, $hFile, $cppFile) = split ("