Re: GTK+ (embarrassing) Makefile question...
- From: rsteinke w-link net
- To: seberino spawar navy mil, gtk-list gnome org
- Subject: Re: GTK+ (embarrassing) Makefile question...
- Date: Wed, 27 Mar 2002 10:13:33 -0800
From: Christian Seberino <seberino spawar navy mil>
> This Makefile will recreate GTK+ object file if header file
> is "touched" with touch command which is good....
> It will NOT recreate object file when *.cpp file is
> "touched" the same way.
> WHY IS the "%.o: %.h" rule working
> but the "%.o: %.cpp" rule IS NOT!!??!?!?
> Here is makefile...
> %.o: %.h
> $(CPPC) $(FLAGS) -c $*.cpp
> %.o: %.cpp
> $(CPPC) $(FLAGS) -c $<
While you are allowed to have more than one dependency for a file, you are not
allowed to have more than one rule on how to build that file. What you need is:
%.o: %.h %.cpp
$(CPPC) $(FLAGS) -c $*.cpp
BTW, this isn't really a gtk+ specific question. This would be more
appropriate on a discussion list for "make".
] [Thread Prev