Skip to content
Snippets Groups Projects
Commit ef84e014 authored by Nadav Har'El's avatar Nadav Har'El Committed by Pekka Enberg
Browse files

build.mk: fix breakage caused by MAKEFLAGS passed to module build


Our "Makefile" runs build.mk with "make -r", to disable all the default
rules. This flag is saved by make in the MAKEFLAGS variable, which is
passed on to child processes. Unfortunately, it is also passed to the
makefiles of individual modules (apps/*) when we build specific modules.
These makefiles are completely stand-alone, and are normally written to
assume that the default rules (e.g., .c->.o) do exist. They will fail when
run with MAKEFLAGS=r.

We recently noticed both redis-memonly and memcached to exhibit this problem
and committed workarounds (see 914bef6f75d9f3e7f268aecdb00a023b86439b85 and
e2f7ba1b1d80bb5e89d7fca71b4994c7de15ed4e in apps.git).

However, the right fix is for our build.mk to acknowledge that the modules'
makefiles are stand-alone, and must not inherit our prefered flags like
"-r". So this patch clears the MAKEFLAGS variable when calling module.py
(module.py will later invoke "make module" in the module's directory).

Reviewed-by: default avatarTomasz Grabiec <tgrabiec@gmail.com>
Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent 91199cb0
No related branches found
No related tags found
No related merge requests found
......@@ -900,7 +900,7 @@ $(src)/modules/tests/usr.manifest: $(src)/build.mk
.PHONY: process-modules
process-modules: bootfs.manifest.skel usr.manifest.skel $(src)/modules/tests/usr.manifest $(java-targets)
cd $(out)/module \
&& jdkbase=$(jdkbase) OSV_BASE=$(src) OSV_BUILD_PATH=$(out) $(src)/scripts/module.py --image-config $(image)
&& jdkbase=$(jdkbase) OSV_BASE=$(src) OSV_BUILD_PATH=$(out) MAKEFLAGS= $(src)/scripts/module.py --image-config $(image)
$(out)/cmdline: process-modules
$(out)/bootfs.manifest: process-modules
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment