Fix simple flag and excludesource

- Fix simple flag not generating the correct Makefile
- Fix excludesource not excluding the correct files
This commit is contained in:
Thraix
2025-06-04 22:05:37 +02:00
parent d3c334dc79
commit aa0b390379
5 changed files with 19 additions and 12 deletions
+9 -2
View File
@@ -170,13 +170,20 @@ void Makefile::Save(ConfigFile& conf, unsigned int flags)
auto itD = dependencies.find(*it);
if(itD == dependencies.end())
{
IncludeDeps* deps = new IncludeDeps(*it, hFiles, dependencies);
size_t extensionPos = it->find_last_of(".");
size_t slash = it->find_last_of("/")+1;
std::string oFile = it->substr(slash, extensionPos - slash)+".o ";
outputFile << "$(OBJPATH)/" << oFile << ":";
deps->Output(outputFile, conf);
if (flags & FLAG_SIMPLE)
{
outputFile << " " << *it;
}
else
{
IncludeDeps* deps = new IncludeDeps(*it, hFiles, dependencies);
deps->Output(outputFile, conf);
}
outputFile << std::endl;
outputFile << "\t$(info -[" << (int)(i / (float)cppFiles.size() * 100) << "%]- $<)" << std::endl;
outputFile << "\t$(CC) $(CFLAGS) -o $@ $<" << std::endl;