From 44c7b95e7741ef3e523c2b1c1f314c051a21aae6 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Fri, 2 Dec 2022 13:45:43 -0300 Subject: [PATCH] [Makefile][Fixed] What is included in all target - Now outputs marked with run_by_default=False aren't included. - They are included in other targets, just not in the default target. --- CHANGELOG.md | 2 ++ kibot/kiplot.py | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f06d13ac..918cc28d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,6 +70,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Problems with recursive imports when the intermediate import didn't contain any of the requested elements (i.e. no outputs). (#335) - Navigate results: fail when no output to generate. Now you get a warning. +- Makefile: outputs marked as not run by default were listed in the `all` + target. ## [1.4.0] - 2022-10-12 ### Added diff --git a/kibot/kiplot.py b/kibot/kiplot.py index 8c9bef31..93ba9a75 100644 --- a/kibot/kiplot.py +++ b/kibot/kiplot.py @@ -542,7 +542,7 @@ def get_pre_targets(targets, dependencies, is_pre): return pcb_targets, sch_targets -def get_out_targets(outputs, ori_names, targets, dependencies, comments): +def get_out_targets(outputs, ori_names, targets, dependencies, comments, no_default): pcb_targets = sch_targets = '' try: for out in outputs: @@ -555,6 +555,8 @@ def get_out_targets(outputs, ori_names, targets, dependencies, comments): dependencies[name] = [adapt_file_name(fn) for fn in out.get_dependencies()] if out.comment: comments[name] = out.comment + if not out.run_by_default: + no_default.add(name) if out.is_sch(): sch_targets += ' '+name if out.is_pcb(): @@ -596,13 +598,14 @@ def generate_makefile(makefile, cfg_file, outputs, kibot_sys=False): comments = {} ori_names = {} is_pre = set() + no_default = set() # Preflights pre_pcb_targets, pre_sch_targets = get_pre_targets(targets, dependencies, is_pre) # Outputs - out_pcb_targets, out_sch_targets = get_out_targets(outputs, ori_names, targets, dependencies, comments) + out_pcb_targets, out_sch_targets = get_out_targets(outputs, ori_names, targets, dependencies, comments, no_default) # all target f.write('#\n# Default target\n#\n') - f.write('all: '+' '.join(targets.keys())+'\n\n') + f.write('all: '+' '.join(filter(lambda x: x not in no_default, targets.keys()))+'\n\n') extra_targets = ['all'] # PCB/SCH specific targets f.write('#\n# SCH/PCB targets\n#\n')