You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/11/10 17:11:49 UTC

[GitHub] [incubator-nuttx] zouboan opened a new pull request, #7572: tools: Fix various error in Windows native build

zouboan opened a new pull request, #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572

   ## Summary
   These patch fine raised NuttX Windows native build!
   1. tools/mkdeps:Fix an error caused by do_shquote in Windows native build:
   do_shquote in Windows native build will give following error in mkdeps:
   `sparc-elf-gcc: '-fno-common': No such file or directory
   sparc-elf-gcc: '-Wall': No such file or directory
   sparc-elf-gcc: '-Wstrict-prototypes': No such file or directory
   sparc-elf-gcc: '-Wshadow': No such file or directory
   sparc-elf-gcc: '-Wundef': No such file or directory
   sparc-elf-gcc: '-fomit-frame-pointer': No such file or directory
   sparc-elf-gcc: '-g': No such file or directory
   sparc-elf-gcc: '-mcpu=leon': No such file or directory
   sparc-elf-gcc: '-isystem': No such file or directory`
   2. tools/Config:Fix some error caused by double quotation in Windows native build:
   The result of $(subst "X",,${shell $(INCDIR) "$(CC)" "X"}) will left an space double quotation:
   `-isystem **_""_**G:\NuttX\nuttx/include -D__NuttX__ -D__KERNEL__  -pipe -I **_""_**G:\NuttX\nuttx/libs/libc`
   3. tools/Config:Fix some error call DELFILE/DELDIR/CATFILE in Windows native build:
   There are so many .ddc in libc that `$(call CATFILE, bin/Make.dep, $^)` give an error: input line is too long in Windows native build. also $(call DELFILE, $^) give same error.
   4.libc and mm/Makefile:Fix an error caused by backslash in Windows native build:
   There is a comment in the libs/libc/Makefile and mm/Makefile of NuttX 8.2 :
   `# REVISIT: Backslash causes problems in $(COBJS) target
   DELIM := $(strip /)`  The `DELIM := $(strip /)` was removed thereafter, and resulted an error in $(COBJS) target in Windows native build.
   5. tools/Win.mk:Fix some error in clean_context in Windows native build:
   Error use of DIRUNLINK result failure in remove `include\arch\board  \include\arch\chip
   include\arch    $(ARCH_SRC)\board\board  $(ARCH_SRC)\board  $(ARCH_SRC)\chip
    $(TOPDIR)\drivers\platform`
   6. `mkdir -p staging` Create dir 'p' while creating dir 'staging', and the dir 'p'  cant be remove when make distclean, which result failure of `mkdir -p staging`  in next bulid.
   ## Impact
   Windows native build
   ## Testing
   Configure + Build Windows native build
   


-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020246234


##########
libs/libc/Makefile:
##########
@@ -115,7 +115,7 @@ endif
 BINDIR ?= bin
 
 AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
-COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
+COBJS = $(patsubst %.c, $(BINDIR)/%$(OBJEXT), $(CSRCS))

Review Comment:
   look at commit e10ab85d1d39950d719a4bd7d2379c01d8c59a28
   **_More changes to restore the native Windows build_** 
   @patacongo 
   add this two line:
   `# REVISIT: Backslash causes problems in $(COBJS) target`
   `DELIM := $(strip /)`
   in libc/Makefile
   I think he knows why?



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/nuttx/pull/7572#discussion_r1034767716


##########
tools/Config.mk:
##########
@@ -393,11 +393,18 @@ endef
 # ARCHIVE - Same as above, but ensure the archive is
 # created from scratch
 
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+define ARCHIVE
+	$(Q) $(RM) $1
+	$(Q) $(AR) $1 $(2)
+endef
+else
 define ARCHIVE
 	@echo "AR (create): ${shell basename $(1)} $(2)"

Review Comment:
   > can we change to:
   > ```
   > @echo "AR(create): $(1) $(2)"
   > ```
   > to avoid the duplication.
   
   I tried, but failed! the key problem here is echo too many character in Windows environment,  even `@echo "AR (create): $(2)"` give same error by test.
   how about remove `@echo "AR (create): ${shell basename $(1)} $(2)"` as well in Linux to avoid the duplication?
   



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020605713


##########
libs/libc/Makefile:
##########
@@ -115,7 +115,7 @@ endif
 BINDIR ?= bin
 
 AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
-COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
+COBJS = $(patsubst %.c, $(BINDIR)/%$(OBJEXT), $(CSRCS))

Review Comment:
   `tools/Config.mk` has:
   ```
   # DELIM - Path segment delimiter character
   #
   # Depends on this settings defined in board-specific defconfig file installed
   # at $(TOPDIR)/.config:
   #
   #   CONFIG_WINDOWS_NATIVE - Defined for a Windows native build
   
   ifeq ($(CONFIG_WINDOWS_NATIVE),y)
     DELIM ?= $(strip \)
   else
     DELIM ?= $(strip /)
   endif
   ```
   Isn't this still the case for Windows?



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/nuttx/pull/7572#discussion_r1034208088


##########
libs/libc/Makefile:
##########
@@ -114,8 +114,8 @@ endif
 
 BINDIR ?= bin
 
-AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
-COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
+AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)$(DELIM)%$(OBJEXT), $(ASRCS))

Review Comment:
   In Windows environment` DELIM := \ `but`\`has two role in Windows environment:
   first: `\` as directory separator, and second `\` as Escape character
   in Windows environment:
   `COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))`
   equivalent to
   `COBJS = $(patsubst %.c, $(BINDIR)\%$(OBJEXT), $(CSRCS))`
   and the `\` of `\%` was identified to be Escape character, which result the `% `was identified to be ordinary characters and not used for pattern. and then result the error: `makefile:132: *** target mode do not include“%”. stop.`
   As described in: [https://www.gnu.org/software/make/manual/html_node/Text-Functions.html](url)
   we can use double $(DELIM) to solve problem
   `COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)$(DELIM)%$(OBJEXT), $(CSRCS))`
   equivalent to
   `COBJS = $(patsubst %.c, $(BINDIR)\\%$(OBJEXT), $(CSRCS))`
   the first `\` of `\\%` Escape the second `\` as ordinary characters, so that  `%` used as pattern, there's no extra problem use `//%` in Linux as tested.



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1019697923


##########
libs/libc/Makefile:
##########
@@ -194,9 +196,9 @@ distclean:: clean
 	$(Q) $(MAKE) -C kbin distclean
 	$(Q) $(MAKE) -C zoneinfo distclean BIN=$(BIN)
 	$(call DELFILE, exec_symtab.c)
-	$(call DELFILE, bin/Make.dep)
-	$(call DELFILE, kbin/Make.dep)
+	$(call DELFILE, bin$(DELIM)Make.dep)
+	$(call DELFILE, kbin$(DELIM)Make.dep)
 	$(call DELFILE, .depend)
 
--include bin/Make.dep
--include kbin/Make.dep
+-include bin$(DELIM)Make.dep

Review Comment:
   What is an issue with using `$(DELIM)`?



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020248468


##########
libs/libc/Makefile:
##########
@@ -194,9 +196,9 @@ distclean:: clean
 	$(Q) $(MAKE) -C kbin distclean
 	$(Q) $(MAKE) -C zoneinfo distclean BIN=$(BIN)
 	$(call DELFILE, exec_symtab.c)
-	$(call DELFILE, bin/Make.dep)
-	$(call DELFILE, kbin/Make.dep)
+	$(call DELFILE, bin$(DELIM)Make.dep)

Review Comment:
   DELFILE use `del` which is a pure windows command, must use Backslash, so i change 
   $`(call DELFILE, bin/Make.dep)` to `$(call DELFILE, bin$(DELIM)Make.dep)`



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1019702573


##########
libs/libc/Makefile:
##########
@@ -194,9 +196,9 @@ distclean:: clean
 	$(Q) $(MAKE) -C kbin distclean
 	$(Q) $(MAKE) -C zoneinfo distclean BIN=$(BIN)
 	$(call DELFILE, exec_symtab.c)
-	$(call DELFILE, bin/Make.dep)
-	$(call DELFILE, kbin/Make.dep)
+	$(call DELFILE, bin$(DELIM)Make.dep)
+	$(call DELFILE, kbin$(DELIM)Make.dep)
 	$(call DELFILE, .depend)
 
--include bin/Make.dep
--include kbin/Make.dep
+-include bin$(DELIM)Make.dep

Review Comment:
   use `/` here result failure of make distclean



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020199752


##########
libs/libc/Makefile:
##########
@@ -194,9 +196,9 @@ distclean:: clean
 	$(Q) $(MAKE) -C kbin distclean
 	$(Q) $(MAKE) -C zoneinfo distclean BIN=$(BIN)
 	$(call DELFILE, exec_symtab.c)
-	$(call DELFILE, bin/Make.dep)
-	$(call DELFILE, kbin/Make.dep)
+	$(call DELFILE, bin$(DELIM)Make.dep)
+	$(call DELFILE, kbin$(DELIM)Make.dep)
 	$(call DELFILE, .depend)
 
--include bin/Make.dep
--include kbin/Make.dep
+-include bin$(DELIM)Make.dep

Review Comment:
   > Sorry for the confusion. It was more a general question not related to this line directly. I see many places that replace `DELIM` with `/`, so wondering why that is done?
   
   #1088 remove the line `DELIM := $(strip /)` in libs/libc/Makefile
   
   `# REVISIT: Backslash causes problems in $(COBJS) target`
   `DELIM := $(strip /)`
   `BINDIR ?= bin`
   
   `AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))`
   `COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))`
   
   And in Windows native build give an error:
   `makefile:132: *** target mode do not include“%”. stop.`
   
   ditto mm/Makefile



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020620602


##########
libs/libc/Makefile:
##########
@@ -115,7 +115,7 @@ endif
 BINDIR ?= bin
 
 AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
-COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
+COBJS = $(patsubst %.c, $(BINDIR)/%$(OBJEXT), $(CSRCS))

