{
char moduleName[MAX_LOCATION];
const char * name = archive + 1;
-#if defined(__ANDROID__)
+#if defined(__ANDROID__) || defined(__EMSCRIPTEN__)
if(!name[0])
name = ((SubModule)__thisModule.application.modules.first).next.module.name;
#endif
-
+#if defined(__EMSCRIPTEN__)
+ //sprintf(moduleName, "__%s.ear", name);
+ sprintf(moduleName, "__%s.ear", "HelloForm");
+ f = FileOpen(moduleName, read);
+#else
if(LocateModule(name, moduleName))
f = FileOpen(moduleName, read);
+#endif
}
else
f = FileOpen(archive, read);
return result;
}
- bool GenerateMakefile(const char * altMakefilePath, bool noResources, const char * includemkPath, ProjectConfig config, const char * ldCommand)
+ bool GenerateMakefile(const char * altMakefilePath, bool noResources, const char * includemkPath, ProjectConfig config, CompilerConfig compiler)
{
bool result = false;
char filePath[MAX_LOCATION];
char makeFile[MAX_LOCATION];
+ const char * ldCommand = compiler.ldCommand;
// PathBackup pathBackup { };
// char oldDirectory[MAX_LOCATION];
File f = null;
}
}
f.Puts("\n");
+ if(!strcmp(compiler.name, "em"))
+ f.Printf("EAR_TARGET = __%s.ear\n", fixedModuleName);
+ else
+ f.Printf("EAR_TARGET = $(TARGET)\n");
// Use something fixed here, to not cause Makefile differences across compilers...
varStringLenDiffs["$(OBJ)"] = 30; // strlen("obj/memoryGuard.android.gcc-4.6.2") - 6;
f.Puts("ifndef STATIC_LIBRARY_TARGET\n");
- f.Printf("\t$(%s) $(OFLAGS) @$(OBJ)objects.lst $(LIBS) -o $(TARGET) $(INSTALLNAME)\n", ldCommand && ldCommand[0] ? "LD" : containsCXX ? "CXX" : "CC");
+ f.Printf("\t$(%s) $(OFLAGS) @$(OBJ)objects.lst $(LIBS)%s -o $(TARGET) $(INSTALLNAME)\n",
+ ldCommand && ldCommand[0] ? "LD" : containsCXX ? "CXX" : "CC",
+ //strcmp(compiler.name, "em") == 0 ? " --preload-file __HelloForm.ear" : "");
+ strcmp(compiler.name, "em") == 0 ? " --embed-file __HelloForm.ear" : "");
if(!GetDebug(config))
{
f.Puts("ifndef NOSTRIP\n");
// $(EAR) aw%s --- /*quiet ? "q" : */""
if(count == 0)
- f.Printf("\t%s$(EAR) aw$(EARFLAGS) $(TARGET)", ts.a);
+ f.Printf("\t%s$(EAR) aw$(EARFLAGS) $(EAR_TARGET)", ts.a);
tempPath[0] = '\0';
if(eString_PathInsideOfMore(child.path, resourcesPath, tempPath))
//logBox.Logf("%s\n", makefileName);
logBox.Logf($"%s - %s%smakefile for %s config...\n", makefileName, reason, action, GetConfigName(config));
- if(!project.GenerateMakefile(null, false, null, config, compiler.ldCommand))
+ if(!project.GenerateMakefile(null, false, null, config, compiler))
ide.outputView.buildBox.Logf($"Error generating makefile (Is the project directory writable?)\n");
ide.statusBar.text = null;