From 44802c6315efea991b77999a249524fe4f265478 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sun, 14 Apr 2024 12:23:31 +0800 Subject: [PATCH] windows installer: Template -> template - sdcc project compiler: compile source file in subfolders. --- RedPandaIDE/compiler/projectcompiler.cpp | 3 ++- RedPandaIDE/compiler/sdccprojectcompiler.cpp | 5 +++-- RedPandaIDE/systemconsts.h | 2 ++ platform/windows/installer-scripts/redpanda.nsi | 7 +++---- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/RedPandaIDE/compiler/projectcompiler.cpp b/RedPandaIDE/compiler/projectcompiler.cpp index 82277466..cb6dac1a 100644 --- a/RedPandaIDE/compiler/projectcompiler.cpp +++ b/RedPandaIDE/compiler/projectcompiler.cpp @@ -265,6 +265,7 @@ void ProjectCompiler::writeMakeDefines(QFile &file, bool &genModuleDef) writeln(file, "WINDRES = " + escapeArgumentForMakefileVariableValue(windres, true)); #endif writeln(file, "RM = " CLEAN_PROGRAM); + writeln(file, "CD = " CD_PROGRAM); // compiler flags writeln(file, "LIBS = " + escapeArgumentsForMakefileVariableValue(libraryArguments)); @@ -361,7 +362,7 @@ void ProjectCompiler::writeMakeClean(QFile &file) if (mProject->options().type == ProjectType::DynamicLib) { target +=" $(STATIC)"; } - writeln(file, QString("\t-$(RM) %1 > %2 2>&1").arg(target,NULL_FILE)); + writeln(file, QString("\t-$(RM) %1 >%2 2>%2 ").arg(target,NULL_FILE)); writeln(file); } diff --git a/RedPandaIDE/compiler/sdccprojectcompiler.cpp b/RedPandaIDE/compiler/sdccprojectcompiler.cpp index 28d4e661..8ef20a44 100644 --- a/RedPandaIDE/compiler/sdccprojectcompiler.cpp +++ b/RedPandaIDE/compiler/sdccprojectcompiler.cpp @@ -169,6 +169,7 @@ void SDCCProjectCompiler::writeMakeDefines(QFile &file) writeln(file, "BIN_ARG = " + escapeArgumentForMakefileVariableValue(executable, false)); writeln(file, "CFLAGS = $(INCS) " + escapeArgumentsForMakefileVariableValue(cCompileArguments)); writeln(file, "RM = " CLEAN_PROGRAM); + writeln(file, "CD = " CD_PROGRAM); writeln(file); } @@ -195,7 +196,7 @@ void SDCCProjectCompiler::writeMakeIncludes(QFile &file) void SDCCProjectCompiler::writeMakeClean(QFile &file) { writeln(file, "clean: clean-custom"); - writeln(file, QString("\t@-$(RM) $(CLEANOBJ) >%1 2>%1||:").arg(NULL_FILE)); + writeln(file, QString("\t-$(RM) $(CLEANOBJ) >%1 2>%1||:").arg(NULL_FILE)); writeln(file); } @@ -270,7 +271,7 @@ void SDCCProjectCompiler::writeMakeObjFilesRules(QFile &file) QString fullObjDir = includeTrailingPathDelimiter(mProject->options().folderForObjFiles); QString relativeObjDir = extractRelativePath(mProject->directory(),fullObjDir); QString objfile=extractRelativePath(generateAbsolutePath(mProject->directory(),relativeObjDir),unit->fileName()); - writeln(file, "\tpushd "+ localizePath(relativeObjDir)+" &&$(CC) $(CFLAGS) -c " + localizePath(objfile)); + writeln(file, "\t$(CD) "+ localizePath(relativeObjDir)+" && $(CC) $(CFLAGS) -c " + localizePath(objfile)); } } diff --git a/RedPandaIDE/systemconsts.h b/RedPandaIDE/systemconsts.h index d078acb5..e6225932 100644 --- a/RedPandaIDE/systemconsts.h +++ b/RedPandaIDE/systemconsts.h @@ -30,6 +30,7 @@ #define MAKE_PROGRAM "mingw32-make.exe" #define WINDRES_PROGRAM "windres.exe" #define CLEAN_PROGRAM "del /q /f" +#define CD_PROGRAM "cd /d" #define CPP_PROGRAM "cpp.exe" #define GIT_PROGRAM "git.exe" #define CLANG_PROGRAM "clang.exe" @@ -50,6 +51,7 @@ #define WINDRES_PROGRAM "" #define GPROF_PROGRAM "gprof" #define CLEAN_PROGRAM "rm -rf" +#define CD_PROGRAM "cd" #define CPP_PROGRAM "cpp" #define GIT_PROGRAM "git" #define CLANG_PROGRAM "clang" diff --git a/platform/windows/installer-scripts/redpanda.nsi b/platform/windows/installer-scripts/redpanda.nsi index d577385a..4bd4428d 100644 --- a/platform/windows/installer-scripts/redpanda.nsi +++ b/platform/windows/installer-scripts/redpanda.nsi @@ -131,8 +131,8 @@ Section "$(SectionMainName)" SectionMain !endif ; Write required paths - SetOutPath $INSTDIR\Templates - File /nonfatal /r "Templates\*" + SetOutPath $INSTDIR\templates + File /nonfatal /r "templates\*" SectionEnd @@ -440,8 +440,7 @@ Section "Uninstall" Delete "$INSTDIR\OpenConsole.exe" Delete "$INSTDIR\compiler_hint.lua" - RMDir /r "$INSTDIR\Lang" - RMDir /r "$INSTDIR\Templates" + RMDir /r "$INSTDIR\templates" RMDir /r "$INSTDIR\mingw32" RMDir /r "$INSTDIR\mingw64" RMDir /r "$INSTDIR\llvm-mingw"