}
};
+ Button resourcesDotEar
+ {
+ this, text = $"Use resources.ear", position = { 300, 308 };
+ isCheckbox = true;
+
+ bool NotifyClicked(Button button, int x, int y, Modifiers mods)
+ {
+ CompilerConfig compiler = loadedCompiler;
+ if(compiler)
+ {
+ compiler.resourcesDotEar = button.checked;
+ modifiedDocument = true;
+ compilersTab.modifiedDocument = true;
+ }
+ return true;
+ }
+ };
+
CompilerOptionsTab()
{
Platform p;
linkerFlags.strings = compiler.linkerFlags;
objectFileExt.contents = compiler.objectFileExt;
outputFileExt.contents = compiler.outputFileExt;
+ resourcesDotEar.checked = compiler.resourcesDotEar;
labelTargetPlatform.disabled = disabled;
targetPlatform.disabled = disabled;
f.Puts("# TOOLCHAIN\n");
f.Puts("\n");
+ f.Puts("# OPTIONS\n");
+ if(compiler.resourcesDotEar)
+ f.Puts("USE_RESOURCES_EAR := defined\n");
+ f.Puts("\n");
+
f.Puts("# EXTENSIONS\n");
if(compiler.outputFileExt)
f.Printf("OUT := %s\n", compiler.outputFileExt);
resNode.GenMakefilePrintNode(f, this, resources, null, listItems, config, null);
OutputFileList(f, "RESOURCES", listItems, varStringLenDiffs, null);
+ f.Puts("ifdef USE_RESOURCES_EAR\n");
+ f.Puts("RESOURCES_EAR = $(OBJ)resources.ear\n");
+ f.Puts("else\n");
+ f.Puts("RESOURCES_EAR = $(RESOURCES)\n");
+ f.Puts("endif\n");
+ f.Puts("\n");
+
f.Puts("LIBS += $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)\n");
f.Puts("\n");
if((config && config.options && config.options.libraries) ||
f.Puts("\n");
}
+ if(resNode.files && resNode.files.count && !noResources)
+ {
+ f.Puts("ifdef USE_RESOURCES_EAR\n");
+ f.Puts("$(RESOURCES_EAR): $(RESOURCES) | objdir\n");
+ resNode.GenMakefileAddResources(f, resNode.path, config, "RESOURCES_EAR");
+ f.Puts("endif\n");
+ f.Puts("\n");
+ }
+
// *** Target ***
// This would not rebuild the target on updated objects
f.Puts("$(OBJECTS): | objdir\n");
// This alone was breaking the tarball, object directory does not get created first (order-only rules happen last it seems!)
- f.Printf("$(TARGET): $(SOURCES)%s $(RESOURCES) $(SYMBOLS) $(OBJECTS) | objdir%s\n",
+ f.Printf("$(TARGET): $(SOURCES)%s $(RESOURCES_EAR) $(SYMBOLS) $(OBJECTS) | objdir%s\n",
rcSourcesParts ? " $(RCSOURCES)" : "", sameOrRelObjTargetDirs ? "" : " targetdir");
f.Printf("\t@$(call rm,$(OBJ)objects.lst)\n");
}
}
if(resNode.files && resNode.files.count && !noResources)
- resNode.GenMakefileAddResources(f, resNode.path, config);
+ {
+ f.Puts("ifndef USE_RESOURCES_EAR\n");
+ resNode.GenMakefileAddResources(f, resNode.path, config, "TARGET");
+ f.Puts("endif\n");
+ }
f.Puts("else\n");
f.Puts("ifdef WINDOWS_HOST\n");
f.Puts("\t$(AR) rcs $(TARGET) @$(OBJ)objects.lst $(LIBS)\n");
OutputCleanActions(f, "IMPORTS", eCsourcesParts);
OutputCleanActions(f, "SYMBOLS", eCsourcesParts);
}
+ if(resNode.files && resNode.files.count && !noResources)
+ {
+ f.Puts("ifdef USE_RESOURCES_EAR\n");
+ f.Printf("\t$(call rm,$(RESOURCES_EAR))\n");
+ f.Puts("endif\n");
+ }
f.Puts("\n");
f.Puts("realclean: cleantarget\n");
delete platforms;
}
- void GenMakefileAddResources(File f, String resourcesPath, ProjectConfig prjConfig)
+ void GenMakefileAddResources(File f, String resourcesPath, ProjectConfig prjConfig, const char * resourcesTarget)
{
int count = 0;
if(files)
// $(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) $(%s)", ts.a, resourcesTarget);
tempPath[0] = '\0';
if(eString_PathInsideOfMore(child.path, resourcesPath, tempPath))
for(child : files)
{
if(child.type == folder)
- child.GenMakefileAddResources(f, resourcesPath, prjConfig);
+ child.GenMakefileAddResources(f, resourcesPath, prjConfig, resourcesTarget);
}
}
}