⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 am_edit

📁 bookcase,by shell script and c++ and perl
💻
📖 第 1 页 / 共 5 页
字号:
                        $finalObjs{$program} .= "o ";                    }                }                next; # suffix            }                        my $source_deps = "";            foreach $source (@sourcelist) {                if (-f $source) {                    $source_deps .= " \$(srcdir)/$source";                } else {                    $source_deps .= " $source";                }            }            $handling = "$program.all_$suffix.$suffix: \$(srcdir)/Makefile.in" . $source_deps . " " . join(' ', $mocs)  . "\n";            $handling .= "\t\@echo 'creating $program.all_$suffix.$suffix ...'; \\\n";            $handling .= "\trm -f $program.all_$suffix.files $program.all_$suffix.final; \\\n";            $handling .= "\techo \"#define KDE_USE_FINAL 1\" >> $program.all_$suffix.final; \\\n";            $handling .= "\tfor file in " . $sourcelist{$suffix} . "; do \\\n";            $handling .= "\t  echo \"#include \\\"\$\$file\\\"\" >> $program.all_$suffix.files; \\\n";            $handling .= "\t  test ! -f \$\(srcdir\)/\$\$file || egrep '^#pragma +implementation' \$\(srcdir\)/\$\$file >> $program.all_$suffix.final; \\\n";            $handling .= "\tdone; \\\n";            $handling .= "\tcat $program.all_$suffix.final $program.all_$suffix.files > $program.all_$suffix.$suffix; \\\n";            $handling .= "\trm -f $program.all_$suffix.final $program.all_$suffix.files\n";            appendLines($handling);            push(@final_names, "$program.all_$suffix.$suffix");            my $finalObj = "$program.all_$suffix.";            if ($program =~ /_la$/) {                $finalObj .= "lo";            } else {                $finalObj .= "o";            }	    $finalObjs{$program} .= $finalObj . " ";        }    }        if (!$kdeopts{"nofinal"} && @final_names >= 1) {        # add clean-final target        my $lines = "$cleantarget-final:\n";        $lines .= "\t-rm -f " . join(' ', @final_names) . "\n" if (@final_names);        appendLines($lines);        $target_adds{"$cleantarget-am"} .= "$cleantarget-final ";                foreach $finalfile (@final_names) {            $finalfile =~ s/\.[^.]*$/.P/;            $dep_finals .= " \$(DEPDIR)/$finalfile";        }    }}#-----------------------------------------------------------------------------sub tag_COMPILE_FIRST(){  foreach $program (@programs) {    my $lookup = "$program" . '_COMPILE_FIRST\s*=\s*(.*)';    if ($MakefileData =~ m/\n$lookup\n/) {      my $compilefirst_str = $1;      my @compilefirst = split(/[\034\s]+/, $compilefirst_str);      my @progsources = split(/[\034\s]+/, $sources{$program});      my %donesources = ();      $handling = "";      foreach $source (@progsources) {        my @deps  = ();        my $sdeps = "";        if (-f $source) {          $sdeps = "\$(srcdir)/$source";        } else {          $sdeps = "$source";        }        foreach $depend (@compilefirst) {          next if ($source eq $depend);          # avoid cyclic dependencies          next if defined($donesources{$depend});          push @deps, $depend;        }        $handling .= "$sdeps: " . join(' ', @deps) . "\n" if (@deps);        $donesources{$source} = 1;      }      appendLines($handling) if (length($handling));    }  }}#-----------------------------------------------------------------------------# Organises the list of headers that we'll use to produce moc files# from.sub tag_METASOURCES (){    local @newObs           = ();  # here we add to create object files    local @deped            = ();  # here we add to create moc files    local $mocExt           = ".moc";    local %mocFiles         = ();    my $line = "";    my $postEqual = "";    my $lookup;    my $found = "";#print "$program: tag_METASOURCES\n";    if ($metasourceTags > 1) {	$lookup = $program . '_METASOURCES\s*=\s*(.*)';	return 1    if ($MakefileData !~ /\n($lookup)\n/);	$found = $1;    } else {	$lookup = $program . '_METASOURCES\s*=\s*(.*)';	if ($MakefileData !~ /\n($lookup)\n/) {	    $lookup = 'METASOURCES\s*=\s*(.*)';	    return 1    if ($MakefileData !~ /\n($lookup)\n/o);	    $found = $1;	    $metasourceTags = 0; # we can use the general target only once	} else {            $found = $1;        }    }    print STDOUT "METASOURCE processing <$found>)\n"      if ($verbose);        $postEqual = $found;    $postEqual =~ s/[^=]*=//;        removeLine ($lookup, $found);        # Always find the header files that could be used to "moc"    return 1    if (findMocCandidates ());        if ($postEqual =~ /AUTO\s*(\S*)|USE_AUTOMOC\s*(\S*)/)    {	print STDERR "$printname: the argument for AUTO|USE_AUTOMOC is obsolete" if ($+);	$mocExt = ".moc.$cxxsuffix";	$haveAutomocTag = 1;    }    else    {        # Not automoc so read the list of files supplied which        # should be .moc files.        $postEqual =~ tr/\034/ /;        # prune out extra headers - This also checks to make sure that        # the list is valid.        pruneMocCandidates ($postEqual);    }    checkMocCandidates ();        if (@newObs) {        my $ext =  ($program =~ /_la$/) ? ".moc.lo " : ".moc.o ";        $realObjs{$program} .= "\034" . join ($ext, @newObs) . $ext;        $depedmocs{$program} = join (".moc.$cxxsuffix " , @newObs) . ".moc.$cxxsuffix";        foreach $file (@newObs) {            $dep_files .= " \$(DEPDIR)/$file.moc.P" if($dep_files !~/$file.moc.P/);        }    }    if (@deped) {        $depedmocs{$program} .= " ";        $depedmocs{$program} .= join('.moc ', @deped) . ".moc";        $depedmocs{$program} .= " ";    }    addMocRules ();    @globalmocs{keys %mocFiles}=values %mocFiles;}#-----------------------------------------------------------------------------# Returns 0 if the line was processed - 1 otherwise.# Errors are logged in the global $errorflagssub tag_AUTOMAKE (){    my $lookup = '.*cd \$\(top_srcdir\)\s+&&[\034\s]+\$\(AUTOMAKE\)(.*)';    return 1    if ($MakefileData !~ /\n($lookup)\n/);    print STDOUT "AUTOMAKE processing <$1>\n"        if ($verbose);    my $newLine = $1."\n\tcd \$(top_srcdir) && perl $thisProg $printname";    substituteLine ($lookup, $newLine);    $automkCall = $1;    return 0;}#-----------------------------------------------------------------------------sub handle_TOPLEVEL(){    my $pofiles = "";    my @restfiles = ();    opendir (THISDIR, ".");    foreach $entry (readdir(THISDIR)) {        next if (-d $entry);                next if ($entry eq "CVS" || $entry =~ /^\./  || $entry =~ /^Makefile/ || $entry =~ /~$/ || $entry =~ /^\#.*\#$/ || $entry =~ /.gmo$/);                         if ($entry =~ /\.po$/) {             next;        }        push(@restfiles, $entry);    }    closedir (THISDIR);                if (@restfiles) {        $target_adds{"install-data-am"} .= "install-nls-files ";        $lines = "install-nls-files:\n";        $lines .= "\t\$(mkinstalldirs) \$(DESTDIR)\$(kde_locale)/$kdelang\n";        for $file (@restfiles) {            $lines .= "\t\$(INSTALL_DATA) \$\(srcdir\)/$file \$(DESTDIR)\$(kde_locale)/$kdelang/$file\n";        }	$target_adds{"uninstall"} .= "uninstall-nls-files ";        $lines .= "uninstall-nls-files:\n";        for $file (@restfiles) {            $lines .= "\t-rm -f \$(DESTDIR)\$(kde_locale)/$kdelang/$file\n";        }        appendLines($lines);    }        return 0;}#-----------------------------------------------------------------------------sub tag_SUBDIRS (){  if ($MakefileData !~ /\nSUBDIRS\s*=\s*\$\(AUTODIRS\)\s*\n/) {    return 1;  }  my $subdirs = ".";  opendir (THISDIR, ".");  foreach $entry (readdir(THISDIR)) {    next if ($entry eq "CVS" || $entry =~ /^\./);    if (-d $entry && -f $entry . "/Makefile.am") {      $subdirs .= " $entry";      next;    }  }  closedir (THISDIR);  my $lines = "SUBDIRS =$subdirs\n";  substituteLine('SUBDIRS\s*=.*', $lines);  return 0;}sub tag_IDLFILES (){    my @psources = split(/[\034\s]+/, $sources{$program});    my $dep_lines = "";    my @cppFiles = ();        foreach $source (@psources) {                my $skel = ($source =~ m/\.skel$/);        my $stub = ($source =~ m/\.stub$/);        my $signals = ($source =~ m/\.signals$/);                if ($stub || $skel || $signals) {                        my $qs = quotemeta($source);            $sources{$program} =~ s/$qs//;            $sources_changed{$program} = 1;                        print STDOUT "adding IDL file $source\n" if ($verbose);                        $source =~ s/\.(stub|skel|signals)$//;                        my $sourcename;                        if ($skel) {                $sourcename = "$source\_skel";            } elsif ($stub) {                $sourcename = "$source\_stub";            } else {                $sourcename = "$source\_signals";            }                        my $sourcedir = '';            if (-f "$makefileDir/$source.h") {                $sourcedir = '$(srcdir)/';            } else {                if ($MakefileData =~ /\n$source\_DIR\s*=\s*(\S+)\n/) {                    $sourcedir = $1;                    $sourcedir .= "/" if ($sourcedir !~ /\/$/);                }            }                        if ($allidls !~ /$source\_kidl/) {                                $dep_lines .= "$source.kidl: $sourcedir$source.h \$(DCOP_DEPENDENCIES)\n";                $dep_lines .= "\t\$(DCOPIDL) $sourcedir$source.h > $source.kidl || ( rm -f $source.kidl ; /bin/false )\n";                                $allidls .= $source . "_kidl ";            }                        if ($allidls !~ /$sourcename/) {                                $dep_lines_tmp = "";                if ($skel) {                    $dep_lines .= "$sourcename.$cxxsuffix: $source.kidl\n";                    $dep_lines .= "\t\$(DCOPIDL2CPP) --c++-suffix $cxxsuffix --no-signals --no-stub $source.kidl\n";                } elsif ($stub) {                    $dep_lines_tmp = "\t\$(DCOPIDL2CPP) --c++-suffix $cxxsuffix --no-signals --no-skel $source.kidl\n";                } else { # signals                    $dep_lines_tmp = "\t\$(DCOPIDL2CPP) --c++-suffix $cxxsuffix --no-stub --no-skel $source.kidl\n";                }                if ($stub || $signals) {                    $target_adds{"$sourcename.$cxxsuffix"} .= "$sourcename.h ";                    $dep_lines .= "$sourcename.h: $source.kidl\n";                    $dep_lines .= $dep_lines_tmp;                }                                $allidls .= $sourcename . " ";            }                        $idlfiles{$program} .= $sourcename . " ";                        if ($program =~ /_la$/) {                $realObjs{$program} .= " $sourcename.lo";            } else {                $realObjs{$program} .= " $sourcename.\$(OBJEXT)";            }            $sources{$program} .= " $sourcename.$cxxsuffix";            $sources_changed{$program} = 1;            $important{$program} .= "$sourcename.h " if (!$skel);            $idl_output .= "\\\n\t$sourcename.$cxxsuffix $sourcename.h $source.kidl ";            push(@cleanfiles, "$sourcename.$cxxsuffix");            push(@cleanfiles, "$sourcename.h");            push(@cleanfiles, "$sourcename.kidl");            $dep_files .= " \$(DEPDIR)/$sourcename.P" if ($dep_files !~/$sourcename.P/);        }    }    if ($dep_lines) {        appendLines($dep_lines);    }        if (0) {        my $lookup = "($program)";        $lookup .= '(|\$\(EXEEXT\))';        $lookup =~ s/\_/./g;        $lookup .= ":(.*..$program\_OBJECTS..*)";        #    $lookup = quotemeta($lookup);        if ($MakefileData =~ /\n$lookup\n/) {                        my $line = "$1$2: ";            foreach $file (split(' ', $idlfiles{$program})) {                $line .= "$file.$cxxsuffix ";            }            $line .= $3;            substituteLine($lookup, $line);        } else {            print STDERR "no built dependency found $lookup\n";        }    }}sub tag_UIFILES (){    my @psources = split(/[\034\s]+/, $sources{$program});    my $dep_lines = "";    my @depFiles = ();        foreach $source (@psources) {        if ($source =~ m/\.ui$/) {            print STDERR "adding UI file $source\n" if ($verbose);            my $qs = quotemeta($source);            $sources{$program} =~ s/$qs//;            $sources_changed{$program} = 1;                  $source =~ s/\.ui$//;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -