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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org