[CRIU] [PATCH 08/10] nmk: build.mk -- Add @hostprogs-y mode

Cyrill Gorcunov gorcunov at gmail.com
Wed Mar 23 03:46:03 PDT 2016


On Wed, Mar 23, 2016 at 01:35:23PM +0300, Dmitry Safonov wrote:
> >  #
> >  # General rules.
> >@@ -187,6 +190,35 @@ objdirs := $(patsubst %/,%,$(filter-out $(obj)/,$(call uniq,$(objdirs))))
> >  $(foreach t,$(objdirs),$(eval $(call gen-cc-rules,$(t)/%,$(t)/%)))
> Ok, so the reason to use $(addprefix $(obj)/,...) for host rules instead of
> $(call objectify,...) in all this code is that hosprogs are in their
> directory
> and there (in the dir) mustn't be anything with relative paths like
> compel-objs += ../criu/$(ARCH_DIR)/syscalls.o
> Right?

Yes. Currently hostprogs must lay in one directory (and subdirectory)
but not by some absolute path (as for built-in and targeted modes).
We can't yet generate such rules (and I think we won't be in near
future).

Moreover the only two things are left in nmk until I freeze it

 - libraries (ie so files) generation
 - fixups for *.d files generation (currently we generate .d
   files even if we might not need them when using target mode)
 - some macro helper for generation executable file in one rule,
   say

	$(eval $(call gen-executable,<obj-dir>,<exec-name>))

   which will exapands to eveything needed.

For CRIU in general we should bring back all the targets on toplevel
makefile so one can run

	make criu/cr-dump.o

from toplevel, as it were before.

> And if I got it right, all that gen-host-, hostprogs-y, $(name)-objs
> stuff is for different host-cflags, get-messages and possibe HOSTCC,
> that's the reason to declare new rules instead of using existing
> target-specific.

Yup. For cross compile reason host programs might be build with
different compiler and flags (as we have for piegen).

> 
> If so, that looks good to me.

	Cyrill


More information about the CRIU mailing list