Commit 9b50b9d6 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Pavel Emelyanov

make: fix CONFIG_HEADER dependency for make criu/%.o

Removed `config' target, as it only has $(CONFIG_HEADER) dependency.
$(VERSION_HEADER) dependency is in top-make for CRIU's files:
>  criu/%: images/built-in.o compel/compel $(VERSION_HEADER) .FORCE
Introduced pattern-specific target for CRIU files, so it
got as dependency pie (and config header as pie's deps).
As we're building from NMK and including source Makefile from there,
it adds Makefile dependency - tell GNU/Make, that it's all right,
up-to-date by introducing Makefile target (otherwise, Makefile
would fit pattern-specific rule).
For any PIE's object I just rebuild/regenerate all pie, it may
be smarter - but we have now Makefile.library and Makefile
for PIE, so need to know, who should rebuild it.

Fixes:
[criu]$ make criu/log.o
make[1]: Entering directory '/home/japdoll/tools/criu'
make[1]: Leaving directory '/home/japdoll/tools/criu'
make[1]: Entering directory '/home/japdoll/tools/criu'
make[1]: 'images/built-in.o' is up to date.
make[1]: Leaving directory '/home/japdoll/tools/criu'
make[1]: Entering directory '/home/japdoll/tools/criu'
make[1]: 'compel/compel' is up to date.
make[1]: Leaving directory '/home/japdoll/tools/criu'
make[1]: Entering directory '/home/japdoll/tools/criu'
  DEP      criu/log.d
In file included from criu/log.c:22:0:
/home/japdoll/tools/criu/criu/include/string.h:11:20: fatal error: config.h: No such file or directory
 #include "config.h"
                    ^
compilation terminated.
  CC       criu/log.o
In file included from criu/log.c:22:0:
/home/japdoll/tools/criu/criu/include/string.h:11:20: fatal error: config.h: No such file or directory
 #include "config.h"
                    ^
compilation terminated.
make[1]: *** [/home/japdoll/tools/criu/scripts/nmk/scripts/build.mk:104: criu/log.o] Error 1
make[1]: Leaving directory '/home/japdoll/tools/criu'
make: *** [Makefile:200: criu/log.o] Error 2

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent ba7ee44b
......@@ -48,12 +48,11 @@ CONFIG_HEADER := $(obj)/include/config.h
ifneq ($(filter-out clean mrproper,$(MAKECMDGOALS)),)
include $(SRC_DIR)/criu/Makefile.config
endif
config: $(VERSION_HEADER)
#
# System calls library.
SYSCALL-LIB := $(ARCH_DIR)/syscalls.built-in.o
syscalls_lib: config
syscalls_lib: $(CONFIG_HEADER)
$(Q) $(MAKE) $(call build-as,Makefile.syscalls,$(ARCH_DIR)) all
.PHONY: syscalls_lib
......@@ -86,6 +85,9 @@ pie: $(piegen-bin) criu/pie/lib.a
$(Q) $(MAKE) $(build)=criu/pie all
.PHONY: pie
criu/pie/%: pie
@true
#
# CRIU executable
PROGRAM-BUILTINS += criu/pie/lib.a
......@@ -96,6 +98,12 @@ PROGRAM-BUILTINS += $(ARCH-LIB)
$(obj)/built-in.o: pie
$(Q) $(MAKE) $(call build-as,Makefile.crtools,criu) all
$(obj)/Makefile:
@true
$(obj)/%: pie
$(Q) $(MAKE) $(call build-as,Makefile.crtools,criu) $@
$(obj)/criu: $(PROGRAM-BUILTINS)
$(call msg-link, $@)
$(Q) $(CC) $(CFLAGS) $^ $(LIBS) $(WRAPFLAGS) $(LDFLAGS) $(GMONLDOPT) -rdynamic -o $@
......
......@@ -26,6 +26,9 @@ ifeq ($$(call try-cc,$$(FEATURE_TEST_$(1)),$$(LIBS),$$(DEFINES)),true)
endif
endef
$(obj)/include/config-base.h:
@true
define config-header-rule
$(CONFIG_HEADER): $(obj)/include/config-base.h
$$(call msg-gen, $$@)
......@@ -49,5 +52,3 @@ endef
$(eval $(config-header-rule))
$(CONFIG_HEADER): $(SRC_DIR)/scripts/feature-tests.mak
config: $(CONFIG_HEADER)
.PHONY: config
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