summaryrefslogtreecommitdiffstats
path: root/src/tools/picc/picc_compile.cpp
blob: 63fd1271ea24adb8a47fcd811639e43bc2f857e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/***************************************************************************
 *   Copyright (C) 2006 Nicolas Hadacek <hadacek@kde.org>                  *
 *                                                                         *
 *   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 "picc_compile.h"

#include "picc_config.h"

//-----------------------------------------------------------------------------
QStringList PICC::Process::genericArguments(const Compile::Config &) const
{
  QStringList args;
  args += "--ERRFORMAT";
  args += "--WARNFORMAT";
  args += "--MSGFORMAT";
  args += "--CHIP=%DEVICE";
  args += "--IDE=mplab";
  args += "-Q"; // suppress copyright message
  return args;
}

void PICC::Process::logStderrLine(const QString &line)
{
  // #### TODO
  doLog(Log::LineType::Normal, line, QString::null, 0);
}

//-----------------------------------------------------------------------------
QStringList PICC::CompileStandaloneFile::genericArguments(const Compile::Config &config) const
{
  QStringList args = Process::genericArguments(config);
  args += "-M%MAP";
  args += "-G%SYM";
  args += "--ASMLIST";
  args += config.includeDirs(Tool::Category::Compiler, "-I");
  args += config.customOptions(Tool::Category::Compiler);
  args += "%I";
  return args;
}

QString PICC::CompileStandaloneFile::outputFiles() const
{
  return "PURL::Lst PURL::Map obj PURL::Hex PURL::Coff sym sdb hxl rlf";
}

//-----------------------------------------------------------------------------
QStringList PICC::CompileProjectFile::genericArguments(const Compile::Config &config) const
{
  QStringList args = Process::genericArguments(config);
  args += "-S";
  args += config.includeDirs(Tool::Category::Compiler, "-I");
  args += config.customOptions(Tool::Category::Compiler);
  args += "%I";
  return args;
}

QString PICC::CompileProjectFile::outputFiles() const
{
  return "PURL::AsmPICC";
}

//-----------------------------------------------------------------------------
QStringList PICC::AssembleStandaloneFile::genericArguments(const Compile::Config &config) const
{
  QStringList args = Process::genericArguments(config);
  args += "-M%MAP";
  args += "-G%SYM";
  args += "--ASMLIST";
  args += config.includeDirs(Tool::Category::Assembler, "-I");
  args += config.customOptions(Tool::Category::Assembler);
  args += "%I";
  return args;
}

QString PICC::AssembleStandaloneFile::outputFiles() const
{
  return "PURL::Lst PURL::Map obj PURL::Hex sym sdb hxl rlf";
}

//-----------------------------------------------------------------------------
QStringList PICC::AssembleProjectFile::genericArguments(const Compile::Config &config) const
{
  QStringList args = Process::genericArguments(config);
  args += "-C";
  args += "--ASMLIST";
  args += config.includeDirs(Tool::Category::Assembler, "-I");
  args += config.customOptions(Tool::Category::Assembler);
  args += "%I";
  return args;
}

QString PICC::AssembleProjectFile::outputFiles() const
{
  return "obj PURL::Lst rlf";
}

//-----------------------------------------------------------------------------
QStringList PICC::LinkProject::genericArguments(const Compile::Config &config) const
{
  QStringList args = Process::genericArguments(config);
  args += "-O%O";
  args += "-M%MAP";
  args += "-G%SYM";
  if ( _data.linkType==Compile::Icd2Linking ) args += "--DEBUGGER=icd2";
  args += config.customOptions(Tool::Category::Linker);
  args += "%OBJS";
  args += "%LIBS";
  args += config.customLibraries(Tool::Category::Linker);
  return args;
}

QString PICC::LinkProject::outputFiles() const
{
  return "PURL::Map PURL::Hex PURL::Coff sym sdb hxl";
}

//-----------------------------------------------------------------------------
QStringList PICC::LibraryProject::genericArguments(const Compile::Config &config) const
{
  QStringList args;
  args += config.customOptions(Tool::Category::Librarian);
  args += "r";
  args += "%O";
  args += "%OBJS";
  args += "%LIBS";
  return args;
}

QString PICC::LibraryProject::outputFiles() const
{
  return "PURL::Library";
}