]> git.tdb.fi Git - builder.git/blobdiff - source/builder.cpp
Support custom build info
[builder.git] / source / builder.cpp
index 2c137ca406841a1159269851f8177261504c91c9..7ba6be89a55fd03ccc5d570f4a325ff2c0b29300 100644 (file)
@@ -312,9 +312,16 @@ int Builder::create_targets()
                        const PathList &sources=j->get_sources();
                        for(PathList::const_iterator k=sources.begin(); k!=sources.end(); ++k)
                        {
-                               list<string> sfiles=list_files(*k);
-                               for(list<string>::iterator l=sfiles.begin(); l!=sfiles.end(); ++l)
-                                       files.push_back(*k / *l);
+                               struct stat st;
+                               stat(*k, st);
+                               if(S_ISDIR(st.st_mode))
+                               {
+                                       list<string> sfiles=list_files(*k);
+                                       for(list<string>::iterator l=sfiles.begin(); l!=sfiles.end(); ++l)
+                                               files.push_back(*k / *l);
+                               }
+                               else
+                                       files.push_back(*k);
                        }
 
                        bool build_exe=j->get_type()!=Component::HEADERS;
@@ -444,12 +451,8 @@ int Builder::build()
 
        vector<Action *> actions;
 
-       //ProgressBar  *progress=0;
        if(chrome)
-       {
-               //progress=new ProgressBar(cout, total);
                cout<<"0 targets built\n";
-       }
        unsigned count=0;
 
        bool fail=false;
@@ -462,12 +465,6 @@ int Builder::build()
                        Target *tgt=cmdline->get_buildable_target();
                        if(tgt)
                        {
-                               /*if(chrome)
-                               {
-                                       cout<<"\e["<<actions.size()+1<<'A';
-                                       //progress->set(count);
-                                       cout<<"\e["<<actions.size()+1<<'B';
-                               }*/
                                Action *action=tgt->build();
                                if(action)
                                        actions.push_back(action);
@@ -507,8 +504,6 @@ int Builder::build()
                }
        }
 
-       //delete progress;
-
        return fail?-1:0;
 }