mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 05:13:34 +08:00
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)
This commit is contained in:
+4
-13
@@ -205,10 +205,6 @@ include $(PX4_MK_DIR)/nuttx.mk
|
|||||||
# ROMFS generation
|
# 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),)
|
ifneq ($(ROMFS_ROOT),)
|
||||||
|
|
||||||
# Add dependencies on anything in the ROMFS root
|
# Add dependencies on anything in the ROMFS root
|
||||||
@@ -240,9 +236,6 @@ endif
|
|||||||
# Builtin command list generation
|
# Builtin command list generation
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
#
|
|
||||||
# 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
|
# Builtin commands can be generated by the configuration, in which case they
|
||||||
# must refer to commands that already exist, or indirectly generated by modules
|
# must refer to commands that already exist, or indirectly generated by modules
|
||||||
@@ -256,12 +249,13 @@ endif
|
|||||||
# period. These fields are the command's name, its thread priority, its stack size
|
# 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.
|
# and the name of the function to call when starting the thread.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
BUILTIN_CSRC = $(WORK_DIR)builtin_commands.c
|
BUILTIN_CSRC = $(WORK_DIR)builtin_commands.c
|
||||||
|
|
||||||
# add command definitions from modules
|
# add command definitions from modules
|
||||||
BUILTIN_COMMANDS += $(subst COMMAND.,,$(notdir $(wildcard $(WORK_DIR)builtin_commands/COMMAND.*)))
|
BUILTIN_COMMANDS += $(subst COMMAND.,,$(notdir $(wildcard $(WORK_DIR)builtin_commands/COMMAND.*)))
|
||||||
|
|
||||||
|
ifneq ($(BUILTIN_COMMANDS),)
|
||||||
|
|
||||||
# (BUILTIN_PROTO,<cmdspec>,<outputfile>)
|
# (BUILTIN_PROTO,<cmdspec>,<outputfile>)
|
||||||
define BUILTIN_PROTO
|
define BUILTIN_PROTO
|
||||||
$(ECHO) 'extern int $(word 4,$1)(int argc, char *argv[]);' >> $2;
|
$(ECHO) 'extern int $(word 4,$1)(int argc, char *argv[]);' >> $2;
|
||||||
@@ -284,12 +278,9 @@ $(BUILTIN_CSRC): $(GLOBAL_DEPS)
|
|||||||
$(Q) $(ECHO) '};' >> $@
|
$(Q) $(ECHO) '};' >> $@
|
||||||
$(Q) $(ECHO) 'const int g_builtin_count = $(words $(BUILTIN_COMMANDS));' >> $@
|
$(Q) $(ECHO) 'const int g_builtin_count = $(words $(BUILTIN_COMMANDS));' >> $@
|
||||||
|
|
||||||
BUILTIN_OBJ = $(BUILTIN_CSRC:.c=.o)
|
SRCS += $(BUILTIN_CSRC)
|
||||||
LIBS += $(BUILTIN_OBJ)
|
|
||||||
LINK_DEPS += $(BUILTIN_OBJ)
|
|
||||||
|
|
||||||
$(BUILTIN_OBJ): $(BUILTIN_CSRC)
|
endif
|
||||||
$(Q) $(call COMPILE,$<,$@)
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Default SRCS generation
|
# Default SRCS generation
|
||||||
|
|||||||
Reference in New Issue
Block a user