Logo Search packages:      
Sourcecode: jmk version File versions  Download package

void edu::neu::ccs::jmk::Make::readAndMake ( String[]  targets,
boolean  useWindow,
boolean  useSwing 
) throws CommandFailedException [inline]

Invoke make after command line processing has completed.

Parameters:
targets the list of targets for a make run
useWindow request make window when true
useSwing request make Swing window when true

Definition at line 487 of file Make.java.

References getFile(), edu::neu::ccs::jmk::ParseError::getFileName(), edu::neu::ccs::jmk::ParseError::getLineNumber(), load(), and make().

Referenced by exec().

  {
    if (useWindow) {
      edu.neu.ccs.jmk.awt.MakeWindow.createMakeWindow(this, targets);
    }
    else if (useSwing) {
      try {             // Try using swing if possible
      edu.neu.ccs.jmk.swing.JMakeWindow.createMakeWindow(this, targets);
      }
      catch (LinkageError le) {
      edu.neu.ccs.jmk.awt.MakeWindow.createMakeWindow(this, targets);
      }
    }
    else {
      File file = getFile();
      Reader in;              // Open input to makefile

      if (file.getPath().equals("-"))
      in = new InputStreamReader(System.in);
      else {
      try {
        in = new FileReader(file);
      }
      catch (FileNotFoundException ex) {
        out.println("Cannot find makefile " + file.getPath());
        fail();
        return;
      }
      }

      try {
      load(in);   // Load makefile
      }
      catch (ParseError pe) {
      out.println(pe.getFileName() + ":" + pe.getLineNumber()
                + ": Parse error: " + pe.getMessage());
      fail();
      return;
      }

      try {
      if (!make(targets)) // Run make
        out.println("Nothing to make");
      }
      catch (CommandFailedException ex) {
      out.println("Command failed: " + ex.getMessage());
      fail();
      return;
      }
    }
  }


Generated by  Doxygen 1.6.0   Back to index