aboutsummaryrefslogtreecommitdiff
path: root/makefiles/firmware.mk
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2013-02-23 14:43:12 -0800
committerpx4dev <px4@purgatory.org>2013-02-23 22:01:00 -0800
commitcde70da262bd8c48057024f952255ff8d9882e55 (patch)
treed7c0b5a0872d9c0d5c615c838aeab35a509507e1 /makefiles/firmware.mk
parent6b215be739528eb20b50247a0a095d27092b3be4 (diff)
downloadpx4-firmware-cde70da262bd8c48057024f952255ff8d9882e55.tar.gz
px4-firmware-cde70da262bd8c48057024f952255ff8d9882e55.tar.bz2
px4-firmware-cde70da262bd8c48057024f952255ff8d9882e55.zip
We don't have to get fancy with builtin_commands.c now, since we put all of the object files into the link loop (ordering is less important now)
Diffstat (limited to 'makefiles/firmware.mk')
-rw-r--r--makefiles/firmware.mk17
1 files changed, 4 insertions, 13 deletions
diff --git a/makefiles/firmware.mk b/makefiles/firmware.mk
index 23fd3136f..6eada6353 100644
--- a/makefiles/firmware.mk
+++ b/makefiles/firmware.mk
@@ -205,10 +205,6 @@ include $(PX4_MK_DIR)/nuttx.mk
# ROMFS generation
################################################################################
-#
-# Note that we can't just put romfs.c in SRCS, as it's depended on by the
-# NuttX export library. Instead, we have to treat it like a library.
-#
ifneq ($(ROMFS_ROOT),)
# Add dependencies on anything in the ROMFS root
@@ -241,9 +237,6 @@ endif
################################################################################
#
-# Note that we can't just put builtin_commands.c in SRCS, as it's depended on by the
-# NuttX export library. Instead, we have to treat it like a library.
-#
# Builtin commands can be generated by the configuration, in which case they
# must refer to commands that already exist, or indirectly generated by modules
# when they are built.
@@ -256,12 +249,13 @@ endif
# period. These fields are the command's name, its thread priority, its stack size
# and the name of the function to call when starting the thread.
#
-#
BUILTIN_CSRC = $(WORK_DIR)builtin_commands.c
# add command definitions from modules
BUILTIN_COMMANDS += $(subst COMMAND.,,$(notdir $(wildcard $(WORK_DIR)builtin_commands/COMMAND.*)))
+ifneq ($(BUILTIN_COMMANDS),)
+
# (BUILTIN_PROTO,<cmdspec>,<outputfile>)
define BUILTIN_PROTO
$(ECHO) 'extern int $(word 4,$1)(int argc, char *argv[]);' >> $2;
@@ -284,12 +278,9 @@ $(BUILTIN_CSRC): $(GLOBAL_DEPS)
$(Q) $(ECHO) '};' >> $@
$(Q) $(ECHO) 'const int g_builtin_count = $(words $(BUILTIN_COMMANDS));' >> $@
-BUILTIN_OBJ = $(BUILTIN_CSRC:.c=.o)
-LIBS += $(BUILTIN_OBJ)
-LINK_DEPS += $(BUILTIN_OBJ)
+SRCS += $(BUILTIN_CSRC)
-$(BUILTIN_OBJ): $(BUILTIN_CSRC)
- $(Q) $(call COMPILE,$<,$@)
+endif
################################################################################
# Default SRCS generation