Under "one command," I assume that OP means invoking only one binary from the command line.
In one line: yes; see other answers.
In one command: required - you can use some make implicit rules and insert your own run rule through bash here is the line:
$ ls hello* *ake* ls: cannot access *ake*: No such file or directory hello.c $ cat hello.c #include <stdio.h> int main (int argc, char **argv) { printf("%s %s\n", "hello", "world"); return (0); } $ make hello.run -f - <<< 'hello.run: hello; ./$<' cc hello.c -o hello ./hello hello world $
source share