List Info

Thread: Help about "Include" in Makefile




Help about "Include" in Makefile
country flaguser name
Hong Kong
2007-06-27 02:15:48
I have write a makefile like this:

OBJS = $(patsubst %.cpp ,%.o,$(CPP))
DEPS = $(patsubst %.cpp ,%.d,$(CPP))

all : $(OBJS) $(DEPS)

%.o : %.cpp
...

%.d : %.cpp
...

-include $(DEPS)

clean:
    rm -f $(OBJS)
    rm -f $(DEPS)

we do make it will first generate the depend files (.d
files);

but when i do make clean, it also generate depend file
before doing
clean. what can i do to avoid this uncessary

operation!


Re: Help about "Include" in Makefile
user name
2007-07-01 01:14:54
Hello,

* blippman wrote on Wed, Jun 27, 2007 at 09:15:48AM CEST:
> I have write a makefile like this:
> 
> OBJS = $(patsubst %.cpp ,%.o,$(CPP))
> DEPS = $(patsubst %.cpp ,%.d,$(CPP))
> 
> all : $(OBJS) $(DEPS)

> ...
> %.d : %.cpp
> ...
> 
> -include $(DEPS)
> 
> clean:
>     rm -f $(OBJS)
>     rm -f $(DEPS)
> 
> we do make it will first generate the depend files (.d
files);
> 
> but when i do make clean, it also generate depend file
before doing
> clean. what can i do to avoid this uncessary
operation!

Well, you could use Automake to compute your dependencies,
or a similar
technique to the one Automake uses.  It generates at the end
of
configure a set of stub dependency files.

Cheers,
Ralf



[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )