aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/build.l4
-rw-r--r--src/main.cpp9
-rw-r--r--src/viewermake.cpp62
-rw-r--r--src/viewermake.h28
4 files changed, 101 insertions, 2 deletions
diff --git a/src/build.l b/src/build.l
index 723991b..2b834a2 100644
--- a/src/build.l
+++ b/src/build.l
@@ -77,12 +77,12 @@ std::string strbuf;
77 77
78"#".* /* single line comment */ 78"#".* /* single line comment */
79 79
80[^ \t\r\n\'\":=,/][^ \t\r\n\'\":=,]* { 80[^ \t\r\n\'\":+=,/][^ \t\r\n\'\":+=,]* {
81 yylval->strval = stringdup( yytext ); 81 yylval->strval = stringdup( yytext );
82 return STRING; 82 return STRING;
83} 83}
84 84
85[^ \t\r\n\'\":=,/][^ \t\r\n\'\"=,]+[^ \t\r\n\'\":=,] { 85[^ \t\r\n\'\":+=,/][^ \t\r\n\'\"+=,]+[^ \t\r\n\'\":+=,] {
86 yylval->strval = stringdup( yytext ); 86 yylval->strval = stringdup( yytext );
87 return STRING; 87 return STRING;
88} 88}
diff --git a/src/main.cpp b/src/main.cpp
index 3ea4411..c1df482 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,6 +1,7 @@
1#include "builder.h" 1#include "builder.h"
2#include "viewerplain.h" 2#include "viewerplain.h"
3#include "viewerpercent.h" 3#include "viewerpercent.h"
4#include "viewermake.h"
4#include "paramproc.h" 5#include "paramproc.h"
5#include "staticstring.h" 6#include "staticstring.h"
6 7
@@ -17,6 +18,8 @@ public:
17 "Set the input script, default: build.conf"); 18 "Set the input script, default: build.conf");
18 addParam('p', mkproc(Param::procViewPercent), 19 addParam('p', mkproc(Param::procViewPercent),
19 "Switch to percent view."); 20 "Switch to percent view.");
21 addParam('m', mkproc(Param::procViewMake),
22 "Switch to 'make' style view.");
20 addParam("cache", &sCache, 23 addParam("cache", &sCache,
21 "Set an alternative cache file." ); 24 "Set an alternative cache file." );
22 addParam('d', &bDebug, 25 addParam('d', &bDebug,
@@ -48,6 +51,12 @@ public:
48 pViewer = new ViewerPercent; 51 pViewer = new ViewerPercent;
49 } 52 }
50 53
54 int procViewMake( int argc, char *argv[] )
55 {
56 delete pViewer;
57 pViewer = new ViewerMake;
58 }
59
51 std::string sCache; 60 std::string sCache;
52 std::string sFile; 61 std::string sFile;
53 StaticString sAction; 62 StaticString sAction;
diff --git a/src/viewermake.cpp b/src/viewermake.cpp
new file mode 100644
index 0000000..7f63552
--- /dev/null
+++ b/src/viewermake.cpp
@@ -0,0 +1,62 @@
1#include <stdio.h>
2#include "viewermake.h"
3#include "perform.h"
4
5ViewerMake::ViewerMake()
6{
7}
8
9ViewerMake::~ViewerMake()
10{
11}
12
13void ViewerMake::beginTarget( const char *sName, const char *sType, const char *sOperation, int nPerforms )
14{
15 //sAction = sName;
16 //bPrinted = false;
17}
18
19void ViewerMake::printHead()
20{
21 /*
22 if( bPrinted == false )
23 {
24 printf("--- %s ---\n", sAction.getString() );
25 bPrinted = true;
26 }*/
27}
28
29void ViewerMake::endTarget()
30{
31 /*if( bPrinted == true )
32 {
33 printf("\n");
34 }
35 else
36 {
37 printf("Nothing to be done for %s.\n", sAction.getString() );
38 }*/
39}
40
41void ViewerMake::beginPerform( Perform *pPerf )
42{
43 //sTarget = pPerf->getTarget();
44}
45
46void ViewerMake::beginExtraRequiresCheck( const char *sCommand )
47{
48 //printHead();
49 //printf(" check: %s\n", sTarget.getString() );
50}
51
52void ViewerMake::beginExecute()
53{
54 //printHead();
55 //printf(" build: %s\n", sTarget.getString() );
56}
57
58void ViewerMake::executeCmd( const char *sCmd )
59{
60 printf("%s\n", sCmd );
61}
62
diff --git a/src/viewermake.h b/src/viewermake.h
new file mode 100644
index 0000000..767d0bd
--- /dev/null
+++ b/src/viewermake.h
@@ -0,0 +1,28 @@
1#ifndef VIEWER_MAKE_H
2#define VIEWER_MAKE_H
3
4#include <stdint.h>
5
6#include "viewer.h"
7#include "staticstring.h"
8
9class ViewerMake : public Viewer
10{
11public:
12 ViewerMake();
13 virtual ~ViewerMake();
14
15 virtual void beginTarget( const char *sName, const char *sType, const char *sOperation, int nPerforms );
16 virtual void endTarget();
17
18 virtual void beginPerform( Perform *pPerf );
19 virtual void beginExtraRequiresCheck( const char *sCommand );
20 void printHead();
21 virtual void beginExecute();
22 virtual void executeCmd( const char *sCmd );
23
24private:
25
26};
27
28#endif