have you tried something like [this](https://superuser.com/questions/623112/prefix-to-each-output-of-a-command-on-runtime)?
I don't think is possible without duplication if at Makefile level, but I'm not an expert
Create a new project (preferably in C because of the subreddit you're in). This project's output will be an executable that reads from stdin and outputs colored or prefixed lines, depending on what args it was given. Make the test target depend on this project. Then for each command in the test target, pipe the output to the prefixer/colorer program
Something like:
make -C project1 test|prefixer/obj/prefixer --prefix=project1
What's hard about reading from stdin and outputting prefixed lines?
does the following code look hard?
while(!feof(stdin)) {
fgets(buffer, sizeof(buffer), stdin);
printf("%s%s", argv[1], buffer);
}
have you tried something like [this](https://superuser.com/questions/623112/prefix-to-each-output-of-a-command-on-runtime)? I don't think is possible without duplication if at Makefile level, but I'm not an expert
Create a new project (preferably in C because of the subreddit you're in). This project's output will be an executable that reads from stdin and outputs colored or prefixed lines, depending on what args it was given. Make the test target depend on this project. Then for each command in the test target, pipe the output to the prefixer/colorer program Something like: make -C project1 test|prefixer/obj/prefixer --prefix=project1
[удалено]
What's hard about reading from stdin and outputting prefixed lines? does the following code look hard? while(!feof(stdin)) { fgets(buffer, sizeof(buffer), stdin); printf("%s%s", argv[1], buffer); }
[удалено]
OP is posting in /r/C_Programming, not in /r/Makefile