From cde70da262bd8c48057024f952255ff8d9882e55 Mon Sep 17 00:00:00 2001 From: px4dev Date: Sat, 23 Feb 2013 14:43:12 -0800 Subject: 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) --- makefiles/firmware.mk | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'makefiles') 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 @@ -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,,) 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 -- cgit v1.2.3