mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-06 16:33:39 +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
|
||||
################################################################################
|
||||
|
||||
#
|
||||
# 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
|
||||
@@ -240,9 +236,6 @@ endif
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user