mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 09:28:31 -04:00
build: fixed dependency on frame type and options
this ensures "make sitl-heli" rebuilds after a "make sitl" Thanks to Michael Oborne for reporting this
This commit is contained in:
parent
1797e2baa8
commit
65d0ecdef7
@ -191,41 +191,4 @@ $(SKETCHEEP): $(SKETCHELF)
|
|||||||
$(RULEHDR)
|
$(RULEHDR)
|
||||||
$(v)$(OBJCOPY) -O ihex -j.eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 $< $@
|
$(v)$(OBJCOPY) -O ihex -j.eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 $< $@
|
||||||
|
|
||||||
#
|
include $(MK_DIR)/build_rules.mk
|
||||||
# Build sketch objects
|
|
||||||
#
|
|
||||||
SKETCH_INCLUDES = $(SKETCHLIBINCLUDES) $(ARDUINOLIBINCLUDES) $(COREINCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/%.o: $(BUILDROOT)/%.cpp
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(CXX) $(CXXFLAGS) -c -o $@ $< -I$(SRCROOT) $(SKETCH_INCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/%.o: $(SRCROOT)/%.cpp
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(CXX) $(CXXFLAGS) -c -o $@ $< $(SKETCH_INCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/%.o: $(SRCROOT)/%.c
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(CC) $(CFLAGS) -c -o $@ $< $(SKETCH_INCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/%.o: $(SRCROOT)/%.S
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(AS) $(ASFLAGS) -c -o $@ $< $(SKETCH_INCLUDES)
|
|
||||||
|
|
||||||
#
|
|
||||||
# Build library objects from sources in the sketchbook
|
|
||||||
#
|
|
||||||
SLIB_INCLUDES = -I$(dir $<)/utility $(SKETCHLIBINCLUDES) $(ARDUINOLIBINCLUDES) $(COREINCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/libraries/%.o: $(SKETCHBOOK)/libraries/%.cpp
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(CXX) $(CXXFLAGS) -c -o $@ $< $(SLIB_INCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/libraries/%.o: $(SKETCHBOOK)/libraries/%.c
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(CC) $(CFLAGS) -c -o $@ $< $(SLIB_INCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/libraries/%.o: $(SKETCHBOOK)/libraries/%.S
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(AS) $(ASFLAGS) -c -o $@ $< $(SLIB_INCLUDES)
|
|
||||||
|
|
||||||
|
@ -175,41 +175,4 @@ $(SKETCHEEP): $(SKETCHELF)
|
|||||||
$(RULEHDR)
|
$(RULEHDR)
|
||||||
$(v)$(OBJCOPY) -O ihex -j.eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 $< $@
|
$(v)$(OBJCOPY) -O ihex -j.eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 $< $@
|
||||||
|
|
||||||
#
|
include $(MK_DIR)/build_rules.mk
|
||||||
# Build sketch objects
|
|
||||||
#
|
|
||||||
SKETCH_INCLUDES = $(SKETCHLIBINCLUDES) $(ARDUINOLIBINCLUDES) $(COREINCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/%.o: $(BUILDROOT)/%.cpp
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(CXX) $(CXXFLAGS) -c -o $@ $< -I$(SRCROOT) $(SKETCH_INCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/%.o: $(SRCROOT)/%.cpp
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(CXX) $(CXXFLAGS) -c -o $@ $< $(SKETCH_INCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/%.o: $(SRCROOT)/%.c
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(CC) $(CFLAGS) -c -o $@ $< $(SKETCH_INCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/%.o: $(SRCROOT)/%.S
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(AS) $(ASFLAGS) -c -o $@ $< $(SKETCH_INCLUDES)
|
|
||||||
|
|
||||||
#
|
|
||||||
# Build library objects from sources in the sketchbook
|
|
||||||
#
|
|
||||||
SLIB_INCLUDES = -I$(dir $<)/utility $(SKETCHLIBINCLUDES) $(ARDUINOLIBINCLUDES) $(COREINCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/libraries/%.o: $(SKETCHBOOK)/libraries/%.cpp
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(CXX) $(CXXFLAGS) -c -o $@ $< $(SLIB_INCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/libraries/%.o: $(SKETCHBOOK)/libraries/%.c
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(CC) $(CFLAGS) -c -o $@ $< $(SLIB_INCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/libraries/%.o: $(SKETCHBOOK)/libraries/%.S
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(AS) $(ASFLAGS) -c -o $@ $< $(SLIB_INCLUDES)
|
|
||||||
|
|
||||||
|
@ -95,47 +95,11 @@ print-%:
|
|||||||
-include $(ALLDEPS)
|
-include $(ALLDEPS)
|
||||||
|
|
||||||
# Link the final object
|
# Link the final object
|
||||||
$(SKETCHELF): $(SKETCHOBJS) $(LIBOBJS)
|
$(SKETCHELF): $(SKETCHOBJS) $(LIBOBJS)
|
||||||
@echo "Building $(SKETCHELF)"
|
@echo "Building $(SKETCHELF)"
|
||||||
$(RULEHDR)
|
$(RULEHDR)
|
||||||
$(v)$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
|
$(v)$(LD) $(LDFLAGS) -o $@ $(SKETCHOBJS) $(LIBOBJS) $(LIBS)
|
||||||
$(v)cp $(SKETCHELF) .
|
$(v)cp $(SKETCHELF) .
|
||||||
@echo "Firmware is in $(BUILDELF)"
|
@echo "Firmware is in $(BUILDELF)"
|
||||||
|
|
||||||
#
|
include $(MK_DIR)/build_rules.mk
|
||||||
# Build sketch objects
|
|
||||||
#
|
|
||||||
SKETCH_INCLUDES = $(SKETCHLIBINCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/%.o: $(BUILDROOT)/%.cpp
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(CXX) $(CXXFLAGS) -c -o $@ $< -I$(SRCROOT) $(SKETCH_INCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/%.o: $(SRCROOT)/%.cpp
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(CXX) $(CXXFLAGS) -c -o $@ $< $(SKETCH_INCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/%.o: $(SRCROOT)/%.c
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(CC) $(CFLAGS) -c -o $@ $< $(SKETCH_INCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/%.o: $(SRCROOT)/%.S
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(AS) $(ASFLAGS) -c -o $@ $< $(SKETCH_INCLUDES)
|
|
||||||
|
|
||||||
#
|
|
||||||
# Build library objects from sources in the sketchbook
|
|
||||||
#
|
|
||||||
SLIB_INCLUDES = -I$(dir $<)/utility $(SKETCHLIBINCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/libraries/%.o: $(SKETCHBOOK)/libraries/%.cpp
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(CXX) $(CXXFLAGS) -c -o $@ $< $(SLIB_INCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/libraries/%.o: $(SKETCHBOOK)/libraries/%.c
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(CC) $(CFLAGS) -c -o $@ $< $(SLIB_INCLUDES)
|
|
||||||
|
|
||||||
$(BUILDROOT)/libraries/%.o: $(SKETCHBOOK)/libraries/%.S
|
|
||||||
$(RULEHDR)
|
|
||||||
$(v)$(AS) $(ASFLAGS) -c -o $@ $< $(SLIB_INCLUDES)
|
|
||||||
|
38
mk/build_rules.mk
Normal file
38
mk/build_rules.mk
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
|
||||||
|
#
|
||||||
|
# Build sketch objects
|
||||||
|
#
|
||||||
|
SKETCH_INCLUDES = $(SKETCHLIBINCLUDES)
|
||||||
|
|
||||||
|
$(BUILDROOT)/%.o: $(BUILDROOT)/%.cpp
|
||||||
|
$(RULEHDR)
|
||||||
|
$(v)$(CXX) $(CXXFLAGS) -c -o $@ $< -I$(SRCROOT) $(SKETCH_INCLUDES)
|
||||||
|
|
||||||
|
$(BUILDROOT)/%.o: $(BUILDROOT)/make.flags $(SRCROOT)/%.cpp
|
||||||
|
$(RULEHDR)
|
||||||
|
$(v)$(CXX) $(CXXFLAGS) -c -o $@ $*.cpp $(SKETCH_INCLUDES)
|
||||||
|
|
||||||
|
$(BUILDROOT)/%.o: $(SRCROOT)/%.c
|
||||||
|
$(RULEHDR)
|
||||||
|
$(v)$(CC) $(CFLAGS) -c -o $@ $< $(SKETCH_INCLUDES)
|
||||||
|
|
||||||
|
$(BUILDROOT)/%.o: $(SRCROOT)/%.S
|
||||||
|
$(RULEHDR)
|
||||||
|
$(v)$(AS) $(ASFLAGS) -c -o $@ $< $(SKETCH_INCLUDES)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Build library objects from sources in the sketchbook
|
||||||
|
#
|
||||||
|
SLIB_INCLUDES = -I$(dir $<)/utility $(SKETCHLIBINCLUDES)
|
||||||
|
|
||||||
|
$(BUILDROOT)/libraries/%.o: $(SKETCHBOOK)/libraries/%.cpp
|
||||||
|
$(RULEHDR)
|
||||||
|
$(v)$(CXX) $(CXXFLAGS) -c -o $@ $< $(SLIB_INCLUDES)
|
||||||
|
|
||||||
|
$(BUILDROOT)/libraries/%.o: $(SKETCHBOOK)/libraries/%.c
|
||||||
|
$(RULEHDR)
|
||||||
|
$(v)$(CC) $(CFLAGS) -c -o $@ $< $(SLIB_INCLUDES)
|
||||||
|
|
||||||
|
$(BUILDROOT)/libraries/%.o: $(SKETCHBOOK)/libraries/%.S
|
||||||
|
$(RULEHDR)
|
||||||
|
$(v)$(AS) $(ASFLAGS) -c -o $@ $< $(SLIB_INCLUDES)
|
@ -77,12 +77,14 @@ else
|
|||||||
v =
|
v =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: $(BUILDROOT)/make.flags
|
FORCE:
|
||||||
$(BUILDROOT)/make.flags:
|
|
||||||
@mkdir -p $(BUILDROOT)
|
|
||||||
@echo "// BUILDROOT=$(BUILDROOT) HAL_BOARD=$(HAL_BOARD) HAL_BOARD_SUBTYPE=$(HAL_BOARD_SUBTYPE) TOOLCHAIN=$(TOOLCHAIN) EXTRAFLAGS=$(EXTRAFLAGS)" > $(BUILDROOT)/make.flags
|
|
||||||
@cat $(BUILDROOT)/make.flags
|
|
||||||
|
|
||||||
|
$(BUILDROOT)/make.flags: FORCE
|
||||||
|
@mkdir -p $(BUILDROOT)
|
||||||
|
@echo "// BUILDROOT=$(BUILDROOT) HAL_BOARD=$(HAL_BOARD) HAL_BOARD_SUBTYPE=$(HAL_BOARD_SUBTYPE) TOOLCHAIN=$(TOOLCHAIN) EXTRAFLAGS=$(EXTRAFLAGS)" > $(BUILDROOT)/make.flags.new
|
||||||
|
@cmp $(BUILDROOT)/make.flags $(BUILDROOT)/make.flags.new > /dev/null 2>&1 || mv $(BUILDROOT)/make.flags.new $(BUILDROOT)/make.flags
|
||||||
|
@rm -f $(BUILDROOT)/make.flags.new
|
||||||
|
@cat $(BUILDROOT)/make.flags
|
||||||
|
|
||||||
ifeq (,$(MAKE_INC))
|
ifeq (,$(MAKE_INC))
|
||||||
# Build the sketch.cpp file
|
# Build the sketch.cpp file
|
||||||
|
Loading…
Reference in New Issue
Block a user