| 199 | |
| 200 | |
| 201 | def _prepare_sources(mname, sources, bdir): |
| 202 | extended_sources = sources.copy() |
| 203 | Path(bdir).mkdir(parents=True, exist_ok=True) |
| 204 | # Copy sources |
| 205 | for source in sources: |
| 206 | if Path(source).exists() and Path(source).is_file(): |
| 207 | shutil.copy(source, bdir) |
| 208 | generated_sources = [ |
| 209 | Path(f"{mname}module.c"), |
| 210 | Path(f"{mname}-f2pywrappers2.f90"), |
| 211 | Path(f"{mname}-f2pywrappers.f"), |
| 212 | ] |
| 213 | bdir = Path(bdir) |
| 214 | for generated_source in generated_sources: |
| 215 | if generated_source.exists(): |
| 216 | shutil.copy(generated_source, bdir / generated_source.name) |
| 217 | extended_sources.append(generated_source.name) |
| 218 | generated_source.unlink() |
| 219 | extended_sources = [ |
| 220 | Path(source).name |
| 221 | for source in extended_sources |
| 222 | if not Path(source).suffix == ".pyf" |
| 223 | ] |
| 224 | return extended_sources |
| 225 | |
| 226 | def _prepare_objects(mname, objects, bdir): |
| 227 | Path(bdir).mkdir(parents=True, exist_ok=True) |