| 147 | } |
| 148 | |
| 149 | static void compilefiles(std::ostream &fout, const std::vector<std::string> &files, const std::string &args) |
| 150 | { |
| 151 | for (const std::string &file : files) { |
| 152 | const bool external(startsWith(file,"externals/") || startsWith(file,"../externals/")); |
| 153 | const bool tinyxml2(startsWith(file,"externals/tinyxml2/") || startsWith(file,"../externals/tinyxml2/")); |
| 154 | fout << objfile(file) << ": " << file; |
| 155 | std::vector<std::string> depfiles; |
| 156 | getDeps(file, depfiles); |
| 157 | std::sort(depfiles.begin(), depfiles.end()); |
| 158 | for (const std::string &depfile : depfiles) |
| 159 | fout << " " << depfile; |
| 160 | std::string additional; |
| 161 | if (external) |
| 162 | additional += " -w"; // do not show any warnings for external |
| 163 | if (tinyxml2) |
| 164 | additional += " -D_LARGEFILE_SOURCE"; // required for fseeko() and ftello() (on Cygwin) |
| 165 | fout << "\n\t$(CXX) " << args << " $(CPPFLAGS) $(CXXFLAGS)" << additional << " -c -o $@ " << builddir(file) << "\n\n"; |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | static std::string getCppFiles(std::vector<std::string> &files, const std::string &path, bool recursive) |
| 170 | { |