Ouss4 commented on a change in pull request #5069:
URL: https://github.com/apache/incubator-nuttx/pull/5069#discussion_r776088779



##########
File path: tools/Makefile.unix
##########
@@ -246,80 +246,156 @@ tools/mkdeps$(HOSTEXEEXT):
 tools/cnvwindeps$(HOSTEXEEXT):
        $(Q) $(MAKE) -C tools -f Makefile.host cnvwindeps$(HOSTEXEEXT)
 
-# dirlinks, and helpers
+# .dirlinks, and helpers
 #
 # Directories links.  Most of establishing the NuttX configuration involves
 # setting up symbolic links with 'generic' directory names to specific,
 # configured directories.
 
 # Link the arch/<arch-name>/include directory to include/arch
 
-include/arch: .clean_context
-       @echo "LN: include/arch to $(ARCH_DIR)/include"
-       $(Q) $(DIRLINK) $(TOPDIR)/$(ARCH_DIR)/include include/arch
-       $(Q) touch $@
+include/arch:
+       @echo "LN: $@ to $(ARCH_DIR)/include"
+       $(Q) $(DIRLINK) $(TOPDIR)/$(ARCH_DIR)/include $@
 
 # Link the boards/<arch>/<chip>/<board>/include directory to include/arch/board
 
-include/arch/board: include/arch
-       @echo "LN: include/arch/board to $(BOARD_DIR)/include"
-       $(Q) $(DIRLINK) $(BOARD_DIR)/include include/arch/board
-       $(Q) touch $@
+include/arch/board: | include/arch
+       @echo "LN: $@ to $(BOARD_DIR)/include"
+       $(Q) $(DIRLINK) $(BOARD_DIR)/include $@
 
-ifneq ($(BOARD_COMMON_DIR),)
 # Link the boards/<arch>/<chip>/common dir to arch/<arch-name>/src/board
 # Link the boards/<arch>/<chip>/<board>/src dir to 
arch/<arch-name>/src/board/board
 
-$(ARCH_SRC)/board: .clean_context
-       @echo "LN: $(ARCH_SRC)/board to $(BOARD_COMMON_DIR)"
-       $(Q) $(DIRLINK) $(BOARD_COMMON_DIR) $(ARCH_SRC)/board
-       @echo "LN: $(ARCH_SRC)/board/board to $(BOARD_DIR)/src"
-       $(Q) $(DIRLINK) $(BOARD_DIR)/src $(ARCH_SRC)/board/board
-       $(Q) touch $@
+ifneq ($(BOARD_COMMON_DIR),)
+ARCH_SRC_BOARD_SYMLINK=$(BOARD_COMMON_DIR)
+ARCH_SRC_BOARD_BOARD_SYMLINK=$(BOARD_DIR)/src
 else
-# Link the boards/<arch>/<chip>/<board>/src dir to arch/<arch-name>/src/board
+ARCH_SRC_BOARD_SYMLINK=$(BOARD_DIR)/src
+endif
 
-$(ARCH_SRC)/board: .clean_context
-       @echo "LN: $(ARCH_SRC)/board to $(BOARD_DIR)/src"
-       $(Q) $(DIRLINK) $(BOARD_DIR)/src $(ARCH_SRC)/board
-       $(Q) touch $@
+ifneq ($(ARCH_SRC_BOARD_SYMLINK),)
+$(ARCH_SRC)/board:
+       @echo "LN: $@ to $(ARCH_SRC_BOARD_SYMLINK)"
+       $(Q) $(DIRLINK) $(ARCH_SRC_BOARD_SYMLINK) $@
+endif
+
+ifneq ($(ARCH_SRC_BOARD_BOARD_SYMLINK),)
+$(ARCH_SRC)/board/board: | $(ARCH_SRC)/board
+       @echo "LN: $@ to $(ARCH_SRC_BOARD_BOARD_SYMLINK)"
+       $(Q) $(DIRLINK) $(ARCH_SRC_BOARD_BOARD_SYMLINK) $@
 endif
 
 # Link the boards/<arch>/<chip>/drivers dir to drivers/platform
 
-drivers/platform: .clean_context
-       @echo "LN: $(TOPDIR)/drivers/platform to $(BOARD_DRIVERS_DIR)"
-       $(Q) $(DIRLINK) $(BOARD_DRIVERS_DIR) $(TOPDIR)/drivers/platform
-       $(Q) touch $@
+drivers/platform:
+       @echo "LN: $@ to $(BOARD_DRIVERS_DIR)"
+       $(Q) $(DIRLINK) $(BOARD_DRIVERS_DIR) $@

Review comment:
       Don't we need full path to link?  Is it safe to remove `TOPDIR`?




-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to