d33tah
d33tah

Reputation: 11569

Why does GNU make think that the target is always out of date?

Here is preeny's Makefile:

COMMON_DEPS=logging.c
PLATFORM?=

all: desock.so defork.so dealarm.so patch.so derand.so desrand.so deptrace.so desock_dup.so

desock.so: desock.c $(COMMON_DEPS)
    bash build_so.sh $@ $(PLATFORM) $^ -lpthread

desock_dup.so: desock_dup.c $(COMMON_DEPS)
    bash build_so.sh $@ $(PLATFORM) $^ -ldl

defork.so: defork.c $(COMMON_DEPS)
    bash build_so.sh $@ $(PLATFORM) $^

dealarm.so: dealarm.c $(COMMON_DEPS)
    bash build_so.sh $@ $(PLATFORM) $^

derand.so: derand.c $(COMMON_DEPS)
    bash build_so.sh $@ $(PLATFORM) $^

desrand.so: desrand.c $(COMMON_DEPS)
    bash build_so.sh $@ $(PLATFORM) $^ -ldl

deptrace.so: deptrace.c $(COMMON_DEPS)
    bash build_so.sh $@ $(PLATFORM) $^

patch.so: patch.c $(COMMON_DEPS)
    bash build_so.sh $@ $(PLATFORM) $^ -lini_config

clean:
    rm -f *.o
    rm -f *.so

For some reason, all .so files are rebuilt every time I call make even if I make no changes to source files. Why is that?

Source: https://github.com/zardus/preeny/blob/b5d8b9/src/Makefile

Upvotes: 0

Views: 557

Answers (1)

d33tah
d33tah

Reputation: 11569

It's because the target doesn't exist. The results are immediately moved to ../$ARCH and the targets mention the current directory.

Upvotes: 1

Related Questions