slash_path = $(subst $(backslash),$(slash),$(1))
sys_path = $(subst $(backslash)$(backslash),$(slash),$(subst $(slash),$(backslash),$(1)))
quote_path = "$(call sys_path,$(call unescp_all,$(1)))"
+ each_path_quote = $(if $(findstring $(esc),$(path)),"$(call unescp_all,$(call shwspace,$(path)))",$(call unescp_all,$(path)))
+ sys_path_list = $(foreach path,$(1),$(each_path_quote))
else
psep := $(slash)
slash_path = $(1)
echo = $(if $(1),echo $(1))
touch = $(if $(1),@cmd /c "for %%I in ($(call sys_path,$(1))) do @(cd %%~pI && type nul >> %%~nxI && copy /by %%~nxI+,, > nul 2>&1 && cd %%cd%%)")
cpq = $(if $(1),@cmd /c "for %%I in ($(call sys_path,$(1))) do copy /by %%I $(call sys_path,$(2))" > nul 2>&1)
- rmq = $(if $(1),-del /f /q $(call sys_path,$(1)) > nul 2>&1)
+ rmq = $(if $(1),-del /f /q $(call sys_path,$(call sys_path_list,$(1))) > nul 2>&1)
rmrq = $(if $(1),-rmdir /q /s $(call sys_path,$(1)) > nul 2>&1)
mkdirq = $(if $(1),-mkdir $(call sys_path,$(1)) > nul 2>&1)
rmdirq = $(if $(1),-rmdir /q $(call sys_path,$(1)) > nul 2>&1)
{
int c;
for(c=0; c<parts; c++)
- f.Printf("\t$(call rmq,$(%s%d))\n", name, c+1);
+ f.Printf("\t$(call rmq,$(_%s%d))\n", name, c+1);
}
else
- f.Printf("\t$(call rmq,$(%s))\n", name);
+ f.Printf("\t$(call rmq,$(_%s))\n", name);
}
enum LineOutputMethod { inPlace, newLine, lineEach };
ide.outputView.buildBox.Logf($"Generating symbols...\n");
precompiling = true;
}
- // Changed escapeBackSlashes here to handle paths with spaces
- Tokenize(module, 1, tokens, (BackSlashEscaping)true); // fix #139
- GetLastDirectory(module, moduleName);
+ Tokenize(module, 1, tokens, forArgsPassing/*(BackSlashEscaping)true*/);
+ GetLastDirectory(tokens[0], moduleName);
ide.outputView.buildBox.Logf("%s\n", moduleName);
}
else if((module = strstr(line, " -o ")))
while(*dashF && *dashF == ' ') dashF++;
module = dashF;
}
- Tokenize(module, 1, tokens, (BackSlashEscaping)true); // fix #139
+ Tokenize(module, 1, tokens, forArgsPassing/*(BackSlashEscaping)true*/);
GetLastDirectory(module, moduleName);
ide.outputView.buildBox.Logf("%s\n", moduleName);
}
if(eCsourcesParts > 1)
{
int n;
+ f.Printf("_%s =", map[c][0]);
+ for(n = 1; n <= eCsourcesParts; n++)
+ f.Printf(" $(%s%d)", map[c][0], n);
+ f.Puts("\n");
+ for(n = 1; n <= eCsourcesParts; n++)
+ f.Printf("_%s%d = $(addprefix $(OBJ),$(patsubst %%.ec,%%$(%s),$(notdir $(_ECSOURCES%d))))\n", map[c][0], n, map[c][1], n);
+ }
+ else if(eCsourcesParts == 1)
+ f.Printf("_%s = $(addprefix $(OBJ),$(patsubst %%.ec,%%$(%s),$(notdir $(_ECSOURCES))))\n", map[c][0], map[c][1]);
+ f.Puts("\n");
+ }
+
+ for(c = 0; c < 5; c++)
+ {
+ if(eCsourcesParts > 1)
+ {
+ int n;
f.Printf("%s =", map[c][0]);
for(n = 1; n <= eCsourcesParts; n++)
f.Printf(" $(%s%d)", map[c][0], n);
f.Puts("\n");
for(n = 1; n <= eCsourcesParts; n++)
- f.Printf("%s%d = $(call shwspace,$(addprefix $(OBJ),$(patsubst %%.ec,%%$(%s),$(notdir $(_ECSOURCES%d)))))\n", map[c][0], n, map[c][1], n);
+ f.Printf("%s%d = $(call shwspace,$(_%s%d))\n", map[c][0], n, map[c][0], n);
}
else if(eCsourcesParts == 1)
- f.Printf("%s = $(call shwspace,$(addprefix $(OBJ),$(patsubst %%.ec,%%$(%s),$(notdir $(_ECSOURCES)))))\n", map[c][0], map[c][1]);
+ f.Printf("%s = $(call shwspace,$(_%s))\n", map[c][0], map[c][0]);
f.Puts("\n");
}
}
// Main Module (Linking) for ECERE C modules
f.Puts("$(OBJ)$(MODULE).main.ec: $(SYMBOLS) $(COBJECTS)\n");
// use of objDirExpNoSpaces used instead of $(OBJ) to prevent problematic joining of arguments in ecs
- f.Printf("\t$(ECS)%s $(ARCH_FLAGS) $(ECSLIBOPT) $(SYMBOLS) $(IMPORTS) -symbols %s -o $(call escspace,$@)\n",
+ f.Printf("\t$(ECS)%s $(ARCH_FLAGS) $(ECSLIBOPT) $(SYMBOLS) $(IMPORTS) -symbols %s -o $(call quote_path,$@)\n",
GetConsole(config) ? " -console" : "", objDirExpNoSpaces);
f.Puts("\n");
// Main Module (Linking) for ECERE C modules
f.Puts("\t$(ECP) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS)"
" -c $(OBJ)$(MODULE).main.ec -o $(OBJ)$(MODULE).main.sym -symbols $(OBJ)\n");
f.Puts("\t$(ECC) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY)"
- " -c $(OBJ)$(MODULE).main.ec -o $(call escspace,$@) -symbols $(OBJ)\n");
+ " -c $(OBJ)$(MODULE).main.ec -o $(call quote_path,$@) -symbols $(OBJ)\n");
f.Puts("\n");
}
f.Puts("clean: cleantarget\n");
f.Printf("\t$(call rmq,$(OBJ)linkobjects.lst)\n");
- OutputCleanActions(f, "_OBJECTS", objectsParts);
+ OutputCleanActions(f, "OBJECTS", objectsParts);
if(rcSourcesParts)
{
f.Puts("ifdef WINDOWS_TARGET\n");
{
#endif
f.Puts("$(OBJ)$(MODULE).main$(O): $(OBJ)$(MODULE).main.c\n");
- f.Printf("\t$(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c $(OBJ)$(MODULE).main.%s -o $(call escspace,$@)\n", extension);
+ f.Printf("\t$(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c $(OBJ)$(MODULE).main.%s -o $(call quote_path,$@)\n", extension);
f.Puts("\n");
#if 0
}
GenMakePrintNodeFlagsVariable(this, nodeECFlagsMapping, "ECFLAGS", f);
GenMakePrintNodeFlagsVariable(this, nodeCFlagsMapping, "PRJ_CFLAGS", f);
- f.Printf(" -c %s%s.%s -o $(call escspace,$@)\n",
+ f.Printf(" -c $(call quote_path,%s%s.%s) -o $(call quote_path,$@)\n",
modulePath, moduleName, extension);
if(ifCount) f.Puts("endif\n");
f.Puts("\n");
GenMakePrintNodeFlagsVariable(this, nodeCFlagsMapping, "PRJ_CFLAGS", f);
f.Puts(" $(FVISIBILITY)");
- f.Printf(" -c %s%s.%s -o $(call escspace,$@) -symbols $(OBJ)\n",
+ f.Printf(" -c $(call quote_path,%s%s.%s) -o $(call quote_path,$@) -symbols $(OBJ)\n",
modulePath, moduleName, extension);
if(ifCount) f.Puts("endif\n");
f.Puts("\n");
if(!strcmpi(extension, "cc") || !strcmpi(extension, "cpp") || !strcmpi(extension, "cxx"))
f.Printf("\t$(CXX)");
else if(!strcmpi(extension, "rc"))
- f.Printf("\t$(WINDRES) $(WINDRES_FLAGS) $< $(call escspace,$@)\n");
+ f.Printf("\t$(WINDRES) $(WINDRES_FLAGS) $< \"$(call escspace,$(call quote_path,$@))\"\n");
else
f.Printf("\t$(CC)");
GenMakePrintNodeFlagsVariable(this, nodeCFlagsMapping, "PRJ_CFLAGS", f);
if(!strcmpi(extension, "ec"))
- f.Printf(" $(FVISIBILITY) -c $(OBJ)%s.c -o $(call escspace,$@)\n", moduleName);
+ f.Printf(" $(FVISIBILITY) -c $(call quote_path,$(OBJ)%s.c) -o $(call quote_path,$@)\n", moduleName);
else
- f.Printf(" -c %s%s.%s -o $(call escspace,$@)\n",
+ f.Printf(" -c $(call quote_path,%s%s.%s) -o $(call quote_path,$@)\n",
modulePath, moduleName, !strcmpi(extension, "ec") ? "c" : extension);
}
if(ifCount) f.Puts("endif\n");
Map<String, String> headerToSource { [ { "eh", "ec" }, { "h", "c" }, { "hh", "cc" }, { "hpp", "cpp" }, { "hxx", "cxx" } ] };
GetExtension(name, extension);
- ReplaceSpaces(moduleName, name);
+ strcpy(moduleName, name);
StripExtension(moduleName);
info = namesInfo[moduleName];
collision = info ? info.IsExtensionColliding(extension) : false;