Review Comment:
   > Isn't this still the case for Windows?
   
   Windows is not a GNU environment, in Windows native build, we must use some GNU command(from GnuWin32) to support makefile, some special cases we must use `/` rather than Backslash.
   libs/libc/Makefile and mm/Makefile is the special cases,to resolve the probled in $(COBJS) target caused by backslash , we must use `/` in $(COBJS) of `libs/libc` and `mm` although In most cause we use `\` in Windows native build.
   
   please look at commit https://github.com/apache/incubator-nuttx/commit/e10ab85d1d39950d719a4bd7d2379c01d8c59a28
   **More changes to restore the native Windows build**
   
   gregroy add this two line:
   `# REVISIT: Backslash causes problems in $(COBJS) target`
   `DELIM := $(strip /)`
   in `libc/Makefile` and `mm/Makefile` to restore the native Windows build 
   
   it means that use  `/`  in Windows native build as well as in Linux environment,  although In most cause should use `\` in Windows native build.
   
   `DELIM := $(strip /)` was removed from `libc/Makefile` and `mm/Makefile`  in #1088 and result use `\` libs in Windows native build in `libc/Makefile` and `mm/Makefile` ,which broke Windows native build and give an error:
   `makefile:132: *** target mode do not include“%”. stop.`



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020199752


##########
libs/libc/Makefile:
##########
@@ -194,9 +196,9 @@ distclean:: clean
 	$(Q) $(MAKE) -C kbin distclean
 	$(Q) $(MAKE) -C zoneinfo distclean BIN=$(BIN)
 	$(call DELFILE, exec_symtab.c)
-	$(call DELFILE, bin/Make.dep)
-	$(call DELFILE, kbin/Make.dep)
+	$(call DELFILE, bin$(DELIM)Make.dep)
+	$(call DELFILE, kbin$(DELIM)Make.dep)
 	$(call DELFILE, .depend)
 
--include bin/Make.dep
--include kbin/Make.dep
+-include bin$(DELIM)Make.dep

Review Comment:
   > Sorry for the confusion. It was more a general question not related to this line directly. I see many places that replace `DELIM` with `/`, so wondering why that is done?
   
   #1088 remove the line `DELIM := $(strip /)` in libs/libc/Makefile
   `# REVISIT: Backslash causes problems in $(COBJS) target
   DELIM := $(strip /)
   BINDIR ?= bin
   
   AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
   COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))`
   
   And in Windows native build give an error:
   `makefile:132: *** target mode do not include“%”. stop.`
   
   ditto mm/Makefile



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020620602


##########
libs/libc/Makefile:
##########
@@ -115,7 +115,7 @@ endif
 BINDIR ?= bin
 
 AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
-COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
+COBJS = $(patsubst %.c, $(BINDIR)/%$(OBJEXT), $(CSRCS))

Review Comment:
   > Isn't this still the case for Windows?
   
   Windows is not a GNU environment, in Windows native build, we must use some GNU command(from GnuWin32) to support makefile, some special cases we must use `/` rather than Backslash.
   libs/libc/Makefile and mm/Makefile is the special cases,to resolve the probled in $(COBJS) target caused by backslash , we must use `/` in $(COBJS) of `libs/libc` and `mm` although In most cause we use `\` in Windows native build.
   
   please look at commit https://github.com/apache/incubator-nuttx/commit/e10ab85d1d39950d719a4bd7d2379c01d8c59a28
   **More changes to restore the native Windows build**
   
   gregroy add this two line especially:
   `# REVISIT: Backslash causes problems in $(COBJS) target`
   `DELIM := $(strip /)`
   in `libc/Makefile` and `mm/Makefile` to restore the native Windows build 
   
   it means that use  `/`  in Windows native build as well as in Linux environment,  although In most cause should use `\` in Windows native build.
   
   `DELIM := $(strip /)` was removed from `libc/Makefile` and `mm/Makefile`  in #1088 and result use `\` libs in Windows native build in `libc/Makefile` and `mm/Makefile` ,which broke Windows native build and give an error:
   `makefile:132: *** target mode do not include“%”. stop.`



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020620602


##########
libs/libc/Makefile:
##########
@@ -115,7 +115,7 @@ endif
 BINDIR ?= bin
 
 AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
-COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
+COBJS = $(patsubst %.c, $(BINDIR)/%$(OBJEXT), $(CSRCS))

Review Comment:
   > Isn't this still the case for Windows?
   
   Windows is not a GNU environment, in Windows native build, we must use some GNU command(from GnuWin32) to support makefile, some special cases we must use `/` rather than Backslash.
   libs/libc/Makefile and mm/Makefile is the special cases,to resolve the probled in $(COBJS) target caused by backslash , we must use `/` in $(COBJS) of `libs/libc` and `mm` although In most cause we use `\` in Windows native build.
   
   please look at commit https://github.com/apache/incubator-nuttx/commit/e10ab85d1d39950d719a4bd7d2379c01d8c59a28
   **More changes to restore the native Windows build**
   
   gregroy add this two line:
   `# REVISIT: Backslash causes problems in $(COBJS) target`
   `DELIM := $(strip /)`
   in `libc/Makefile` and `mm/Makefile`
   
   it means that use  `/`  in Windows native build as well as in Linux environment,  although In most cause should use `\` in Windows native build.
   
   `DELIM := $(strip /)` was removed from `libc/Makefile` and `mm/Makefile`  in #1088 and result use `\` libs in Windows native build in `libc/Makefile` and `mm/Makefile` ,which broke Windows native build and give an error:
   `makefile:132: *** target mode do not include“%”. stop.`



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#issuecomment-1323736274

   I move the commit related to conflict to separate #7658 ,i think this PR is all right now @xiaoxiang781216 


-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020199752


##########
libs/libc/Makefile:
##########
@@ -194,9 +196,9 @@ distclean:: clean
 	$(Q) $(MAKE) -C kbin distclean
 	$(Q) $(MAKE) -C zoneinfo distclean BIN=$(BIN)
 	$(call DELFILE, exec_symtab.c)
-	$(call DELFILE, bin/Make.dep)
-	$(call DELFILE, kbin/Make.dep)
+	$(call DELFILE, bin$(DELIM)Make.dep)
+	$(call DELFILE, kbin$(DELIM)Make.dep)
 	$(call DELFILE, .depend)
 
--include bin/Make.dep
--include kbin/Make.dep
+-include bin$(DELIM)Make.dep

Review Comment:
   > Sorry for the confusion. It was more a general question not related to this line directly. I see many places that replace `DELIM` with `/`, so wondering why that is done?
   
   #1088 remove the line `DELIM := $(strip /)` in libs/libc/Makefile
   `
   # REVISIT: Backslash causes problems in $(COBJS) target
   DELIM := $(strip /)
   BINDIR ?= bin
   
   AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
   COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
   `
   
   And in Windows native build give an error:
   `makefile:132: *** target mode do not include“%”. stop.`
   
   ditto mm/Makefile



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020259241


##########
tools/mkdeps.c:
##########
@@ -443,12 +446,13 @@ static void parse_args(int argc, char **argv)
            * do_dependency() uses them as bare filenames as well.
            * (In addition to passing them to system().)
            */
-
+#ifndef CONFIG_WINDOWS_NATIVE
           if (group == 1)
             {
                arg = do_shquote(arg);

Review Comment:
   I'm not sure



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020214702


##########
tools/mkdeps.c:
##########
@@ -443,12 +446,13 @@ static void parse_args(int argc, char **argv)
            * do_dependency() uses them as bare filenames as well.
            * (In addition to passing them to system().)
            */
-
+#ifndef CONFIG_WINDOWS_NATIVE
           if (group == 1)
             {
                arg = do_shquote(arg);

Review Comment:
   it seems that in Windows native build gcc can only  identification option like this:
   `xxxxxxx-gcc.exe -fno-common -Wall -Wstrict-prototypes -Wshadow`
   rather than:
   `xxxxxxx-gcc.exe '-fno-common' '-Wall' '-Wstrict-prototypes' '-Wshadow'`



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1028219229


##########
libs/libc/Makefile:
##########
@@ -115,7 +115,7 @@ endif
 BINDIR ?= bin
 
 AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
-COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
+COBJS = $(patsubst %.c, $(BINDIR)/%$(OBJEXT), $(CSRCS))

Review Comment:
   I finally found out why Windows native build and give an error:
   makefile:132: *** target mode do not include“%”. stop.
   because in Windows environment `DELIM := $(strip \)` but `\` has two role in Windows environment:
   first: `\` as directory, and second `\` as Escape character
   In libc/Makefile and mm/Makefile
   `COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))`
   In Linux is OK, but  in Windows environment will use  `DELIM := $(strip \)` as Escape character and then `%` is just a characters not used for pattern.
   As described in: [https://www.gnu.org/software/make/manual/html_node/Text-Functions.html](url)
   we can use double `$(DELIM)` to solve problem, both Windows and Linux work 
   @xiaoxiang781216 @pkarashchenko 



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020246234


##########
libs/libc/Makefile:
##########
@@ -115,7 +115,7 @@ endif
 BINDIR ?= bin
 
 AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
-COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
+COBJS = $(patsubst %.c, $(BINDIR)/%$(OBJEXT), $(CSRCS))

Review Comment:
   look at commit e10ab85d1d39950d719a4bd7d2379c01d8c59a28
   **_More changes to restore the native Windows build_** 
   @patacongo 
   add this two line:
   `# REVISIT: Backslash causes problems in $(COBJS) target`
   `DELIM := $(strip /)`
   I think he knows why?



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020236729


