dirs.mk, projects.py: Take prerequisites dir check from project.conf

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2016-02-03 17:41:30 +00:00
commit 86afe4fc10
2 changed files with 17 additions and 3 deletions

View file

@ -29,7 +29,9 @@ SUBDIR_TARGETS = $(filter $(ALLOWED_SUBDIR_TARGETS),$(MAKECMDGOALS))
endif endif
ifneq ($(DONT_CHECK_PREREQ_DONE),true) ifneq ($(DONT_CHECK_PREREQ_DONE),true)
PREREQ_DIRS_DONE = $(addsuffix /dirs-all.done,$(filter-out $(TOPDIR) /opt/%,$(foreach p,$(PREREQ),$($(p)_DIR)))) PREREQ += $(call proj_query, prereq build $(PROJECT))
PREREQ_DIRS = $(foreach p, $(PREREQ), $(call proj_dir, $(p)))
PREREQ_DIRS_DONE = $(addsuffix /dirs-all.done,$(filter-out $(TOPDIR) /opt/%,$(PREREQ_DIRS)))
endif endif
all: dirs-all.done all: dirs-all.done
@ -88,3 +90,4 @@ dirs.distclean:
$(make_dirs) $(make_dirs)
endif # SUBDIRS_TO_ITERATE endif # SUBDIRS_TO_ITERATE

View file

@ -101,8 +101,10 @@ def add_modules_from_project_txt(buf, visited, spec, section, key, add_self, sco
spec = name spec = name
if spec in buf: if spec in buf:
return return
#if spec in visited: if spec in visited:
# return if add_self:
buf.append(spec)
return
visited.add(spec) visited.add(spec)
deps = get_value(name, section, key) deps = get_value(name, section, key)
debug("name = ", name, "section = ", section, "key = ", key, "deps = ", deps, "scope = ", scope, "visited = ", visited) debug("name = ", name, "section = ", section, "key = ", key, "deps = ", deps, "scope = ", scope, "visited = ", visited)
@ -219,6 +221,15 @@ def cmd_path(args_):
r = r + ':' + proj_dir(m) + '/bin' r = r + ':' + proj_dir(m) + '/bin'
print(r[1:]) print(r[1:])
def cmd_prereq(args_):
parser = argparse.ArgumentParser(description='path')
parser.add_argument('flavour', help='Flavour')
parser.add_argument('module', nargs='*', help='Modules')
args=parser.parse_args(args_)
deps = get_modules_from_project_txt(args.module, 'pkg.required',
args.flavour, scope = 2, add_self=False, names_only=True)
print(' '.join(deps))
def cmd_pkg_requires(args_): def cmd_pkg_requires(args_):
parser = argparse.ArgumentParser(description='pkg-requires') parser = argparse.ArgumentParser(description='pkg-requires')
parser.add_argument('flavour', help='Flavour') parser.add_argument('flavour', help='Flavour')