help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

name of makefile being processed


From: Dan DeJohn
Subject: name of makefile being processed
Date: Wed, 07 Aug 2002 10:25:25 -0400

Is there a way to refer to the name of the makefile from the makefile itself?

I need to rebuild a particular library if the makefile itself changes, in case additional object files are added to the list GEN_OBJ. Right now, I specify the path to the makefile as a prerequisite, which works OK, but will break if the makefile gets moved or renamed.

GEN_OBJ = a.o b.o c.o

$(GENLIB) : $(RDEV)/src/GNUmakefile $(GEN_OBJ)
           @$(RM) $(GENLIB)
           @$(AR) $(ARFLAGS) $(GENLIB) $(filter %.o,$^)

I'd really like to replace the $(RDEV)/src/GNUmakefile with something that evaluates to the name of the makefile being processed:

$(GENLIB) : $(MAKEFILE) $(GEN_OBJ)
           @$(RM) $(GENLIB)
           @$(AR) $(ARFLAGS) $(GENLIB) $(filter %.o,$^)

--
Dan DeJohn
address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]