py/mkrules.mk: Add target for compiling C++ files.
Move the target from the ESP32 Makefile since that does what is needed already, but also include files from user C modules as is done for the C files.
This commit is contained in:
parent
2b9f0586e7
commit
f1666419a8
@ -781,22 +781,6 @@ $(BUILD)/application.elf: $(OBJ) $(LIB) $(BUILD)/esp32_out.ld $(BUILD)/esp32.pro
|
|||||||
$(Q)$(LD) $(LDFLAGS) -o $@ $(APP_LD_ARGS)
|
$(Q)$(LD) $(LDFLAGS) -o $@ $(APP_LD_ARGS)
|
||||||
$(Q)$(SIZE) $@
|
$(Q)$(SIZE) $@
|
||||||
|
|
||||||
define compile_cxx
|
|
||||||
$(ECHO) "CXX $<"
|
|
||||||
$(Q)$(CXX) $(CXXFLAGS) -c -MD -o $@ $<
|
|
||||||
@# The following fixes the dependency file.
|
|
||||||
@# See http://make.paulandlesley.org/autodep.html for details.
|
|
||||||
@# Regex adjusted from the above to play better with Windows paths, etc.
|
|
||||||
@$(CP) $(@:.o=.d) $(@:.o=.P); \
|
|
||||||
$(SED) -e 's/#.*//' -e 's/^.*: *//' -e 's/ *\\$$//' \
|
|
||||||
-e '/^$$/ d' -e 's/$$/ :/' < $(@:.o=.d) >> $(@:.o=.P); \
|
|
||||||
$(RM) -f $(@:.o=.d)
|
|
||||||
endef
|
|
||||||
|
|
||||||
vpath %.cpp . $(TOP)
|
|
||||||
$(BUILD)/%.o: %.cpp
|
|
||||||
$(call compile_cxx)
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Declarations to build the bootloader
|
# Declarations to build the bootloader
|
||||||
|
|
||||||
|
@ -58,12 +58,28 @@ $(Q)$(CC) $(CFLAGS) -c -MD -o $@ $<
|
|||||||
$(RM) -f $(@:.o=.d)
|
$(RM) -f $(@:.o=.d)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define compile_cxx
|
||||||
|
$(ECHO) "CXX $<"
|
||||||
|
$(Q)$(CXX) $(CXXFLAGS) -c -MD -o $@ $<
|
||||||
|
@# The following fixes the dependency file.
|
||||||
|
@# See http://make.paulandlesley.org/autodep.html for details.
|
||||||
|
@# Regex adjusted from the above to play better with Windows paths, etc.
|
||||||
|
@$(CP) $(@:.o=.d) $(@:.o=.P); \
|
||||||
|
$(SED) -e 's/#.*//' -e 's/^.*: *//' -e 's/ *\\$$//' \
|
||||||
|
-e '/^$$/ d' -e 's/$$/ :/' < $(@:.o=.d) >> $(@:.o=.P); \
|
||||||
|
$(RM) -f $(@:.o=.d)
|
||||||
|
endef
|
||||||
|
|
||||||
vpath %.c . $(TOP) $(USER_C_MODULES)
|
vpath %.c . $(TOP) $(USER_C_MODULES)
|
||||||
$(BUILD)/%.o: %.c
|
$(BUILD)/%.o: %.c
|
||||||
$(call compile_c)
|
$(call compile_c)
|
||||||
|
|
||||||
vpath %.c . $(TOP) $(USER_C_MODULES)
|
vpath %.c . $(TOP) $(USER_C_MODULES)
|
||||||
|
|
||||||
|
vpath %.cpp . $(TOP) $(USER_C_MODULES)
|
||||||
|
$(BUILD)/%.o: %.cpp
|
||||||
|
$(call compile_cxx)
|
||||||
|
|
||||||
$(BUILD)/%.pp: %.c
|
$(BUILD)/%.pp: %.c
|
||||||
$(ECHO) "PreProcess $<"
|
$(ECHO) "PreProcess $<"
|
||||||
$(Q)$(CPP) $(CFLAGS) -Wp,-C,-dD,-dI -o $@ $<
|
$(Q)$(CPP) $(CFLAGS) -Wp,-C,-dD,-dI -o $@ $<
|
||||||
|
Loading…
x
Reference in New Issue
Block a user