diff --git a/chinook/models/_destination.py b/chinook/models/_destination.py index 595071c..ccedf74 100644 --- a/chinook/models/_destination.py +++ b/chinook/models/_destination.py @@ -24,21 +24,15 @@ class Destination: def objpath(self) -> Path: return self._objpath - def __init__(self, outpath: Path, mkdirs=True) -> None: + def __init__(self, outpath: Path) -> None: self._root = outpath / ".chinook" self._binpath = self._root / "bin" self._libpath = self._root / "lib" self._objpath = self._root / "obj" - if mkdirs: - self._root.mkdir(parents=True, exist_ok=True) - self._binpath.mkdir(parents=True, exist_ok=True) - self._libpath.mkdir(parents=True, exist_ok=True) - self._objpath.mkdir(parents=True, exist_ok=True) - @staticmethod def cwd() -> 'Destination': - return Destination(Path.cwd(), mkdirs=False) + return Destination(Path.cwd()) def bin(self, file: str) -> Path: return self.binpath / file diff --git a/chinook/pipeline/_prepare.py b/chinook/pipeline/_prepare.py index 0761789..adc8ee6 100644 --- a/chinook/pipeline/_prepare.py +++ b/chinook/pipeline/_prepare.py @@ -53,6 +53,7 @@ def prepare( dstfile.parent.mkdir(parents=True, exist_ok=True) commands.append(CompileObject(compiler, defopts, logger, srcfile, dstfile)) if not latest(srcfile, outfile): + outfile.parent.mkdir(parents=True, exist_ok=True) objects.append(dstfile) defopts.objfiles.update(objects) diff --git a/chinook/pipeline/_test.py b/chinook/pipeline/_test.py index 41bfd4b..aa58cd9 100644 --- a/chinook/pipeline/_test.py +++ b/chinook/pipeline/_test.py @@ -55,6 +55,6 @@ def _prepare_dependencies( continue parent = find_project_by_target(required.value) if project.cid != parent.cid and required not in parent.exports: - raise Exception(f"Cannot depend on non-exported target: {required}") - commands.extend(prepare(appcfg, parent, target, logger)) + raise Exception(f"Cannot depend on non-exported target: {required.value}") + commands.extend(prepare(appcfg, parent, dependency, logger)) return commands diff --git a/examples/testing/chinookfile b/examples/testing/chinookfile index 5339297..94ee848 100644 --- a/examples/testing/chinookfile +++ b/examples/testing/chinookfile @@ -9,7 +9,7 @@ targets: - ./fibonacci.cpp tests: -- name: factorial_test +- name: testing type: program deps: [fibonacci] srcs: