Kobi T Kobi T - 10 days ago 5
C Question

Makefile - behavior without additional arguments

How can I define the behavior of running

make
with no additional arguments?

I tried to do something like:

:
./someprogram
.PHONY:


In order to run
someprogram
in case of running
make
without arguments but I get the following error:
Makefile:5: *** missing separator. Stop.

Answer

Your makefile should look something as below:

all:
    @echo Running test program
    ./someprogram
    @echo program ended..

.PHONY:all
Comments