##########
libs/libc/Makefile:
##########
@@ -115,7 +115,7 @@ endif
 BINDIR ?= bin
 
 AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
-COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
+COBJS = $(patsubst %.c, $(BINDIR)/%$(OBJEXT), $(CSRCS))

Review Comment:
   #1088 remove the line `DELIM := $(strip /)` in libs/libc/Makefile
   
   `# REVISIT: Backslash causes problems in $(COBJS) target`
   `DELIM := $(strip /)`
   `BINDIR ?= bin`
   
   `AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))`
   `COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))`
   
   And in Windows native build give an error:
   `makefile:132: *** target mode do not include“%”. stop.`
   



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020199752


##########
libs/libc/Makefile:
##########
@@ -194,9 +196,9 @@ distclean:: clean
 	$(Q) $(MAKE) -C kbin distclean
 	$(Q) $(MAKE) -C zoneinfo distclean BIN=$(BIN)
 	$(call DELFILE, exec_symtab.c)
-	$(call DELFILE, bin/Make.dep)
-	$(call DELFILE, kbin/Make.dep)
+	$(call DELFILE, bin$(DELIM)Make.dep)
+	$(call DELFILE, kbin$(DELIM)Make.dep)
 	$(call DELFILE, .depend)
 
--include bin/Make.dep
--include kbin/Make.dep
+-include bin$(DELIM)Make.dep

