summaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorAllen Webb <allenwebb@google.com>2018-08-20 10:50:49 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-09-07 18:36:35 -0700
commita8e3f2388c0a950ec431e6fffc916b42ea6c816d (patch)
tree0f8554e770469a1515321aca1bdaab4cef59b198 /Makefile.rules
parent269ff3569799531fa2b7f7a5def012ea254ceb57 (diff)
downloadchrome-ec-a8e3f2388c0a950ec431e6fffc916b42ea6c816d.tar.gz
makefule.rules: Add cxx_to_o rule for building c++ files.
This adds a rule for building c++ object files to make it possible to use libprotobuf-mutator in fuzzing targets. BRANCH=none BUG=chromium:876582 TEST=make -j buildfuzztargets && ./build/host/cr50_fuzz/cr50_fuzz.exe Change-Id: I1355c313e47a1a83a599eb0f0b9142fefdf6de8b Signed-off-by: Allen Webb <allenwebb@google.com> Reviewed-on: https://chromium-review.googlesource.com/1183535 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules7
1 files changed, 7 insertions, 0 deletions
diff --git a/Makefile.rules b/Makefile.rules
index d44db81ba5..d6150a5c47 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -77,6 +77,8 @@ cmd_elf = $(CC) $(objs) $(libsharedobjs_elf-y) $(LDFLAGS) \
cmd_fuzz_exe = $(CXX) $^ $(HOST_TEST_LDFLAGS) $(LDFLAGS_EXTRA) -o $@
cmd_exe = $(CC) $(ro-objs) $(HOST_TEST_LDFLAGS) -o $@
cmd_c_to_o = $(CC) $(CFLAGS) -MMD -MP -MF $@.d -c $< -o $(@D)/$(@F)
+cmd_cxx_to_o = $(CXX) -std=c++11 $(CFLAGS) $(CXXFLAGS) -MMD -MP -MF $@.d -c $< \
+ -o $(@D)/$(@F)
cmd_c_to_build = $(BUILDCC) $(BUILD_CFLAGS) \
$(sort $(foreach c,$($(*F)-objs),util/$(c:%.o=%.c)) $(wildcard $*.c)) \
$(BUILD_LDFLAGS) \
@@ -444,6 +446,11 @@ $(out)/RO/%.o:%.c
$(out)/RW/%.o:%.c
$(call quiet,c_to_o,CC )
+$(out)/RO/%.o:%.cc
+ $(call quiet,cxx_to_o,CXX )
+$(out)/RW/%.o:%.cc
+ $(call quiet,cxx_to_o,CXX )
+
$(out)/$(SHOBJLIB)/%.o: override LATE_CFLAGS_DEFINE:=-DSHAREDLIB_IMAGE
$(out)/$(SHOBJLIB)/%.o:%.c
$(call quiet,c_to_o,CC )