xiaoxiang781216 commented on code in PR #15304:
URL: https://github.com/apache/nuttx/pull/15304#discussion_r1904253895


##########
tools/Unix.mk:
##########
@@ -618,6 +619,35 @@ bootloader:
 clean_bootloader:
        $(Q) $(MAKE) -C $(ARCH_SRC) clean_bootloader
 
+checkpython3:
+       @if [ -z "$$(which python3)" ]; then \
+               echo "ERROR: python3 not found in PATH"; \
+               echo "       Please install python3 or fix the PATH"; \
+               exit 1; \
+       fi
+
+# host_info target flags to get diagnostic info without building nxdiag 
application
+
+SYSINFO_PARSE_FLAGS = "$(realpath $(TOPDIR))"
+SYSINFO_PARSE_FLAGS += "-fsysinfo.h"
+
+SYSINFO_FLAGS = "-c"
+SYSINFO_FLAGS += "-p"
+SYSINFO_FLAGS += -f \""$(shell echo '$(CFLAGS)' | sed 's/"/\\\\\\"/g')"\"
+SYSINFO_FLAGS += \""$(shell echo '$(CXXFLAGS)' | sed 's/"/\\\\\\"/g')"\"
+SYSINFO_FLAGS += \""$(shell echo '$(LDFLAGS)' | sed 's/"/\\\\\\"/g')"\"
+SYSINFO_FLAGS += "--target_info"
+
+# host_info: Parse nxdiag example output file (sysinfo.h) and print
+
+host_info: checkpython3
+       @if [[ ! -f "sysinfo.h" ]]; then \
+               echo "file sysinfo.h not exists"; \
+               python3 $(TOPDIR)$(DELIM)tools$(DELIM)host_info_dump.py 
$(SYSINFO_FLAGS) \
+                $(realpath $(TOPDIR)) > sysinfo.h; \

Review Comment:
   should we put sysinfo.h to include folder?



-- 
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