aboutsummaryrefslogtreecommitdiff
path: root/makefiles/firmware.mk
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2013-02-23 15:11:57 -0800
committerpx4dev <px4@purgatory.org>2013-02-23 22:01:00 -0800
commitddc405935e006569241be6a4aa02d4a6d6d5c56e (patch)
treeed5c1e1e34d2f4a78fc62b5e36da3e575d0b1a1f /makefiles/firmware.mk
parentcde70da262bd8c48057024f952255ff8d9882e55 (diff)
downloadpx4-firmware-ddc405935e006569241be6a4aa02d4a6d6d5c56e.tar.gz
px4-firmware-ddc405935e006569241be6a4aa02d4a6d6d5c56e.tar.bz2
px4-firmware-ddc405935e006569241be6a4aa02d4a6d6d5c56e.zip
Cosmetic tweaks to variable output.
Comment on the need to retain the double-slash at the WORK_DIR boundary. More toolchain documentation.
Diffstat (limited to 'makefiles/firmware.mk')
-rw-r--r--makefiles/firmware.mk19
1 files changed, 12 insertions, 7 deletions
diff --git a/makefiles/firmware.mk b/makefiles/firmware.mk
index 6eada6353..12fc20926 100644
--- a/makefiles/firmware.mk
+++ b/makefiles/firmware.mk
@@ -65,7 +65,7 @@ MK_DIR ?= $(dir $(lastword $(MAKEFILE_LIST)))
ifeq ($(PX4_BASE),)
export PX4_BASE := $(abspath $(MK_DIR)/..)
endif
-$(info PX4_BASE $(PX4_BASE))
+$(info % PX4_BASE = $(PX4_BASE))
#
# Set a default target so that included makefiles or errors here don't
@@ -93,7 +93,7 @@ $(error Can't find a config file called $(CONFIG) or $(PX4_MK_DIR)/config_$(CONF
endif
export CONFIG
include $(CONFIG_FILE)
-$(info CONFIG $(CONFIG))
+$(info % CONFIG = $(CONFIG))
#
# Sanity-check the BOARD variable and then get the board config.
@@ -110,7 +110,7 @@ $(error Config $(CONFIG) references board $(BOARD), but no board definition file
endif
export BOARD
include $(BOARD_FILE)
-$(info BOARD $(BOARD))
+$(info % BOARD = $(BOARD))
#
# If WORK_DIR is not set, create a 'build' directory next to the
@@ -120,7 +120,7 @@ PARENT_MAKEFILE := $(lastword $(filter-out $(lastword $(MAKEFILE_LIST)),$(MAKEF
ifeq ($(WORK_DIR),)
export WORK_DIR := $(dir $(PARENT_MAKEFILE))build/
endif
-$(info WORK_DIR $(WORK_DIR))
+$(info % WORK_DIR = $(WORK_DIR))
#
# Things that, if they change, might affect everything
@@ -164,7 +164,10 @@ ifneq ($(MISSING_MODULES),)
$(error Can't find module(s): $(MISSING_MODULES))
endif
-# make a list of the object files we expect to build from modules
+# Make a list of the object files we expect to build from modules
+# Note that this path will typically contain a double-slash at the WORK_DIR boundary; this must be
+# preserved as it is used below to get the absolute path for the module.mk file correct.
+#
MODULE_OBJS := $(foreach path,$(dir $(MODULE_MKFILES)),$(WORK_DIR)$(path)module.pre.o)
# rules to build module objects
@@ -252,7 +255,8 @@ endif
BUILTIN_CSRC = $(WORK_DIR)builtin_commands.c
# add command definitions from modules
-BUILTIN_COMMANDS += $(subst COMMAND.,,$(notdir $(wildcard $(WORK_DIR)builtin_commands/COMMAND.*)))
+BUILTIN_COMMAND_FILES := $(wildcard $(WORK_DIR)builtin_commands/COMMAND.*)
+BUILTIN_COMMANDS += $(subst COMMAND.,,$(notdir $(BUILTIN_COMMAND_FILES)))
ifneq ($(BUILTIN_COMMANDS),)
@@ -266,7 +270,8 @@ define BUILTIN_DEF
$(ECHO) ' {"$(word 1,$1)", $(word 2,$1), $(word 3,$1), $(word 4,$1)},' >> $2;
endef
-$(BUILTIN_CSRC): $(GLOBAL_DEPS)
+# Don't generate until modules have updated their command files
+$(BUILTIN_CSRC): $(GLOBAL_DEPS) $(BUILTIN_COMMAND_FILES)
@$(ECHO) %% generating $@
$(Q) $(ECHO) '/* builtin command list - automatically generated, do not edit */' > $@
$(Q) $(ECHO) '#include <nuttx/config.h>' >> $@