Build & execute by simply typing `make`
```
SRC = dummy.c
OBJ = $(SRC:.c=.o)
EXE = dummy

all: $(EXE)
        @./$(EXE)

.c.o:
        $(CC) -c $(CFLAGS) $<

$(EXE): $(OBJ)
        $(CC) -o $(EXE) $(OBJ) $(LDFLAGS)

```


On Thu, Jan 7, 2016 at 7:08 PM, Greg Reagle <greg.rea...@umbc.edu> wrote:
> On Thu, Jan 07, 2016 at 05:22:38PM -0800, Louis Santillan wrote:
>> Do mean something like this in a makefile?  Essentially adding a
>> `./$@` to end of `dwm` target:
>
> I tried it and it does not seem to be a solution.  If dwm is up to date,
> Make won't run the recipe and ./$@ won't be run.  So you have to use 'make
> dwm; ./dwm' every time, in which case, there is no need to modify the
> Makefile.
>

Reply via email to