|
|
@@ -1,8 +1,10 @@ |
|
|
|
//#bb ldlibs := -lpthread |
|
|
|
|
|
|
|
#include <getopt.h> |
|
|
|
#include <string.h> |
|
|
|
#include <iostream> |
|
|
|
#include <fstream> |
|
|
|
#include <sstream> |
|
|
|
|
|
|
|
#include "BBParser.h" |
|
|
|
#include "parallel.h" |
|
|
@@ -94,16 +96,21 @@ int main(int argc, char **argv) { |
|
|
|
sys::chdir(workDir); |
|
|
|
} |
|
|
|
|
|
|
|
// Read everything related to the build configuration, |
|
|
|
// finding all source files and reading their configs |
|
|
|
// Read non-option arguments (variable definitions and args) |
|
|
|
std::vector<std::string> args; |
|
|
|
BBVariables vars; |
|
|
|
while (optind < argc) { |
|
|
|
args.push_back(argv[optind++]); |
|
|
|
char *arg = argv[optind++]; |
|
|
|
char *eq = strchr(arg, '='); |
|
|
|
if (eq == nullptr) { |
|
|
|
args.push_back(arg); |
|
|
|
} else { |
|
|
|
std::stringstream ss(eq + 1); |
|
|
|
BBParser parser(ss, BBParser::FLAG_NONE); |
|
|
|
parser.parseList(vars, vars[std::string(arg, eq - arg)]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// TODO: Parse variables from CLI |
|
|
|
BBVariables vars; |
|
|
|
|
|
|
|
std::unique_ptr<DepNode> root = buildDepTree(outDir, vars); |
|
|
|
if (root == nullptr) { |
|
|
|
logger::log("No source files."); |