From f508189682b6fba62e08feeb1596f682bad5fff9 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 24 Feb 2010 18:42:24 +0000 Subject: Added KDE3 version of PikLab git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1095639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/tools/boost/Makefile.am | 9 ++++ src/tools/boost/boost.cpp | 102 ++++++++++++++++++++++++++++++++++++ src/tools/boost/boost.h | 74 ++++++++++++++++++++++++++ src/tools/boost/boost_config.cpp | 9 ++++ src/tools/boost/boost_config.h | 24 +++++++++ src/tools/boost/boost_generator.cpp | 81 ++++++++++++++++++++++++++++ src/tools/boost/boost_generator.h | 37 +++++++++++++ src/tools/boost/boostbasic.cpp | 42 +++++++++++++++ src/tools/boost/boostbasic.h | 72 +++++++++++++++++++++++++ src/tools/boost/boostc.cpp | 42 +++++++++++++++ src/tools/boost/boostc.h | 72 +++++++++++++++++++++++++ src/tools/boost/boostc_compile.cpp | 56 ++++++++++++++++++++ src/tools/boost/boostc_compile.h | 46 ++++++++++++++++ src/tools/boost/boostcpp.cpp | 43 +++++++++++++++ src/tools/boost/boostcpp.h | 71 +++++++++++++++++++++++++ src/tools/boost/gui/Makefile.am | 6 +++ src/tools/boost/gui/boost_ui.cpp | 19 +++++++ src/tools/boost/gui/boost_ui.h | 35 +++++++++++++ 18 files changed, 840 insertions(+) create mode 100644 src/tools/boost/Makefile.am create mode 100644 src/tools/boost/boost.cpp create mode 100644 src/tools/boost/boost.h create mode 100644 src/tools/boost/boost_config.cpp create mode 100644 src/tools/boost/boost_config.h create mode 100644 src/tools/boost/boost_generator.cpp create mode 100644 src/tools/boost/boost_generator.h create mode 100644 src/tools/boost/boostbasic.cpp create mode 100644 src/tools/boost/boostbasic.h create mode 100644 src/tools/boost/boostc.cpp create mode 100644 src/tools/boost/boostc.h create mode 100644 src/tools/boost/boostc_compile.cpp create mode 100644 src/tools/boost/boostc_compile.h create mode 100644 src/tools/boost/boostcpp.cpp create mode 100644 src/tools/boost/boostcpp.h create mode 100644 src/tools/boost/gui/Makefile.am create mode 100644 src/tools/boost/gui/boost_ui.cpp create mode 100644 src/tools/boost/gui/boost_ui.h (limited to 'src/tools/boost') diff --git a/src/tools/boost/Makefile.am b/src/tools/boost/Makefile.am new file mode 100644 index 0000000..725e078 --- /dev/null +++ b/src/tools/boost/Makefile.am @@ -0,0 +1,9 @@ +INCLUDES = -I$(top_srcdir)/src $(all_includes) +METASOURCES = AUTO + +noinst_LTLIBRARIES = libboost.la +libboost_la_SOURCES = boostc.cpp boostc_compile.cpp boost_config.cpp \ + boost.cpp boostcpp.cpp boostbasic.cpp boost_generator.cpp +libboost_la_LDFLAGS = $(all_libraries) + +SUBDIRS = gui \ No newline at end of file diff --git a/src/tools/boost/boost.cpp b/src/tools/boost/boost.cpp new file mode 100644 index 0000000..86e304c --- /dev/null +++ b/src/tools/boost/boost.cpp @@ -0,0 +1,102 @@ +/*************************************************************************** + * Copyright (C) 2006 Nicolas Hadacek * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#include "boost.h" + +#include "boostc_compile.h" +#include "boost_config.h" +#include "devices/pic/pic/pic_memory.h" +#include "devices/list/device_list.h" +#include "devices/base/device_group.h" + +//---------------------------------------------------------------------------- +bool Boost::Linker::checkExecutableResult(bool, QStringList &lines) const +{ + return ( lines.count()>0 && lines[0].startsWith("BoostLink ") ); +} + +PURL::Directory Boost::Linker::checkExecutableWorkingDirectory() const +{ + return static_cast(_group)->checkExecutableUrl().directory(); +} + +QStringList Boost::Linker16::checkExecutableOptions(bool) const +{ + // #### otherwise may stall... + QStringList args; + args += "-t PIC16F873"; + args += static_cast(_group)->checkExecutableUrl().toExtension("obj").filename(); + return args; +} + +QStringList Boost::Linker18::checkExecutableOptions(bool) const +{ + // #### otherwise may stall... + QStringList args; + args += "-t PIC18F452"; + args += static_cast(_group)->checkExecutableUrl().toExtension("obj").filename(); + return args; +} + +//---------------------------------------------------------------------------- +QStringList Boost::Compiler::checkExecutableOptions(bool) const +{ + // #### otherwise may stall... + return static_cast(_group)->checkExecutableUrl().filename(); +} + +PURL::Directory Boost::Compiler::checkExecutableWorkingDirectory() const +{ + return static_cast(_group)->checkExecutableUrl().directory(); +} + +//---------------------------------------------------------------------------- +Boost::Group::Group(const QString &extension, const QString &text) + : _checkExecTmp(_sview, extension) +{ + if ( _checkExecTmp.openForWrite() ) _checkExecTmp.appendText(text); + _checkExecTmp.close(); +} + +QString Boost::Group::comment() const +{ + return i18n("The Boost toolchain needs to be run by Wine with \"Windows NT 4.0\" compatibility. This can be configured with the Wine configuration utility."); +} + +PURL::Directory Boost::Group::autodetectDirectory(Compile::DirectoryType type, const PURL::Directory &execDir, bool) const +{ + if ( type==Compile::DirectoryType::Library ) return execDir.path() + "Lib"; + return PURL::Directory(); +} + +Compile::Process *Boost::Group::processFactory(const Compile::Data &data) const +{ + switch (data.category.type()) { + case Tool::Category::Compiler: return new Boost::CompileFile; + case Tool::Category::Linker: return new Boost::Link; + default: break; + } + Q_ASSERT(false); + return 0; +} + +Compile::Config *Boost::Group::configFactory(::Project *project) const +{ + return new Boost::Config(project); +} + +QValueList Boost::Group::getSupportedDevices(const QString &) const +{ + QValueList list; + QValueVector devices = Device::lister().group("pic")->supportedDevices(); + for (uint i=0; i(data)->architecture()) ) list.append(data); + } + return list; +} diff --git a/src/tools/boost/boost.h b/src/tools/boost/boost.h new file mode 100644 index 0000000..d6142c9 --- /dev/null +++ b/src/tools/boost/boost.h @@ -0,0 +1,74 @@ +/*************************************************************************** + * Copyright (C) 2006 Nicolas Hadacek * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#ifndef BOOST_H +#define BOOST_H + +#include "tools/base/tool_group.h" +#include "common/gui/pfile_ext.h" +#include "devices/pic/base/pic.h" + +namespace Boost +{ +//---------------------------------------------------------------------------- +class Linker : public Tool::Base +{ +private: + virtual QString baseExecutable(bool, Tool::OutputExecutableType) const { return "boostlink.pic.exe"; } + virtual bool checkExecutableResult(bool withWine, QStringList &lines) const; + virtual PURL::Directory checkExecutableWorkingDirectory() const; +}; + +class Linker16 : public Linker +{ +private: + virtual QStringList checkExecutableOptions(bool withWine) const; +}; + +class Linker18 : public Linker +{ +private: + virtual QStringList checkExecutableOptions(bool withWine) const; +}; + +//---------------------------------------------------------------------------- +class Compiler : public Tool::Base +{ +private: + virtual QStringList checkExecutableOptions(bool withWine) const; + virtual PURL::Directory checkExecutableWorkingDirectory() const; +}; + +//---------------------------------------------------------------------------- +class Group : public Tool::Group +{ +public: + Group(const QString &extension, const QString &text); + PURL::Url checkExecutableUrl() const { return _checkExecTmp.url(); } + virtual QString comment() const; + virtual Tool::Category checkDevicesCategory() const { return Tool::Category::Nb_Types; } + virtual Tool::ExecutableType preferedExecutableType() const { return Tool::ExecutableType::Windows; } + virtual Tool::CompileType compileType() const { return Tool::SeparateFiles; } + virtual bool hasDirectory(Compile::DirectoryType type) const { return type==Compile::DirectoryType::Library; } + virtual PURL::Directory autodetectDirectory(Compile::DirectoryType type, const PURL::Directory &execDir, bool withWine) const; + +protected: + virtual bool supportedArchitecture(Pic::Architecture architecture) const = 0; + +private: + Log::StringView _sview; + PURL::TempFile _checkExecTmp; + + virtual QValueList getSupportedDevices(const QString &s) const; + virtual Compile::Process *processFactory(const Compile::Data &data) const; + virtual Compile::Config *configFactory(::Project *project) const; +}; + +} // namespace + +#endif diff --git a/src/tools/boost/boost_config.cpp b/src/tools/boost/boost_config.cpp new file mode 100644 index 0000000..b64f0af --- /dev/null +++ b/src/tools/boost/boost_config.cpp @@ -0,0 +1,9 @@ +/*************************************************************************** + * Copyright (C) 2006 Nicolas Hadacek * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#include "boost_config.h" diff --git a/src/tools/boost/boost_config.h b/src/tools/boost/boost_config.h new file mode 100644 index 0000000..c8b540e --- /dev/null +++ b/src/tools/boost/boost_config.h @@ -0,0 +1,24 @@ +/*************************************************************************** + * Copyright (C) 2006 Nicolas Hadacek * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#ifndef BOOST_CONFIG_H +#define BOOST_CONFIG_H + +#include "tools/list/compile_config.h" + +namespace Boost +{ +class Config : public Compile::Config +{ +public: + Config(Project *project) : Compile::Config(project) {} +}; + +} // namespace + +#endif diff --git a/src/tools/boost/boost_generator.cpp b/src/tools/boost/boost_generator.cpp new file mode 100644 index 0000000..2fa1393 --- /dev/null +++ b/src/tools/boost/boost_generator.cpp @@ -0,0 +1,81 @@ +/*************************************************************************** + * Copyright (C) 2007 Nicolas Hadacek * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#include "boost_generator.h" + +#include "devices/pic/pic/pic_memory.h" + +//--------------------------------------------------------------------------- +SourceLine::List Boost::CSourceGenerator::configLines(PURL::ToolType, const Device::Memory &memory, bool &ok) const +{ + const Pic::Memory &pmemory = static_cast(memory); + const Pic::Data &data = pmemory.device(); + const Pic::Config &config = data.config(); + SourceLine::List lines; + Address address = data.range(Pic::MemoryRangeType::Config).start; + for (uint i=0; i"); + return lines; +} + +SourceLine::List Boost::CSourceGenerator::sourceFileContent(PURL::ToolType, const Device::Data &, bool &) const +{ + SourceLine::List lines; + lines.appendTitle(i18n("interrupt service routine")); + lines.appendNotIndentedCode("void interrupt(void) {"); + lines.appendIndentedCode(QString::null, "<< " + i18n("insert interrupt code") + " >>"); + lines.appendNotIndentedCode("}"); + lines.appendEmpty(); + lines.appendTitle(i18n("main program")); + lines.appendNotIndentedCode("void main() {"); + lines.appendIndentedCode(QString::null, "<< " + i18n("insert code") + " >>"); + lines.appendNotIndentedCode("}"); + return lines; +} + +//--------------------------------------------------------------------------- +SourceLine::List Boost::BasicSourceGenerator::configLines(PURL::ToolType, const Device::Memory &, bool &ok) const +{ + // config bits ? + ok = false; + return SourceLine::List(); +} + +SourceLine::List Boost::BasicSourceGenerator::includeLines(PURL::ToolType, const Device::Data &) const +{ + return SourceLine::List(); +} + +SourceLine::List Boost::BasicSourceGenerator::sourceFileContent(PURL::ToolType, const Device::Data &, bool &ok) const +{ + SourceLine::List lines; + ok = true; + lines.appendTitle(i18n("main program")); + lines.appendNotIndentedCode("Sub main()"); + lines.appendIndentedCode(QString::null, "<< " + i18n("insert code") + " >>"); + lines.appendIndentedCode("Do while 1", i18n("loop forever")); + lines.appendIndentedCode("Loop"); + lines.appendNotIndentedCode("End Sub"); + return lines; +} diff --git a/src/tools/boost/boost_generator.h b/src/tools/boost/boost_generator.h new file mode 100644 index 0000000..0986ee1 --- /dev/null +++ b/src/tools/boost/boost_generator.h @@ -0,0 +1,37 @@ +/*************************************************************************** + * Copyright (C) 2007 Nicolas Hadacek * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#ifndef BOOST_GENERATOR_H +#define BOOST_GENERATOR_H + +#include "tools/base/tool_group.h" + +namespace Boost +{ + +//--------------------------------------------------------------------------- +class CSourceGenerator : public Tool::SourceGenerator +{ +public: + virtual SourceLine::List configLines(PURL::ToolType type, const Device::Memory &memory, bool &ok) const; + virtual SourceLine::List sourceFileContent(PURL::ToolType type, const Device::Data &data, bool &ok) const; + virtual SourceLine::List includeLines(PURL::ToolType type, const Device::Data &data) const; +}; + +//--------------------------------------------------------------------------- +class BasicSourceGenerator : public Tool::SourceGenerator +{ +public: + virtual SourceLine::List configLines(PURL::ToolType type, const Device::Memory &memory, bool &ok) const; + virtual SourceLine::List sourceFileContent(PURL::ToolType type, const Device::Data &data, bool &ok) const; + virtual SourceLine::List includeLines(PURL::ToolType type, const Device::Data &data) const; +}; + +} // namespace + +#endif diff --git a/src/tools/boost/boostbasic.cpp b/src/tools/boost/boostbasic.cpp new file mode 100644 index 0000000..9983874 --- /dev/null +++ b/src/tools/boost/boostbasic.cpp @@ -0,0 +1,42 @@ +/*************************************************************************** + * Copyright (C) 2006 Nicolas Hadacek * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#include "boostbasic.h" + +#include "boost_generator.h" + +//---------------------------------------------------------------------------- +bool Boost::CompilerBasic::checkExecutableResult(bool, QStringList &lines) const +{ + return ( lines.count()>0 && lines[0].startsWith("BoostBasic ") ); +} + +//---------------------------------------------------------------------------- +QString Boost::GroupBasic::informationText() const +{ + return i18n("BoostBasic Compiler is a Basic compiler distributed by SourceBoost Technologies.").arg("http://www.sourceboost.com/Products/BoostBasic/Overview.html"); +} + +Tool::SourceGenerator *Boost::GroupBasic::sourceGeneratorFactory() const +{ + return new BasicSourceGenerator; +} + +Tool::Group::BaseData Boost::GroupBasic16::baseFactory(Tool::Category category) const +{ + if ( category==Tool::Category::Compiler ) return BaseData(new Boost::CompilerBasic16, Both); + if ( category==Tool::Category::Linker ) return BaseData(new Boost::Linker16, Both); + return BaseData(); +} + +Tool::Group::BaseData Boost::GroupBasic18::baseFactory(Tool::Category category) const +{ + if ( category==Tool::Category::Linker ) return BaseData(new Boost::Linker18, Both); + if ( category==Tool::Category::Compiler ) return BaseData(new Boost::CompilerBasic18, Both); + return BaseData(); +} diff --git a/src/tools/boost/boostbasic.h b/src/tools/boost/boostbasic.h new file mode 100644 index 0000000..5f3b820 --- /dev/null +++ b/src/tools/boost/boostbasic.h @@ -0,0 +1,72 @@ +/*************************************************************************** + * Copyright (C) 2006 Nicolas Hadacek * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#ifndef BOOSTBASIC_H +#define BOOSTBASIC_H + +#include "boost.h" + +namespace Boost +{ +//---------------------------------------------------------------------------- +class CompilerBasic : public Compiler +{ +private: + virtual bool checkExecutableResult(bool withWine, QStringList &lines) const; +}; + +class CompilerBasic16 : public CompilerBasic +{ +public: + virtual QString baseExecutable(bool, Tool::OutputExecutableType) const { return "boostbasic.pic16.exe"; } +}; + +class CompilerBasic18 : public CompilerBasic +{ +public: + virtual QString baseExecutable(bool, Tool::OutputExecutableType) const { return "boostbasic.pic18.exe"; } +}; + +//---------------------------------------------------------------------------- +class GroupBasic : public Group +{ +public: + GroupBasic() : Group(".bas", "Sub main()\nEnd Sub\n") {} + virtual QString informationText() const; + virtual PURL::FileType implementationType(PURL::ToolType type) const { return (type==PURL::ToolType::Compiler ? PURL::BasicSource : PURL::Nb_FileTypes); } + +private: + virtual Tool::SourceGenerator *sourceGeneratorFactory() const; +}; + +class GroupBasic16 : public GroupBasic +{ +public: + virtual QString name() const { return "boostbasic16"; } + virtual QString label() const { return i18n("BoostBasic Compiler for PIC16"); } + +private: + virtual BaseData baseFactory(Tool::Category) const; + virtual bool supportedArchitecture(Pic::Architecture architecture) const { return ( architecture==Pic::Architecture::P16X ); } +}; + +class GroupBasic18 : public GroupBasic +{ +public: + virtual QString name() const { return "boostbasic18"; } + virtual QString label() const { return i18n("BoostBasic Compiler for PIC18"); } + +private: + virtual BaseData baseFactory(Tool::Category) const; + virtual bool supportedArchitecture(Pic::Architecture architecture) const + { return ( architecture==Pic::Architecture::P18C || architecture==Pic::Architecture::P18F || architecture==Pic::Architecture::P18J ); } +}; + +} // namespace + +#endif diff --git a/src/tools/boost/boostc.cpp b/src/tools/boost/boostc.cpp new file mode 100644 index 0000000..9a6ada9 --- /dev/null +++ b/src/tools/boost/boostc.cpp @@ -0,0 +1,42 @@ +/*************************************************************************** + * Copyright (C) 2006 Nicolas Hadacek * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#include "boostc.h" + +#include "boost_generator.h" + +//---------------------------------------------------------------------------- +bool Boost::CompilerC::checkExecutableResult(bool, QStringList &lines) const +{ + return ( lines.count()>0 && lines[0].startsWith("BoostC ") ); +} + +//---------------------------------------------------------------------------- +QString Boost::GroupC::informationText() const +{ + return i18n("BoostC Compiler is a C compiler distributed by SourceBoost Technologies.").arg("http://www.sourceboost.com/Products/BoostC/Overview.html"); +} + +Tool::SourceGenerator *Boost::GroupC::sourceGeneratorFactory() const +{ + return new CSourceGenerator; +} + +Tool::Group::BaseData Boost::GroupC16::baseFactory(Tool::Category category) const +{ + if ( category==Tool::Category::Compiler ) return BaseData(new Boost::CompilerC16, Both); + if ( category==Tool::Category::Linker ) return BaseData(new Boost::Linker16, Both); + return BaseData(); +} + +Tool::Group::BaseData Boost::GroupC18::baseFactory(Tool::Category category) const +{ + if ( category==Tool::Category::Compiler ) return BaseData(new Boost::CompilerC18, Both); + if ( category==Tool::Category::Linker ) return BaseData(new Boost::Linker18, Both); + return BaseData(); +} diff --git a/src/tools/boost/boostc.h b/src/tools/boost/boostc.h new file mode 100644 index 0000000..5191560 --- /dev/null +++ b/src/tools/boost/boostc.h @@ -0,0 +1,72 @@ +/*************************************************************************** + * Copyright (C) 2006 Nicolas Hadacek * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#ifndef BOOSTC_H +#define BOOSTC_H + +#include "boost.h" + +namespace Boost +{ +//---------------------------------------------------------------------------- +class CompilerC : public Compiler +{ +private: + virtual bool checkExecutableResult(bool withWine, QStringList &lines) const; +}; + +class CompilerC16 : public CompilerC +{ +public: + virtual QString baseExecutable(bool, Tool::OutputExecutableType) const { return "boostc.pic16.exe"; } +}; + +class CompilerC18 : public CompilerC +{ +public: + virtual QString baseExecutable(bool, Tool::OutputExecutableType) const { return "boostc.pic18.exe"; } +}; + +//---------------------------------------------------------------------------- +class GroupC : public Group +{ +public: + GroupC() : Group(".c", "void main(void) {}\n") {} + virtual QString informationText() const; + virtual PURL::FileType implementationType(PURL::ToolType type) const { return (type==PURL::ToolType::Compiler ? PURL::CSource : PURL::Nb_FileTypes); } + +private: + virtual Tool::SourceGenerator *sourceGeneratorFactory() const; +}; + +class GroupC16 : public GroupC +{ +public: + virtual QString name() const { return "boostc16"; } + virtual QString label() const { return i18n("BoostC Compiler for PIC16"); } + +private: + virtual BaseData baseFactory(Tool::Category) const; + virtual bool supportedArchitecture(Pic::Architecture architecture) const { return ( architecture==Pic::Architecture::P16X ); } +}; + +class GroupC18 : public GroupC +{ +public: + virtual QString name() const { return "boostc18"; } + virtual QString label() const { return i18n("BoostC Compiler for PIC18"); } + +private: + virtual BaseData baseFactory(Tool::Category) const; + virtual bool supportedArchitecture(Pic::Architecture architecture) const + { return ( architecture==Pic::Architecture::P18C || architecture==Pic::Architecture::P18F || architecture==Pic::Architecture::P18J ); } +}; + +} // namespace + +#endif diff --git a/src/tools/boost/boostc_compile.cpp b/src/tools/boost/boostc_compile.cpp new file mode 100644 index 0000000..2298361 --- /dev/null +++ b/src/tools/boost/boostc_compile.cpp @@ -0,0 +1,56 @@ +/*************************************************************************** + * Copyright (C) 2006 Nicolas Hadacek * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#include "boostc_compile.h" + +#include "boost_config.h" + +//---------------------------------------------------------------------------- +void Boost::Process::logStderrLine(const QString &line) +{ + if ( parseErrorLine(line, Compile::ParseErrorData("(.*)\\((\\d+).*\\): (error|warning):(.*)", 1, 2, 4, 3)) ) return; + doLog(Log::LineType::Normal, line, QString::null, 0); +} + +//---------------------------------------------------------------------------- +QStringList Boost::CompileFile::genericArguments(const Compile::Config &config) const +{ + QStringList args; + args += "-t %DEVICE"; + args += "-i"; + args += config.includeDirs(Tool::Category::Compiler, "-I", QString::null, ";"); + args += config.customOptions(Tool::Category::Compiler); + args += "%I"; + return args; +} + +QString Boost::CompileFile::outputFiles() const +{ + return "obj"; +} + +//---------------------------------------------------------------------------- +QStringList Boost::Link::genericArguments(const Compile::Config &config) const +{ + QStringList args; + args += "-t %DEVICE"; + args += "-p"; + args += "%PROJECT"; + args += config.includeDirs(Tool::Category::Linker, "-ld%SEP"); + PURL::Directory dir = Compile::Config::directory(group(), Compile::DirectoryType::Library); + if ( !dir.isEmpty() ) args += "-ld%SEP" + dir.path(); + args += config.customOptions(Tool::Category::Linker); + args += "%OBJS"; + return args; +} + +QString Boost::Link::outputFiles() const +{ + return "PURL::Lst PURL::Hex PURL::Coff PURL::AsmGPAsm stat tree casm"; +} + diff --git a/src/tools/boost/boostc_compile.h b/src/tools/boost/boostc_compile.h new file mode 100644 index 0000000..5c3696a --- /dev/null +++ b/src/tools/boost/boostc_compile.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * Copyright (C) 2006 Nicolas Hadacek * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#ifndef BOOSTC_COMPILE_H +#define BOOSTC_COMPILE_H + +#include "tools/list/compile_process.h" + +namespace Boost +{ +//---------------------------------------------------------------------------- +class Process : public Compile::Process +{ +Q_OBJECT +protected: + virtual QString deviceName() const { return "PIC" + _data.device; } + virtual void logStderrLine(const QString &line); +}; + +//---------------------------------------------------------------------------- +class CompileFile : public Process +{ +Q_OBJECT +protected: + virtual QStringList genericArguments(const Compile::Config &config) const; + virtual QString outputFiles() const; +}; + +//---------------------------------------------------------------------------- +class Link : public Process +{ +Q_OBJECT +protected: + virtual QString objectExtension() const { return "obj"; } + virtual QStringList genericArguments(const Compile::Config &config) const; + virtual QString outputFiles() const; +}; + +} // namespace + +#endif diff --git a/src/tools/boost/boostcpp.cpp b/src/tools/boost/boostcpp.cpp new file mode 100644 index 0000000..8991de7 --- /dev/null +++ b/src/tools/boost/boostcpp.cpp @@ -0,0 +1,43 @@ +/*************************************************************************** + * Copyright (C) 2006 Nicolas Hadacek * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#include "boostcpp.h" + +#include "boostc.h" +#include "boost_generator.h" + +//---------------------------------------------------------------------------- +bool Boost::CompilerCpp::checkExecutableResult(bool, QStringList &lines) const +{ + return ( lines.count()>0 && lines[0].startsWith("BoostC++ ") ); +} + +//---------------------------------------------------------------------------- +QString Boost::GroupCpp::informationText() const +{ + return i18n("BoostC++ Compiler is a C compiler distributed by SourceBoost Technologies.").arg("http://www.sourceboost.com/Products/BoostCpp/Overview.html"); +} + +Tool::SourceGenerator *Boost::GroupCpp::sourceGeneratorFactory() const +{ + return new CSourceGenerator; +} + +Tool::Group::BaseData Boost::GroupCpp16::baseFactory(Tool::Category category) const +{ + if ( category==Tool::Category::Compiler ) return BaseData(new Boost::CompilerCpp16, Both); + if ( category==Tool::Category::Linker ) return BaseData(new Boost::Linker16, Both); + return BaseData(); +} + +Tool::Group::BaseData Boost::GroupCpp18::baseFactory(Tool::Category category) const +{ + if ( category==Tool::Category::Compiler ) return BaseData(new Boost::CompilerCpp18, Both); + if ( category==Tool::Category::Linker ) return BaseData(new Boost::Linker18, Both); + return BaseData(); +} diff --git a/src/tools/boost/boostcpp.h b/src/tools/boost/boostcpp.h new file mode 100644 index 0000000..bf5e2ee --- /dev/null +++ b/src/tools/boost/boostcpp.h @@ -0,0 +1,71 @@ +/*************************************************************************** + * Copyright (C) 2006 Nicolas Hadacek * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#ifndef BOOSTCPP_H +#define BOOSTCPP_H + +#include "boost.h" + +namespace Boost +{ +//---------------------------------------------------------------------------- +class CompilerCpp : public Compiler +{ +private: + virtual bool checkExecutableResult(bool withWine, QStringList &lines) const; +}; + +class CompilerCpp16 : public CompilerCpp +{ +public: + virtual QString baseExecutable(bool, Tool::OutputExecutableType) const { return "boostc++.pic16.exe"; } +}; + +class CompilerCpp18 : public CompilerCpp +{ +public: + virtual QString baseExecutable(bool, Tool::OutputExecutableType) const { return "boostc++.pic18.exe"; } +}; + +//---------------------------------------------------------------------------- +class GroupCpp : public Group +{ +public: + GroupCpp() : Group(".cpp", "void main(void) {}\n") {} + virtual QString informationText() const; + virtual PURL::FileType implementationType(PURL::ToolType type) const { return (type==PURL::ToolType::Compiler ? PURL::CppSource : PURL::Nb_FileTypes); } + +private: + virtual Tool::SourceGenerator *sourceGeneratorFactory() const; +}; + +class GroupCpp16 : public GroupCpp +{ +public: + virtual QString name() const { return "boostc++16"; } + virtual QString label() const { return i18n("BoostC++ Compiler for PIC16"); } + +private: + virtual BaseData baseFactory(Tool::Category) const; + virtual bool supportedArchitecture(Pic::Architecture architecture) const { return ( architecture==Pic::Architecture::P16X ); } +}; + +class GroupCpp18 : public GroupCpp +{ +public: + virtual QString name() const { return "boostc++18"; } + virtual QString label() const { return i18n("BoostC++ Compiler for PIC18"); } + +private: + virtual BaseData baseFactory(Tool::Category) const; + virtual bool supportedArchitecture(Pic::Architecture architecture) const + { return ( architecture==Pic::Architecture::P18C || architecture==Pic::Architecture::P18F || architecture==Pic::Architecture::P18J ); } +}; +} // namespace + +#endif diff --git a/src/tools/boost/gui/Makefile.am b/src/tools/boost/gui/Makefile.am new file mode 100644 index 0000000..94fda00 --- /dev/null +++ b/src/tools/boost/gui/Makefile.am @@ -0,0 +1,6 @@ +INCLUDES = -I$(top_srcdir)/src $(all_includes) +METASOURCES = AUTO + +noinst_LTLIBRARIES = libboostui.la +libboostui_la_SOURCES = boost_ui.cpp +libboostui_la_LDFLAGS = $(all_libraries) diff --git a/src/tools/boost/gui/boost_ui.cpp b/src/tools/boost/gui/boost_ui.cpp new file mode 100644 index 0000000..2357165 --- /dev/null +++ b/src/tools/boost/gui/boost_ui.cpp @@ -0,0 +1,19 @@ +/*************************************************************************** + * Copyright (C) 2006 Nicolas Hadacek * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#include "boost_ui.h" + +//---------------------------------------------------------------------------- +Boost::ConfigWidget::ConfigWidget(Project *project) + : ToolConfigWidget(project) +{} + +void Boost::ConfigWidget::initEntries() +{ + createIncludeDirectoriesEntry(); +} diff --git a/src/tools/boost/gui/boost_ui.h b/src/tools/boost/gui/boost_ui.h new file mode 100644 index 0000000..6cafcf6 --- /dev/null +++ b/src/tools/boost/gui/boost_ui.h @@ -0,0 +1,35 @@ +/*************************************************************************** + * Copyright (C) 2006 Nicolas Hadacek * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#ifndef BOOST_UI_H +#define BOOST_UI_H + +#include "tools/gui/tool_config_widget.h" +#include "tools/gui/tool_group_ui.h" + +namespace Boost +{ +//---------------------------------------------------------------------------- +class ConfigWidget : public ToolConfigWidget +{ +Q_OBJECT +public: + ConfigWidget(Project *project); + virtual void initEntries(); +}; + +//---------------------------------------------------------------------------- +class GroupUI : public Tool::GroupUI +{ +public: + virtual ToolConfigWidget *configWidgetFactory(Tool::Category, ::Project *project) const { return new ConfigWidget(project); } +}; + +} // namespace + +#endif -- cgit v1.2.1