OSDN Git Service

Add a dummy build recipe for the proto generated header files
authorYing Wang <wangying@google.com>
Fri, 14 Feb 2014 02:04:00 +0000 (18:04 -0800)
committerYing Wang <wangying@google.com>
Fri, 14 Feb 2014 02:04:00 +0000 (18:04 -0800)
This fixed issue that gnumake skip updating the cpp file that includes
the generated header file when the .proto file gets updated.
For example:
Say a.cc includes b.pb.h, since b.pb.h is just byproduct of the rule
that generates b.pb.cc, and though we have dependency "b.pb.h :
b.pb.cc", but we don't have build recipe for that rule.
Gmake stupidly thinks that b.pb.h must not be updated in that case so
it skips all targets that depends on b.pb.h!
With the dumy build recipe, gmake now doesn't skip the depedent targets.

Bug: 13009798
Change-Id: I39adc09b7656bdd023f578fb8933667944fd974c

core/binary.mk

index bbdf4d2..f4a7eae 100644 (file)
@@ -411,6 +411,8 @@ $(proto_generated_cc_sources): $(proto_generated_cc_sources_dir)/%.pb.cc: %.prot
 
 proto_generated_headers := $(patsubst %.pb.cc,%.pb.h, $(proto_generated_cc_sources))
 $(proto_generated_headers): $(proto_generated_cc_sources_dir)/%.pb.h: $(proto_generated_cc_sources_dir)/%.pb.cc
+       # This is just a dummy rule to make sure gmake doesn't skip updating the dependents.
+       @echo "Updated header file $<."
 
 $(proto_generated_objects): PRIVATE_ARM_MODE := $(normal_objects_mode)
 $(proto_generated_objects): PRIVATE_ARM_CFLAGS := $(normal_objects_cflags)