Example #1
0
//BEGIN class ProcessChain
ProcessChain::ProcessChain( ProcessOptions options, const char *name )
	: QObject( KTechlab::self() /*, name */ )
{
    setObjectName( name );
	m_pFlowCode = 0l;
	m_pGpasm = 0l;
	m_pGpdasm = 0l;
	m_pGplib = 0l;
	m_pGplink = 0l;
	m_pMicrobe = 0l;
	m_pPicProgrammer = 0l;
	m_pSDCC = 0l;
	m_processOptions = options;
	
	QString target;
	if ( ProcessOptions::ProcessPath::to( options.processPath() ) == ProcessOptions::ProcessPath::Pic )
		target = options.m_picID;
	else
		target = options.targetFile();
	
	LanguageManager::self()->logView()->addOutput( i18n("Building: %1", target ), LogView::ot_important );
	QTimer::singleShot( 0, this, SLOT(compile()) );
}
Example #2
0
void Gpasm::processInput( ProcessOptions options )
{
	resetLanguageProcess();
	m_processOptions = options;

	AsmParser p( options.inputFiles().first() );
	p.parse();

	*m_languageProcess << ("gpasm");

	if ( ProcessOptions::ProcessPath::from( options.processPath() ) == ProcessOptions::ProcessPath::AssemblyRelocatable )
		*m_languageProcess << ("--object");

// 	*m_languageProcess << ("--debug-info"); // Debug info

	// Output filename
	*m_languageProcess << ("--output");
	*m_languageProcess << ( options.intermediaryOutput() );

	if ( !options.m_hexFormat.isEmpty() )
	{
		*m_languageProcess << ("--hex-format");
		*m_languageProcess << (options.m_hexFormat);
	}

	// Radix
	if ( !p.containsRadix() )
	{
		*m_languageProcess << ("--radix");
		switch( KtlConfig::self()->radix() )
		{
            case KtlConfig::Binary:
				*m_languageProcess << ("BIN");
				break;
			case KtlConfig::Octal:
				*m_languageProcess << ("OCT");
				break;
			case KtlConfig::Hexadecimal:
				*m_languageProcess << ("HEX");
				break;
			case KtlConfig::Decimal:
			default:
				*m_languageProcess << ("DEC");
				break;
		}
		*m_languageProcess << ("DEC"); // choose the default
	}

	// Warning Level
	*m_languageProcess << ("--warning");
	switch( KtlConfig::self()->gpasmWarningLevel() )
	{
		case KtlConfig::Warnings:
			*m_languageProcess << ("1");
			break;
		case KtlConfig::Errors:
			*m_languageProcess << ("2");
			break;
		default:
		case KtlConfig::All:
			*m_languageProcess << ("0");
			break;
	}

	// Ignore case
	if ( KtlConfig::self()->ignoreCase() )
		*m_languageProcess << ("--ignore-case");
	// Dos formatting
	if ( KtlConfig::self()->dosFormat() )
		*m_languageProcess << ("--dos");

	// Force list
	if ( options.b_forceList )
		*m_languageProcess << ("--force-list");

	// Other options
	if ( !KtlConfig::self()->miscGpasmOptions().isEmpty() )
		*m_languageProcess << ( KtlConfig::self()->miscGpasmOptions() );
	// Input Asm file
	*m_languageProcess << ( options.inputFiles().first() );

	if ( !start() )
	{
		// KMessageBox::sorry( LanguageManager::self()->logView(), tr("Assembly failed. Please check you have gputils installed.") );
        qCritical() << "assembly failed";
		processInitFailed();
		return;
	}
}