diff --git a/make/disabled.mk b/make/disabled.mk new file mode 100644 index 00000000..2b6558c8 --- /dev/null +++ b/make/disabled.mk @@ -0,0 +1,7 @@ +DISABLED = @echo Target \"$1\" in $(shell pwd)/Makefile has been disabled. + +all: + $(call DISABLED,$@) + +install clean distclean: + $(call DISABLED,$@) diff --git a/src/python/jw/pkg/cmds/projects/CmdBuild.py b/src/python/jw/pkg/cmds/projects/CmdBuild.py index 6677e71b..09f71122 100644 --- a/src/python/jw/pkg/cmds/projects/CmdBuild.py +++ b/src/python/jw/pkg/cmds/projects/CmdBuild.py @@ -283,7 +283,29 @@ class CmdBuild(Cmd): # export log(NOTICE, 'Using prerequisite flavours ' + ' '.join(dep_flavours)) 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: order = [m for m in order if m in args.modules] order = [m for m in order if m not in exclude]