Review Comment:
   > Sorry for the confusion. It was more a general question not related to this line directly. I see many places that replace `DELIM` with `/`, so wondering why that is done?
   
   #1088 remove the line `DELIM := $(strip /)` in libs/libc/Makefile
   `# REVISIT: Backslash causes problems in $(COBJS) target
   DELIM := $(strip /)
   BINDIR ?= bin
   
   AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
   COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))`
   in Windows native build give an error:
   `makefile:132: *** target mode do not include“%”。 stop。`
   
   ditto mm/Makefile



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020620602


##########
libs/libc/Makefile:
##########
@@ -115,7 +115,7 @@ endif
 BINDIR ?= bin
 
 AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
-COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
+COBJS = $(patsubst %.c, $(BINDIR)/%$(OBJEXT), $(CSRCS))

Review Comment:
   > Isn't this still the case for Windows?
   
   Windows is not a GNU environment, in Windows native build, we must use some GNU command(from GnuWin32) to support makefile, some special cases we must use `/` rather than Backslash.
   libs/libc/Makefile and mm/Makefile is the special cases,to resolve the probled in $(COBJS) target caused by backslash , we must use `/` in $(COBJS) of `libs/libc` and `mm` although In most cause we use `\` in Windows native build.
   
   please look at commit https://github.com/apache/incubator-nuttx/commit/e10ab85d1d39950d719a4bd7d2379c01d8c59a28
   **More changes to restore the native Windows build**
   
   gregroy add this two line **especially**:
   `# REVISIT: Backslash causes problems in $(COBJS) target`
   `DELIM := $(strip /)`
   in `libc/Makefile` and `mm/Makefile` to restore the native Windows build 
   
   it means that use  `/`  in Windows native build as well as in Linux environment,  although In most cause should use `\` in Windows native build.
   
   `DELIM := $(strip /)` was removed from `libc/Makefile` and `mm/Makefile`  in #1088 and result use `\` libs in Windows native build in `libc/Makefile` and `mm/Makefile` ,which broke Windows native build and give an error:
   `makefile:132: *** target mode do not include“%”. stop.`



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020246234


##########
libs/libc/Makefile:
##########
@@ -115,7 +115,7 @@ endif
 BINDIR ?= bin
 
 AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
-COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
+COBJS = $(patsubst %.c, $(BINDIR)/%$(OBJEXT), $(CSRCS))

Review Comment:
   look at commit e10ab85d1d39950d719a4bd7d2379c01d8c59a28
   **_More changes to restore the native Windows build_** 
   
   gregroy add this two line:
   `# REVISIT: Backslash causes problems in $(COBJS) target`
   `DELIM := $(strip /)`
   in libc/Makefile
   I think Mr.  @patacongo knows why?



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/nuttx/pull/7572#discussion_r1034208088


##########
libs/libc/Makefile:
##########
@@ -114,8 +114,8 @@ endif
 
 BINDIR ?= bin
 
-AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
-COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
+AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)$(DELIM)%$(OBJEXT), $(ASRCS))

