Skip to content
Prev 20492 / 63421 Next

Force action in package install?

On May 2, 2006, at 12:09 PM, Duncan Murdoch wrote:

            
I don't think that's supported at all. I have successfully used this  
VeryUglyHack(TM) in the package's Makevars:

OBJECTS=dummy.o real1.o real2.o

dummy.o: myExtraTarget
	echo "" > dummy.c
	$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c dummy.c -o $@

where real1.o and real2.o are real object files that have  
corresponding sources and dummy.c is a non-existent file thus forcing  
make to use my extra target. This hack exploits the fact that SHLIB  
will let Makevars override the objects list (the above is not the  
exact application I use, but the essence of the idea).

I agree that it would be great to add something like $(EXTRA_TARGETS)  
to SHLIB such that Makevars can define extra targets.

Back to your original problem, though, I never build packages  
directly from development sources (didn't we have a discussion about  
this recently?) for the reasons discussed - IMHO it's much better to  
have a script build the package tar ball, stamping files as necessary.

Cheers,
Simon