make always rebuild

Posted by fsdfa on Stack Overflow See other posts from Stack Overflow or by fsdfa
Published on 2010-04-18T00:27:07Z Indexed on 2010/04/18 0:33 UTC
Read the original article Hit count: 249

Filed under:
|

My Makefile is:

OBJS = b.o c.o a.o
FLAGS = -Wall -Werror
CC = gcc

test: $(OBJS)
    $(CC) $(FLAGS) $(OBJS) -o a
b.o: b.c b.h
    $(CC) $(FLAGS) -c b.c
a.o: a.c b.h c.h
    $(CC) $(FLAGS) -c a.c
c.o: c.c c.h
    $(CC) $(FLAGS) -c c.c
clean:
    rm a
    rm *.o
all: test

If I do make then make again, it always rebuilds 'test'. Why does it do this?

© Stack Overflow or respective owner

Related posts about make

    Related posts about makefile