windows installer: Template -> template

- sdcc project compiler: compile source file in subfolders.
This commit is contained in:
Roy Qu 2024-04-14 12:23:31 +08:00
parent 697bdca255
commit 44802c6315
4 changed files with 10 additions and 7 deletions

View File

@ -265,6 +265,7 @@ void ProjectCompiler::writeMakeDefines(QFile &file, bool &genModuleDef)
writeln(file, "WINDRES = " + escapeArgumentForMakefileVariableValue(windres, true)); writeln(file, "WINDRES = " + escapeArgumentForMakefileVariableValue(windres, true));
#endif #endif
writeln(file, "RM = " CLEAN_PROGRAM); writeln(file, "RM = " CLEAN_PROGRAM);
writeln(file, "CD = " CD_PROGRAM);
// compiler flags // compiler flags
writeln(file, "LIBS = " + escapeArgumentsForMakefileVariableValue(libraryArguments)); writeln(file, "LIBS = " + escapeArgumentsForMakefileVariableValue(libraryArguments));
@ -361,7 +362,7 @@ void ProjectCompiler::writeMakeClean(QFile &file)
if (mProject->options().type == ProjectType::DynamicLib) { if (mProject->options().type == ProjectType::DynamicLib) {
target +=" $(STATIC)"; 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); writeln(file);
} }

View File

@ -169,6 +169,7 @@ void SDCCProjectCompiler::writeMakeDefines(QFile &file)
writeln(file, "BIN_ARG = " + escapeArgumentForMakefileVariableValue(executable, false)); writeln(file, "BIN_ARG = " + escapeArgumentForMakefileVariableValue(executable, false));
writeln(file, "CFLAGS = $(INCS) " + escapeArgumentsForMakefileVariableValue(cCompileArguments)); writeln(file, "CFLAGS = $(INCS) " + escapeArgumentsForMakefileVariableValue(cCompileArguments));
writeln(file, "RM = " CLEAN_PROGRAM); writeln(file, "RM = " CLEAN_PROGRAM);
writeln(file, "CD = " CD_PROGRAM);
writeln(file); writeln(file);
} }
@ -195,7 +196,7 @@ void SDCCProjectCompiler::writeMakeIncludes(QFile &file)
void SDCCProjectCompiler::writeMakeClean(QFile &file) void SDCCProjectCompiler::writeMakeClean(QFile &file)
{ {
writeln(file, "clean: clean-custom"); 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); writeln(file);
} }
@ -270,7 +271,7 @@ void SDCCProjectCompiler::writeMakeObjFilesRules(QFile &file)
QString fullObjDir = includeTrailingPathDelimiter(mProject->options().folderForObjFiles); QString fullObjDir = includeTrailingPathDelimiter(mProject->options().folderForObjFiles);
QString relativeObjDir = extractRelativePath(mProject->directory(),fullObjDir); QString relativeObjDir = extractRelativePath(mProject->directory(),fullObjDir);
QString objfile=extractRelativePath(generateAbsolutePath(mProject->directory(),relativeObjDir),unit->fileName()); 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));
} }
} }

View File

@ -30,6 +30,7 @@
#define MAKE_PROGRAM "mingw32-make.exe" #define MAKE_PROGRAM "mingw32-make.exe"
#define WINDRES_PROGRAM "windres.exe" #define WINDRES_PROGRAM "windres.exe"
#define CLEAN_PROGRAM "del /q /f" #define CLEAN_PROGRAM "del /q /f"
#define CD_PROGRAM "cd /d"
#define CPP_PROGRAM "cpp.exe" #define CPP_PROGRAM "cpp.exe"
#define GIT_PROGRAM "git.exe" #define GIT_PROGRAM "git.exe"
#define CLANG_PROGRAM "clang.exe" #define CLANG_PROGRAM "clang.exe"
@ -50,6 +51,7 @@
#define WINDRES_PROGRAM "" #define WINDRES_PROGRAM ""
#define GPROF_PROGRAM "gprof" #define GPROF_PROGRAM "gprof"
#define CLEAN_PROGRAM "rm -rf" #define CLEAN_PROGRAM "rm -rf"
#define CD_PROGRAM "cd"
#define CPP_PROGRAM "cpp" #define CPP_PROGRAM "cpp"
#define GIT_PROGRAM "git" #define GIT_PROGRAM "git"
#define CLANG_PROGRAM "clang" #define CLANG_PROGRAM "clang"

View File

@ -131,8 +131,8 @@ Section "$(SectionMainName)" SectionMain
!endif !endif
; Write required paths ; Write required paths
SetOutPath $INSTDIR\Templates SetOutPath $INSTDIR\templates
File /nonfatal /r "Templates\*" File /nonfatal /r "templates\*"
SectionEnd SectionEnd
@ -440,8 +440,7 @@ Section "Uninstall"
Delete "$INSTDIR\OpenConsole.exe" Delete "$INSTDIR\OpenConsole.exe"
Delete "$INSTDIR\compiler_hint.lua" Delete "$INSTDIR\compiler_hint.lua"
RMDir /r "$INSTDIR\Lang" RMDir /r "$INSTDIR\templates"
RMDir /r "$INSTDIR\Templates"
RMDir /r "$INSTDIR\mingw32" RMDir /r "$INSTDIR\mingw32"
RMDir /r "$INSTDIR\mingw64" RMDir /r "$INSTDIR\mingw64"
RMDir /r "$INSTDIR\llvm-mingw" RMDir /r "$INSTDIR\llvm-mingw"