zouboan commented on code in PR #1407: URL: https://github.com/apache/nuttx-apps/pull/1407#discussion_r1038192710
########## Make.defs: ########## @@ -85,14 +80,24 @@ endif BUILTIN_REGISTRY = $(APPDIR)$(DELIM)builtin$(DELIM)registry DEPCONFIG = $(TOPDIR)$(DELIM).config +ifeq ($(CONFIG_WINDOWS_NATIVE),y) define REGISTER $(Q) echo Register: $1 - $(Q) echo { \"$1\", $2, $3, $4 }, > "$(BUILTIN_REGISTRY)$(DELIM)$1.bdat" + $(Q) echo { "$(subst ",,$(1))", $2, $3, $(subst ",,$(4)) }, > "$(BUILTIN_REGISTRY)$(DELIM)$1.bdat" + $(Q) echo int $(subst ",,$(4))(int argc, char *argv[]); > "$(BUILTIN_REGISTRY)$(DELIM)$1.pdat" + + $(Q) touch $(BUILTIN_REGISTRY)$(DELIM).updated" +endef +else +define REGISTER + $(Q) echo "Register: $1" + $(Q) echo "{ \"$1\", $2, $3, $4 }," > "$(BUILTIN_REGISTRY)$(DELIM)$1.bdat" Review Comment: In Windows: `echo aaaaaaaaaaa `result `aaaaaaaaaaa` `echo 'bbbbbb'` result `'bbbbbb'` `echo "ccccccccc"` result `"ccccccccc"` so: `echo "int nsh_main(int argc, char *argv[]);" > "$(BUILTIN_REGISTRY)$(DELIM)nsh.pdat";` result `"int nsh_main(int argc, char *argv[]);"` in nsh.pdat, and will give an build error. what's more nsh name generated by Kconfig is "nsh" in ../apps/system/nsh/Makefile: `PROGNAME = $(CONFIG_SYSTEM_NSH_PROGNAME) sh` in ../apps/example/hello/Makefile: `PROGNAME = $(CONFIG_EXAMPLES_HELLO_PROGNAME)` and CONFIG_EXAMPLES_HELLO_PROGNAME in Kconfig is "hello" which result the parameter $(4) of function REGISTER in ../apps/Make.defs are: "nsh" sh "hello" ,we have use $(subst ",,$(4)) to strip "" for Windows I tried to use : ``` $(Q) echo { "$(subst ",,$(1))", $2, $3, $(subst ",,$(4)) }, > "$(BUILTIN_REGISTRY)$(DELIM)$1.bdat" $(Q) echo int $(subst ",,$(4))(int argc, char *argv[]); > "$(BUILTIN_REGISTRY)$(DELIM)$1.pdat" ``` but failed, may be we need more tricks 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org