xiaoxiang781216 commented on a change in pull request #5375:
URL: https://github.com/apache/incubator-nuttx/pull/5375#discussion_r799278107



##########
File path: boards/xtensa/esp32s2/esp32s2-saola-1/src/Make.defs
##########
@@ -44,14 +44,10 @@ endif
 SCRIPTIN = $(SCRIPTDIR)$(DELIM)esp32s2.template.ld
 SCRIPTOUT = $(SCRIPTDIR)$(DELIM)esp32s2_out.ld
 
-.PHONY = context distclean
-
 $(SCRIPTOUT): $(SCRIPTIN) $(CONFIGFILE)

Review comment:
       > Definitely open to suggestions to make it more straightforward. 
Currently the rules for `SCRIPTOUT` is defined in 
`arch/arm/<arch-name>/board/board/Make.defs` aka `$(BOARD_DIR)/src/Make.defs` 
`arch/<arch-name>/src/board/Makefile` includes `board/Make.defs`. Right now the 
way I'm generating `$(SCRIPTOUT)` is by essentially calling `make -C board 
$(SCRIPTOUT)`, because that Makefile knows how to create the file.
   > 
   > I could modify `arch/<arch-name>/src/Makefile` to `include 
/board/board/Make.defs` and then add `SCRIPTOUT` as a dependency to 
`nuttx$(EXEEXT)`
   
   I think it's a common request to preprocess the linker script before pass it 
to the linker. @anchao made a patch before:
   
https://github.com/FishsemiCode/nuttx/commit/dcf70e6142308724473ae895f8c2d01cf5e220d3
   But, it isn't upstream yet.
   
   > 
   > @xiaoxiang781216 is that what you had in mind or did you have a different 
idea?
   
   My suggestion is:
   
   1. Make the linker script preprocess as the common step
   2. Put this rule to arch/*/src/Makefile
   3. Remove the linker script preprocess from board's Make.defs




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to