aboutsummaryrefslogtreecommitdiff
path: root/makefiles/firmware.mk
diff options
context:
space:
mode:
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