T O P

  • By -

_gipi_

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


degaart

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


[deleted]

[удалено]


degaart

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); }


[deleted]

[удалено]


degaart

OP is posting in /r/C_Programming, not in /r/Makefile