Massive Makefile clean up!
- "make all" builds all combinations of configurations - Binaries are built to "bin" - (For convenience, the release interpreter also goes in the top level dir) - Libraries are built to "lib" This will also make it easier to support building and testing other configurations like Nan tagging versus union, computed goto, etc.
This commit is contained in:
+2
-2
@@ -56,7 +56,7 @@ static char* readModule(WrenVM* vm, const char* module)
|
||||
size_t rootLength = strlen(rootDirectory);
|
||||
size_t moduleLength = strlen(module);
|
||||
size_t pathLength = rootLength + moduleLength + 5;
|
||||
char* path = malloc(pathLength + 1);
|
||||
char* path = (char*)malloc(pathLength + 1);
|
||||
memcpy(path, rootDirectory, rootLength);
|
||||
memcpy(path + rootLength, module, moduleLength);
|
||||
memcpy(path + rootLength + moduleLength, ".wren", 5);
|
||||
@@ -107,7 +107,7 @@ static int runFile(WrenVM* vm, const char* path)
|
||||
// Use the directory where the file is as the root to resolve imports
|
||||
// relative to.
|
||||
char* lastSlash = strrchr(path, '/');
|
||||
rootDirectory = malloc(lastSlash - path + 2);
|
||||
rootDirectory = (char*)malloc(lastSlash - path + 2);
|
||||
memcpy(rootDirectory, path, lastSlash - path + 1);
|
||||
rootDirectory[lastSlash - path + 1] = '\0';
|
||||
|
||||
|
||||
+3
-3
@@ -1208,7 +1208,7 @@ WrenInterpretResult wrenInterpret(WrenVM* vm, const char* sourcePath,
|
||||
const char* source)
|
||||
{
|
||||
if (strlen(sourcePath) == 0) return loadIntoCore(vm, source);
|
||||
|
||||
|
||||
// TODO: Better module name.
|
||||
Value name = wrenNewString(vm, "main", 4);
|
||||
wrenPushRoot(vm, AS_OBJ(name));
|
||||
@@ -1345,7 +1345,7 @@ static void defineMethod(WrenVM* vm, const char* className,
|
||||
|
||||
// TODO: Need to be able to define methods in classes outside the core
|
||||
// module.
|
||||
|
||||
|
||||
// Find or create the class to bind the method to.
|
||||
ObjModule* coreModule = getCoreModule(vm);
|
||||
int classSymbol = wrenSymbolTableFind(&coreModule->variableNames,
|
||||
@@ -1460,7 +1460,7 @@ void wrenReturnString(WrenVM* vm, const char* text, int length)
|
||||
{
|
||||
ASSERT(vm->foreignCallSlot != NULL, "Must be in foreign call.");
|
||||
ASSERT(text != NULL, "String cannot be NULL.");
|
||||
|
||||
|
||||
size_t size = length;
|
||||
if (length == -1) size = strlen(text);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user