Review Comment:
   In Windows environment` DELIM := \ `but`\`has two role in Windows environment:
   first: `\` as directory separator, and second `\` as Escape character
   in Windows environment:
   `COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))`
   equivalent to
   `COBJS = $(patsubst %.c, $(BINDIR)\%$(OBJEXT), $(CSRCS))`
   and the `\` of `\%` was identified to be Escape character, which result the `% `was identified to be ordinary characters and not used for pattern. and then result the error: `makefile:132: *** target mode do not include“%”. stop.`
   As described in: [https://www.gnu.org/software/make/manual/html_node/Text-Functions.html](url)
   we can use double $(DELIM) to solve problem
   `COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)$(DELIM)%$(OBJEXT), $(CSRCS))`
   equivalent to
   `COBJS = $(patsubst %.c, $(BINDIR)\\%$(OBJEXT), $(CSRCS))`
   the first `\` of `\\%` Escape the second `\` as ordinary characters, so that  `%` used as pattern, there's no extra problem use `\\%` in Linux as tested.



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7572:
URL: https://github.com/apache/nuttx/pull/7572#discussion_r1033693887


##########
tools/Config.mk:
##########
@@ -393,11 +393,18 @@ endef
 # ARCHIVE - Same as above, but ensure the archive is
 # created from scratch
 
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+define ARCHIVE
+	$(Q) $(RM) $1
+	$(Q) $(AR) $1 $(2)
+endef
+else
 define ARCHIVE
 	@echo "AR (create): ${shell basename $(1)} $(2)"

Review Comment:
   BTW, why line 389 doesn't hit the similar issue on Windows?



##########
tools/Config.mk:
##########
@@ -393,11 +393,18 @@ endef
 # ARCHIVE - Same as above, but ensure the archive is
 # created from scratch
 
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+define ARCHIVE
+	$(Q) $(RM) $1
+	$(Q) $(AR) $1 $(2)
+endef
+else
 define ARCHIVE
 	@echo "AR (create): ${shell basename $(1)} $(2)"

Review Comment:
   can we change to:
   @echo "AR(create): $(1) $(2)"
   to avoid the duplication.



##########
libs/libc/Makefile:
##########
@@ -114,8 +114,8 @@ endif
 
 BINDIR ?= bin
 
-AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
-COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
+AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)$(DELIM)%$(OBJEXT), $(ASRCS))

Review Comment:
   it's strange that two $(DELIM) are required here.



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020214702


##########
tools/mkdeps.c:
##########
@@ -443,12 +446,13 @@ static void parse_args(int argc, char **argv)
            * do_dependency() uses them as bare filenames as well.
            * (In addition to passing them to system().)
            */
-
+#ifndef CONFIG_WINDOWS_NATIVE
           if (group == 1)
             {
                arg = do_shquote(arg);

Review Comment:
   it seems that in Windows native build gcc can only  identification option like this:
   `xxxxxxx-gcc.exe -fno-common: -Wall -Wstrict-prototypes -Wshadow`
   rather than:
   `xxxxxxx-gcc.exe '-fno-common '-Wall '-Wstrict-prototypes' '-Wshadow'`



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020229249


##########
libs/libc/Makefile:
##########
@@ -194,9 +196,9 @@ distclean:: clean
 	$(Q) $(MAKE) -C kbin distclean
 	$(Q) $(MAKE) -C zoneinfo distclean BIN=$(BIN)
 	$(call DELFILE, exec_symtab.c)
-	$(call DELFILE, bin/Make.dep)
-	$(call DELFILE, kbin/Make.dep)
+	$(call DELFILE, bin$(DELIM)Make.dep)

Review Comment:
   why mix / and $(DELIM)



##########
libs/libc/Makefile:
##########
@@ -115,7 +115,7 @@ endif
 BINDIR ?= bin
 
 AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
-COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
+COBJS = $(patsubst %.c, $(BINDIR)/%$(OBJEXT), $(CSRCS))

Review Comment:
   why not use $(DELIM)



##########
tools/mkdeps.c:
##########
@@ -443,12 +446,13 @@ static void parse_args(int argc, char **argv)
            * do_dependency() uses them as bare filenames as well.
            * (In addition to passing them to system().)
            */
-
+#ifndef CONFIG_WINDOWS_NATIVE
           if (group == 1)
             {
                arg = do_shquote(arg);

Review Comment:
   If so, let's remove quote for linux too?



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] Gary-Hobson commented on pull request #7572: tools: Fix various error in Windows native build

Posted by "Gary-Hobson (via GitHub)" <gi...@apache.org>.
Gary-Hobson commented on PR #7572:
URL: https://github.com/apache/nuttx/pull/7572#issuecomment-1410578628

   @zouboan  In the ubuntu environment, there are two separators for some information compiled and output using Make V=1
   
   Is it necessary? Is there a way to remove
   
   ```sh
   arm-none-eabi-ar rcs  libc.a    bin//lib_assert.o  bin//lib_builtin_getname.o  bin//lib_builtin_isavail.o  bin//lib_builtin_forindex.o
   ```


-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020620602


##########
libs/libc/Makefile:
##########
@@ -115,7 +115,7 @@ endif
 BINDIR ?= bin
 
 AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
-COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
+COBJS = $(patsubst %.c, $(BINDIR)/%$(OBJEXT), $(CSRCS))

Review Comment:
   > Isn't this still the case for Windows?
   
   Windows is not a GNU environment, in Windows native build, we must use some GNU command(from GnuWin32) to support makefile, some special cases we must use `/` rather than Backslash.
   libs/libc/Makefile and mm/Makefile is the special cases,to resolve the  in $(COBJS) target caused by backslash , we must use `/` in $(COBJS) of `libs/libc` and `mm` although In most cause we use `\` in Windows native build.
   
   please look at commit https://github.com/apache/incubator-nuttx/commit/e10ab85d1d39950d719a4bd7d2379c01d8c59a28
   **More changes to restore the native Windows build**
   
   gregroy add this two line:
   `# REVISIT: Backslash causes problems in $(COBJS) target`
   `DELIM := $(strip /)`
   in `libc/Makefile` and `mm/Makefile`
   
   it means that use  `/`  in Windows native build as well as in Linux environment,  although In most cause should use `\` in Windows native build.
   
   `DELIM := $(strip /)` was removed from `libc/Makefile` and `mm/Makefile`  in #1088 and result use `\` libs in Windows native build in `libc/Makefile` and `mm/Makefile` ,which broke Windows native build and give an error:
   `makefile:132: *** target mode do not include“%”. stop.`



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#issuecomment-1312433462

   > why not use (Q)ifexist(1) (del /f /q $(1)) in Windows native build
   
   if $1 contain too many member, `if exist $1`will give an error: `Input line is too long` in Windows native build.  this is a windows characteristic:
   1. In Command Prompt, the total length of the following command line can't contain more than 8191 characters;
   2. In a batch file, the total length of the following command line can't contain more than 8191 characters;
   [https://learn.microsoft.com/en-US/troubleshoot/windows-client/shell-experience/command-line-string-limitation](url)
   [https://learn.microsoft.com/en-US/troubleshoot/windows-client/shell-experience/command-line-string-limitation](url)


-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1019704084


##########
libs/libc/Makefile:
##########
@@ -194,9 +196,9 @@ distclean:: clean
 	$(Q) $(MAKE) -C kbin distclean
 	$(Q) $(MAKE) -C zoneinfo distclean BIN=$(BIN)
 	$(call DELFILE, exec_symtab.c)
-	$(call DELFILE, bin/Make.dep)
-	$(call DELFILE, kbin/Make.dep)
+	$(call DELFILE, bin$(DELIM)Make.dep)
+	$(call DELFILE, kbin$(DELIM)Make.dep)
 	$(call DELFILE, .depend)
 
--include bin/Make.dep
--include kbin/Make.dep
+-include bin$(DELIM)Make.dep

Review Comment:
   Sorry for the confusion. It was more a general question not related to this line directly. I see many places that replace `DELIM` with `/`, so wondering why that is done?



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020199752


##########
libs/libc/Makefile:
##########
@@ -194,9 +196,9 @@ distclean:: clean
 	$(Q) $(MAKE) -C kbin distclean
 	$(Q) $(MAKE) -C zoneinfo distclean BIN=$(BIN)
 	$(call DELFILE, exec_symtab.c)
-	$(call DELFILE, bin/Make.dep)
-	$(call DELFILE, kbin/Make.dep)
+	$(call DELFILE, bin$(DELIM)Make.dep)
+	$(call DELFILE, kbin$(DELIM)Make.dep)
 	$(call DELFILE, .depend)
 
--include bin/Make.dep
--include kbin/Make.dep
+-include bin$(DELIM)Make.dep

Review Comment:
   > Sorry for the confusion. It was more a general question not related to this line directly. I see many places that replace `DELIM` with `/`, so wondering why that is done?
   
   #1088 remove the line `DELIM := $(strip /)`
   `# REVISIT: Backslash causes problems in $(COBJS) target
   DELIM := $(strip /)
   BINDIR ?= bin
   
   AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
   COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))`
   in Windows native build give an error:
   `makefile:132: *** target mode do not include“%”。 stop。`
   
   ditto mm/Makefile



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020214702


##########
tools/mkdeps.c:
##########
@@ -443,12 +446,13 @@ static void parse_args(int argc, char **argv)
            * do_dependency() uses them as bare filenames as well.
            * (In addition to passing them to system().)
            */
-
+#ifndef CONFIG_WINDOWS_NATIVE
           if (group == 1)
             {
                arg = do_shquote(arg);

Review Comment:
   it seems that in Windows native build gcc can only  identification option like this:
   `xxxxxxx-gcc.exe -fno-common -Wall -Wstrict-prototypes -Wshadow`
   rather than:
   `xxxxxxx-gcc.exe '-fno-common '-Wall '-Wstrict-prototypes' '-Wshadow'`



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020246234


##########
libs/libc/Makefile:
##########
@@ -115,7 +115,7 @@ endif
 BINDIR ?= bin
 
 AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
-COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
+COBJS = $(patsubst %.c, $(BINDIR)/%$(OBJEXT), $(CSRCS))

Review Comment:
   look at commit e10ab85d1d39950d719a4bd7d2379c01d8c59a28
   **_More changes to restore the native Windows build_** 
   
   gregroy add this two line:
   `# REVISIT: Backslash causes problems in $(COBJS) target`
   `DELIM := $(strip /)`
   in libc/Makefile
   I think he @patacongo knows why?



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#issuecomment-1322295566

   > @zouboan please rebase your change to remove the merging patch and the conflict.
   
   it seems the conflict was resolved?


