CmdBuild / make: Accommodate projects that only have a Makefile #112
2 changed files with 30 additions and 1 deletions
7
make/disabled.mk
Normal file
7
make/disabled.mk
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
DISABLED = @echo Target \"$1\" in $(shell pwd)/Makefile has been disabled.
|
||||||
|
|
||||||
|
all:
|
||||||
|
$(call DISABLED,$@)
|
||||||
|
|
||||||
|
install clean distclean:
|
||||||
|
$(call DISABLED,$@)
|
||||||
|
|
@ -283,7 +283,29 @@ class CmdBuild(Cmd): # export
|
||||||
log(NOTICE, 'Using prerequisite flavours ' + ' '.join(dep_flavours))
|
log(NOTICE, 'Using prerequisite flavours ' + ' '.join(dep_flavours))
|
||||||
log(NOTICE, 'Calculating order for modules ... ')
|
log(NOTICE, 'Calculating order for modules ... ')
|
||||||
|
|
||||||
calculate_order(order, modules, dep_flavours)
|
def is_makefile_only(m: str) -> bool:
|
||||||
|
# Not installed as a package (no project.conf, no VERSION),
|
||||||
|
# but a project directory with a Makefile in the workspace:
|
||||||
|
# buildable with a plain make, no jw dependencies to read.
|
||||||
|
if self.app.is_installed(m, devel = True) \
|
||||||
|
or self.app.is_installed(m, devel = False):
|
||||||
|
return False
|
||||||
|
try:
|
||||||
|
wd = proj_dir(m)
|
||||||
|
except Exception:
|
||||||
|
return False
|
||||||
|
return wd is not None and os.path.exists(f'{wd}/Makefile')
|
||||||
|
|
||||||
|
makefile_only = {m for m in modules if is_makefile_only(m)}
|
||||||
|
for m in sorted(makefile_only):
|
||||||
|
log(
|
||||||
|
NOTICE,
|
||||||
|
f'Project {m} is not installed, building it as a plain '
|
||||||
|
f'Makefile project'
|
||||||
|
)
|
||||||
|
calculate_order(order, modules - makefile_only, dep_flavours)
|
||||||
|
for m in sorted(makefile_only):
|
||||||
|
order.append(m)
|
||||||
if args.ignore_deps:
|
if args.ignore_deps:
|
||||||
order = [m for m in order if m in args.modules]
|
order = [m for m in order if m in args.modules]
|
||||||
order = [m for m in order if m not in exclude]
|
order = [m for m in order if m not in exclude]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue