The Smoothie project needs to compile C++ inside config/boardname/src/ to use with High Priority Interruption, then I modified the board configs Makefile to support it, see attached patch.
It works fine for the first time compilation, but if we execute: $ touch config/boardname/src/Pin.cxx And execute "make" it will not detect that Pin.cxx was modified. I think there is some other place I should modify, but I didn't find it.
This commit is contained in:
parent
cd54c71dc1
commit
b5bfe8af17
2 changed files with 23 additions and 6 deletions
|
@ -43,6 +43,7 @@ else
|
|||
AOBJS = $(ASRCS:$(ASMEXT)=$(OBJEXT))
|
||||
endif
|
||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||
CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT))
|
||||
|
||||
SRCS = $(ASRCS) $(CSRCS)
|
||||
OBJS = $(AOBJS) $(COBJS)
|
||||
|
@ -108,17 +109,23 @@ $(AOBJS): %$(OBJEXT): %$(ASMEXT)
|
|||
$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
|
||||
$(call COMPILE, $<, $@)
|
||||
|
||||
libboard$(LIBEXT): $(OBJS)
|
||||
$(CXXOBJS) $(LINKOBJS): %$(OBJEXT): %.cxx
|
||||
$(call COMPILEXX, $<, $@)
|
||||
|
||||
libboard$(LIBEXT): $(OBJS) $(CXXOBJS)
|
||||
$(Q) $(AR) $@ # Create an empty archive
|
||||
ifneq ($(OBJS),)
|
||||
$(call ARCHIVE, $@, $(OBJS))
|
||||
$(call ARCHIVE, $@, $(OBJS) $(CXXOBJS))
|
||||
endif
|
||||
|
||||
.depend: Makefile $(SRCS)
|
||||
.depend: Makefile $(SRCS) $(CXXSRCS)
|
||||
ifneq ($(ZDSVERSION),)
|
||||
$(Q) $(MKDEP) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
else
|
||||
$(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
endif
|
||||
ifneq ($(CXXSRCS),)
|
||||
$(Q) $(MKDEP) "$(CXX)" -- $(CXXFLAGS) -- $(CXXSRCS) >>Make.dep
|
||||
endif
|
||||
$(Q) touch $@
|
||||
|
||||
|
|
|
@ -66,6 +66,7 @@ BOARD_INSTALLED = $(if $(wildcard $(BOARD_DIR)$(DELIM)Makefile),y,)
|
|||
|
||||
CONFIG_ASRCS =
|
||||
CONFIG_CSRCS =
|
||||
CONFIG_CXXSRCS =
|
||||
|
||||
# boardctl support
|
||||
|
||||
|
@ -79,6 +80,9 @@ AOBJS = $(ASRCS:.S=$(OBJEXT))
|
|||
CSRCS = $(CONFIG_CSRCS)
|
||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||
|
||||
CXXSRCS = $(CONFIG_CXXSRCS)
|
||||
CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT))
|
||||
|
||||
SRCS = $(ASRCS) $(CSRCS)
|
||||
OBJS = $(AOBJS) $(COBJS)
|
||||
|
||||
|
@ -93,12 +97,18 @@ $(AOBJS): %$(OBJEXT): %.S
|
|||
$(COBJS): %$(OBJEXT): %.c
|
||||
$(call COMPILE, $<, $@)
|
||||
|
||||
$(BIN): $(OBJS)
|
||||
$(call ARCHIVE, $@, $(OBJS))
|
||||
$(CXXOBJS): %$(OBJEXT): %.cxx
|
||||
$(call COMPILEXX, $<, $@)
|
||||
|
||||
.depend: Makefile $(SRCS)
|
||||
$(BIN): $(OBJS) $(CXXOBJS)
|
||||
$(call ARCHIVE, $@, $(OBJS) $(CXXOBJS))
|
||||
|
||||
.depend: Makefile $(SRCS) $(CXXSRCS)
|
||||
ifneq ($(SRCS),)
|
||||
$(Q) $(MKDEP) --dep-path . "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
endif
|
||||
ifneq ($(CXXSRCS),)
|
||||
$(Q) $(MKDEP) --dep-path . "$(CXX)" -- $(CXXFLAGS) -- $(CXXSRCS) >>Make.dep
|
||||
endif
|
||||
$(Q) touch $@
|
||||
|
||||
|
|
Loading…
Reference in a new issue