Commit a502750a authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Andrei Vagin

Makefile.compel: simplify compel-deps

Working on CRIU Makefilest feels like walking on a minefield.
This is not an attempt to demine it, but to make some mines
a bit easier to notice.

OK, this is what we're trying to do here:

1. Drop the $(SRC_DIR)/ prefix from the target: as this is a top-level
   Makefile, we can just use paths relative to top-level source  dir.

2. Drop the $(SRC_DIR) from the symlink, use relative one. Relative
   symlinks are always better -- say, if a source directory is
   moved, everything will still work.

3. The "compel/include/asm: compel/arch/$(ARCH)/src/lib/include"
   dependency is useless. Yes, the left side is created as a symlink
   to the right side, but that doesn't mean that "make" should
   compare the timestamps of both to decide whether to remake
   the target.

4. The "$(COMPEL_VERSION_HEADER): compel/include/asm" dependency
   is wrong, the compel/include/asm symlink is not needed for
   $(COMPEL_VERSION_HEADER) generation. Remove it.

5. Move compel/plugins/std.built-in.o prerequisite from the rule
   to compel-plugins variable, and use it.

travis-ci: success for More polishing for compel cli
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent ea0cc75a
......@@ -14,15 +14,15 @@ $(COMPEL_VERSION_HEADER): $(SRC_DIR)/Makefile.versions
$(Q) echo "#define COMPEL_SO_VERSION_SUBLEVEL " $(COMPEL_SO_VERSION_SUBLEVEL) >> $(COMPEL_VERSION_HEADER)
$(Q) echo "#endif /* COMPEL_SO_VERSION_H__ */" >> $(COMPEL_VERSION_HEADER)
$(SRC_DIR)/compel/include/asm: $(SRC_DIR)/compel/arch/$(ARCH)/src/lib/include
compel/include/asm:
$(call msg-gen, $@)
$(Q) ln -s $^ $@
$(COMPEL_VERSION_HEADER): $(SRC_DIR)/compel/include/asm
$(Q) ln -s ../arch/$(ARCH)/src/lib/include $@
compel-deps += $(SRC_DIR)/compel/include/asm
compel-deps += compel/include/asm
compel-deps += $(COMPEL_VERSION_HEADER)
compel-deps += $(CONFIG_HEADER)
compel-deps += include/common/asm
compel-plugins += compel/plugins/std.built-in.o
LIBCOMPEL_SO := libcompel.so
LIBCOMPEL_A := libcompel.a
......@@ -30,7 +30,7 @@ export LIBCOMPEL_SO LIBCOMPEL_A
#
# Compel itself.
compel/%: $(compel-deps) compel/plugins/std.built-in.o .FORCE
compel/%: $(compel-deps) $(compel-plugins) .FORCE
$(Q) $(MAKE) $(build)=compel $@
#
......@@ -61,4 +61,4 @@ compel/$(LIBCOMPEL_SO): compel/$(LIBCOMPEL_A)
compel-install-targets += compel/$(LIBCOMPEL_SO)
compel-install-targets += compel/compel
compel-install-targets += compel/plugins/std.built-in.o
compel-install-targets += $(compel-plugins)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment