From 90bdcdb391996efa70c2df0d3ec49303dd0daa0c Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Thu, 28 Apr 2016 17:01:57 +0200 Subject: build: add support for .cpp files --- build/arch.mk | 5 +++++ build/macros.mk | 2 +- build/top.mk | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/build/arch.mk b/build/arch.mk index 6b6410b..b52bdbe 100644 --- a/build/arch.mk +++ b/build/arch.mk @@ -59,6 +59,11 @@ $$(OBJDIR)/%.$1.o: %.cc $$(COMPILE_DEPS) | $$(COMPILE_ORDER_DEPS) $$(call mkdir_if_needed,$$@) $$Q$$($1_COMPILE.cc) -o $$@ $$< +$$(OBJDIR)/%.$1.o: %.cpp $$(COMPILE_DEPS) | $$(COMPILE_ORDER_DEPS) + @echo "CXX [$1] $$<" + $$(call mkdir_if_needed,$$@) + $$Q$$($1_COMPILE.cc) -o $$@ $$< + $$(OBJDIR)/%.$1.o: %.S $$(COMPILE_DEPS) | $$(COMPILE_ORDER_DEPS) @echo "AS [$1] $$<" $$(call mkdir_if_needed,$$@) diff --git a/build/macros.mk b/build/macros.mk index fd6c587..813c6fd 100644 --- a/build/macros.mk +++ b/build/macros.mk @@ -22,7 +22,7 @@ filter_sources_sub = $(foreach t,$1 $($1_SUBTARGETS),$(filter %.$t,$2)) \ # Test if one of the source is C++, in this case, return cc, else return c. # $(call iscxx,SOURCES) -iscxx = $(if $(filter %.cc,$1),cc,c) +iscxx = $(if $(filter %.cc,$1)$(filter %.cpp,$1),cc,c) # Output every parent directories until root is reached. # $(call parents,DIRS,ROOT) diff --git a/build/top.mk b/build/top.mk index d7da682..4469d2e 100644 --- a/build/top.mk +++ b/build/top.mk @@ -52,6 +52,7 @@ clean: include $(UCOO_BASE)/build/setup.mk vpath %.cc $(UCOO_BASE) $(BASE) +vpath %.cpp $(UCOO_BASE) $(BASE) vpath %.c $(UCOO_BASE) $(BASE) vpath %.S $(UCOO_BASE) $(BASE) -- cgit v1.2.3