I have this
SRC = file1.c file2.c file3.c
How do I make it into
file1.c + file2.c + file3.c
The closest I can get is (note the ‘+’ sign at the end)
file1.c + file2.c + file3.c +
using
SRC2 := $(SRC:.c=.c +)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s one way to do it:
That is, peel off the first word, then unconditionally add each additional word with the “+” prefix.
Here’s another, only works if you’re sure you have exactly one space between each word in
SRC.This time the idea is to replace a single space character with the sequence space-plus-space. Make sure you don’t have a space between the comma and
$(SRC)!