linuxmakefilegnu-makelinux-scst

What is the purpose of "ifeq (a,$(wildcard .a))" in makefile?


ifeq (.depend_f,$(wildcard .depend_f))
-include .depend_f
endif

it is a makefile in scst fileio , I think maybe just using -include is okay , why we need to use "ifeq (.depend_f,$(wildcard .depend_f))" ?


Solution

  • Well, first of all you don't need the ifeq you can just write:

    -include $(wildcard .depend_f)
    

    We can't really know the reason to do this without seeing the rest of the makefile. The big reason to do this is that if you write -include .depend_f then make will try to rebuild the .depend_f file and re-exec itself if it can be updated. Maybe the author didn't want that to happen.