mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 13:58:34 +00:00
protobuf: regenerate images on Makefile changes
Result: [japdoll@dsafonov criu]$ touch Makefile [japdoll@dsafonov criu]$ make make[1]: Entering directory '/home/japdoll/tools/criu' PBCC images/macvlan.pb-c.c DEP images/macvlan.pb-c.d PBCC images/autofs.pb-c.c DEP images/autofs.pb-c.d PBCC images/sysctl.pb-c.c DEP images/sysctl.pb-c.d <...> travis-ci: success for Fix rebuild on Makefile changes Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com> Acked-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
8ea0ba7dd0
commit
56e89b205f
@ -75,10 +75,12 @@ $(shell grep "^[[:blank:]]*import[[:blank:]]" $(1) | \
|
||||
sort | uniq)
|
||||
endef
|
||||
|
||||
makefile-deps := Makefile $(obj)/Makefile
|
||||
|
||||
#
|
||||
# Generates rules needed to compile protobuf files.
|
||||
define gen-proto-rules
|
||||
$(obj)/$(1).pb-c.c $(obj)/$(1).pb-c.h: $(obj)/$(1).proto $(addsuffix .pb-c.c,$(addprefix $(obj)/,$(2)))
|
||||
$(obj)/$(1).pb-c.c $(obj)/$(1).pb-c.h: $(obj)/$(1).proto $(addsuffix .pb-c.c,$(addprefix $(obj)/,$(2))) $(makefile-deps)
|
||||
$$(E) " PBCC " $$@
|
||||
$$(Q) protoc-c --proto_path=$(obj)/ --c_out=$(obj)/ $$<
|
||||
ifeq ($(PROTOUFIX),y)
|
||||
@ -86,7 +88,7 @@ ifeq ($(PROTOUFIX),y)
|
||||
$$(Q) sed -i -e 's/4294967295/0xFFFFFFFF/g' $$(patsubst %.c,%.h,$$@)
|
||||
$$(Q) sed -i -e 's/4294967295/0xFFFFFFFF/g' $$(patsubst %.h,%.c,$$@)
|
||||
endif
|
||||
$(obj)/$(1).pb-c.d: $(obj)/$(1).pb-c.c $(addsuffix .pb-c.d,$(addprefix $(obj)/,$(2)))
|
||||
$(obj)/$(1).pb-c.d: $(obj)/$(1).pb-c.c $(addsuffix .pb-c.d,$(addprefix $(obj)/,$(2))) $(makefile-deps)
|
||||
$$(E) " DEP " $$@
|
||||
$$(Q) $$(CC) -M -MT $$@ -MT $(patsubst %.d,%.o,$$@) $$(CFLAGS) $$< -o $$@
|
||||
endef
|
||||
|
Loading…
x
Reference in New Issue
Block a user