-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/nuttx/pull/7572#discussion_r1034732996


##########
tools/Config.mk:
##########
@@ -393,11 +393,18 @@ endef
 # ARCHIVE - Same as above, but ensure the archive is
 # created from scratch
 
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+define ARCHIVE
+	$(Q) $(RM) $1
+	$(Q) $(AR) $1 $(2)
+endef
+else
 define ARCHIVE
 	@echo "AR (create): ${shell basename $(1)} $(2)"

Review Comment:
   L389:
   `define ARCHIVE_ADD
   	@echo "AR (add): ${shell basename $(1)} $(2)"
   	$(Q) $(AR) $1 $(2)
   endef`
   `ARCHIVE_ADD ` was used to archive file to `$1` one by one, so `$(2)` didn't contain too many object, and will not give too long input line error



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] xiaoxiang781216 merged pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #7572:
URL: https://github.com/apache/nuttx/pull/7572


-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7572:
URL: https://github.com/apache/nuttx/pull/7572#discussion_r1033692573


##########
tools/Config.mk:
##########
@@ -393,11 +393,18 @@ endef
 # ARCHIVE - Same as above, but ensure the archive is
 # created from scratch
 
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+define ARCHIVE
+	$(Q) $(RM) $1
+	$(Q) $(AR) $1 $(2)
+endef
+else
 define ARCHIVE
 	@echo "AR (create): ${shell basename $(1)} $(2)"

