From a95c79a7ca4e43c3a1a2ceddd341e129b42e6f04 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 25 Dec 2014 06:34:23 -1000 Subject: Added the ability to apply PX4 specific patches to Nuttx At the moment this entails adding NuttX/nuttx/arch/arm/include/math.h --- Makefile | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 201187e02..23fbf8f08 100644 --- a/Makefile +++ b/Makefile @@ -161,7 +161,7 @@ $(foreach config,$(FMU_CONFIGS),$(eval $(call FMU_DEP,$(config)))) # NUTTX_ARCHIVES = $(foreach board,$(BOARDS),$(ARCHIVE_DIR)$(board).export) .PHONY: archives -archives: checksubmodules $(NUTTX_ARCHIVES) +archives: checksubmodules nuttxpatches $(NUTTX_ARCHIVES) # We cannot build these parallel; note that we also force -j1 for the # sub-make invocations. @@ -185,6 +185,29 @@ $(NUTTX_ARCHIVES): $(ARCHIVE_DIR)%.export: $(NUTTX_SRC) $(Q) $(COPY) $(NUTTX_SRC)nuttx-export.zip $@ $(Q) (cd $(NUTTX_SRC)/configs && $(RMDIR) $(board)) +NUTTX_PATCHES := $(wildcard $(PX4_NUTTX_PATCH_DIR)*.patch) +NUTTX_PATCHED = $(NUTTX_SRC).patchedpx4common + +.PHONY: nuttxpatches +nuttxpatches: + $(Q) if [ ! -f $(NUTTX_PATCHED) ]; then \ + for patch in $(NUTTX_PATCHES); \ + do \ + $(PATCH) -p0 -N < $$patch; \ + done \ + fi + $(Q) $(TOUCH) $(NUTTX_PATCHED) + +.PHONY: cleannuttxpatches +cleannuttxpatches: + $(Q) if [ ! -f $(NUTTX_PATCHED) ]; then \ + for patch in $(NUTTX_PATCHES); \ + do \ + $(PATCH) -p0 -N -R < $$patch; \ + done \ + fi + $(Q) $(TOUCH) $(NUTTX_PATCHED) + # # The user can run the NuttX 'menuconfig' tool for a single board configuration with # make BOARDS= menuconfig @@ -278,11 +301,11 @@ clean: $(Q) $(REMOVE) $(IMAGE_DIR)*.px4 .PHONY: distclean -distclean: clean +distclean: clean cleannuttxpatches @echo > /dev/null - $(Q) $(REMOVE) $(ARCHIVE_DIR)*.export - $(Q) $(MAKE) -C $(NUTTX_SRC) -r $(MQUIET) distclean - $(Q) (cd $(NUTTX_SRC)/configs && $(FIND) . -maxdepth 1 -type l -delete) + $(Q) $(REMOVE) $(ARCHIVE_DIR)*.export > /dev/null + $(Q) $(MAKE) -C $(NUTTX_SRC) -r $(MQUIET) distclean > /dev/null + $(Q) (cd $(NUTTX_SRC)/configs && $(FIND) . -maxdepth 1 -type l -delete) > /dev/null # # Print some help text -- cgit v1.2.3