| 180 | |
| 181 | |
| 182 | def _prepare_sources(mname, sources, bdir): |
| 183 | extended_sources = sources.copy() |
| 184 | Path(bdir).mkdir(parents=True, exist_ok=True) |
| 185 | # Copy sources |
| 186 | for source in sources: |
| 187 | if Path(source).exists() and Path(source).is_file(): |
| 188 | shutil.copy(source, bdir) |
| 189 | generated_sources = [ |
| 190 | Path(f"{mname}module.c"), |
| 191 | Path(f"{mname}-f2pywrappers2.f90"), |
| 192 | Path(f"{mname}-f2pywrappers.f"), |
| 193 | ] |
| 194 | bdir = Path(bdir) |
| 195 | for generated_source in generated_sources: |
| 196 | if generated_source.exists(): |
| 197 | shutil.copy(generated_source, bdir / generated_source.name) |
| 198 | extended_sources.append(generated_source.name) |
| 199 | generated_source.unlink() |
| 200 | extended_sources = [ |
| 201 | Path(source).name |
| 202 | for source in extended_sources |
| 203 | if not Path(source).suffix == ".pyf" |
| 204 | ] |
| 205 | return extended_sources |