0
這裏是preeny的Makefile:爲什麼GNU認爲目標總是過時?
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 [email protected] $(PLATFORM) $^ -lpthread
desock_dup.so: desock_dup.c $(COMMON_DEPS)
bash build_so.sh [email protected] $(PLATFORM) $^ -ldl
defork.so: defork.c $(COMMON_DEPS)
bash build_so.sh [email protected] $(PLATFORM) $^
dealarm.so: dealarm.c $(COMMON_DEPS)
bash build_so.sh [email protected] $(PLATFORM) $^
derand.so: derand.c $(COMMON_DEPS)
bash build_so.sh [email protected] $(PLATFORM) $^
desrand.so: desrand.c $(COMMON_DEPS)
bash build_so.sh [email protected] $(PLATFORM) $^ -ldl
deptrace.so: deptrace.c $(COMMON_DEPS)
bash build_so.sh [email protected] $(PLATFORM) $^
patch.so: patch.c $(COMMON_DEPS)
bash build_so.sh [email protected] $(PLATFORM) $^ -lini_config
clean:
rm -f *.o
rm -f *.so
出於某種原因,所有的.so文件被重建每次我打電話make
時間,即使我不會更改源文件。這是爲什麼?
來源:https://github.com/zardus/preeny/blob/b5d8b9/src/Makefile
確實。這是[Makefile的規則]的規則2(http://make.mad-scientist.net/papers/rules-of-makefiles/#rule2)(GNU make維護者的規則)。 –