Review Comment:
   can we change to:
   ```
   @echo "AR(create): $(1) $(2)"
   ```
   to avoid the duplication.



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020620602


##########
libs/libc/Makefile:
##########
@@ -115,7 +115,7 @@ endif
 BINDIR ?= bin
 
 AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
-COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
+COBJS = $(patsubst %.c, $(BINDIR)/%$(OBJEXT), $(CSRCS))

Review Comment:
   > Isn't this still the case for Windows?
   
   Windows is not a GNU environment, in Windows native build, we must use some GNU command(from GnuWin32) to support makefile, some special cases we must use `/` rather than Backslash.
   libs/libc/Makefile and mm/Makefile is the special cases,to resolve the  in $(COBJS) target caused by backslash , we must use `/` in $(COBJS) of `libs/libc` and `mm` although In most cause we use `\` in Windows native build.
   
   please look at commit https://github.com/apache/incubator-nuttx/commit/e10ab85d1d39950d719a4bd7d2379c01d8c59a28
   **More changes to restore the native Windows build**
   
   gregroy add this two line:
   `# REVISIT: Backslash causes problems in $(COBJS) target`
   `DELIM := $(strip /)`
   in `libc/Makefile` and `mm/Makefile`
   
   it means that use  `/`  in Windows native build as well as in LInux environment,  although In most cause should use `\` in Windows native build.
   
   `DELIM := $(strip /)` was removed from `libc/Makefile` and `mm/Makefile`  in #1088 and result use `\` libs in Windows native build in `libc/Makefile` and `mm/Makefile` ,which broke Windows native build and give an error:
   `makefile:132: *** target mode do not include“%”. stop.`



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1019430239


##########
tools/mkdeps.c:
##########
@@ -443,12 +446,13 @@ static void parse_args(int argc, char **argv)
            * do_dependency() uses them as bare filenames as well.
            * (In addition to passing them to system().)
            */
-
+#ifndef CONFIG_WINDOWS_NATIVE
           if (group == 1)
             {
                arg = do_shquote(arg);

Review Comment:
   `'-fno-common': No such file or directory sparc-elf-gcc: '-Wall': No such file or directory sparc-elf-gcc: '-Wstrict-prototypes': No such file or directory sparc-elf-gcc: '-Wshadow': No such file or directory sparc-elf-gcc: '-Wundef': No such file or directory sparc-elf-gcc: '-fomit-frame-pointer': No such file or directory sparc-elf-gcc: '-g': No such file or directory sparc-elf-gcc: '-mcpu=leon': No such file or directory sparc-elf-gcc: '-isystem': No such file or directory`



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1019425708


##########
tools/mkdeps.c:
##########
@@ -443,12 +446,13 @@ static void parse_args(int argc, char **argv)
            * do_dependency() uses them as bare filenames as well.
            * (In addition to passing them to system().)
            */
-
+#ifndef CONFIG_WINDOWS_NATIVE
           if (group == 1)
             {
                arg = do_shquote(arg);

Review Comment:
   what's error here?



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020205585


##########
tools/mkdeps.c:
##########
@@ -443,12 +446,13 @@ static void parse_args(int argc, char **argv)
            * do_dependency() uses them as bare filenames as well.
            * (In addition to passing them to system().)
            */
-
+#ifndef CONFIG_WINDOWS_NATIVE
           if (group == 1)
             {
                arg = do_shquote(arg);

Review Comment:
   do_shquote just add ", it's strange that it can make this error



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] zouboan commented on a diff in pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
zouboan commented on code in PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#discussion_r1020236729


##########
libs/libc/Makefile:
##########
@@ -115,7 +115,7 @@ endif
 BINDIR ?= bin
 
 AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))
-COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))
+COBJS = $(patsubst %.c, $(BINDIR)/%$(OBJEXT), $(CSRCS))

Review Comment:
   #1088 remove the line `DELIM := $(strip /)` in libs/libc/Makefile
   
   `# REVISIT: Backslash causes problems in $(COBJS) target`
   `DELIM := $(strip /)`
   `BINDIR ?= bin`
   
   `AOBJS = $(patsubst %.S, $(BINDIR)$(DELIM)%$(OBJEXT), $(ASRCS))`
   `COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS))`
   
   And in Windows native build give an error:
   `makefile:132: *** target mode do not include“%”. stop.`
   
   on
   `$(COBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.c`
   `	$(call COMPILE, $<, $@)`



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #7572: tools: Fix various error in Windows native build

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #7572:
URL: https://github.com/apache/incubator-nuttx/pull/7572#issuecomment-1322277013

   @zouboan please rebase your change to remove the merging patch and the conflict.


-- 
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-unsubscribe@nuttx.apache.org

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