Using {} in an in-line script that you execute through find is a code injection vulnerability. Don't do that. The first argument to sh -c (the script) should be single quoted and the arguments to that script should be passed on its command line.
Instead, write the find command as something like the following (uses bash instead of sh to be able to use ${parameter//pattern/word} in one place):
find stdlib/main -type f -exec bash -c '
for pathname do
string=${pathname#stdlib/main/} # delete initial path
string=${string%.*} # delete suffix after last dot
string=${string////.} # change slashes to dots
# output:
printf "resource:\"%s,%s\"\n" "$pathname" "$string"
done' bash {} +
Instead of using sed, this uses parameter substitutions to modify the pathnames found by find. The in-line bash script will be executed for batches of found files and will iterate over the pathnames in each batch. The printf would output the data transformed in the same way as what your sed command is doing (if I managed to decipher it correctly, it wasn't just what you described).
How you later cope with filenames containing double quotes and commas is another issue (the output string after resource: would potentially be difficult to parse).
It would be easiest to put the find command into a separate script and call that from GNU make in $(shell ...), or you'll end up with something like
STDLIB_RESOURCES := $(shell \
find stdlib/main -type f -exec bash -c ' \
for p do \
s=$${p\#stdlib/main/}; \
s=$${s%.*}; \
s=$${s////.}; \
printf "resource:\"%s,%s\"\n" "$$p" "$$s"; \
done' bash {} + )
in your Makefile (due to the way GNU make handles variables etc.) Also note the :=. You need this for the command to be executed immediately upon assigning to the variable, not every time the variable is accessed.
Related: