[mplayer] Re: New Makefile/dependency system + 0.11 release

Raimar Falke hawk at B205a.WH8.TU-Dresden.De
Sat Mar 3 01:26:08 CET 2001


On Fri, Mar 02, 2001 at 11:37:30PM -0600, Arpi wrote:
> Hi,
> 
> Good in the new method:
> - no Makefile changes when running make dep/make distclean
>   -> cvs commit/update works for Makefiles too
> - 'make dep' happens automaticaly when 'make' is executed!
>   -> not need to run 'make dep' before 'make'
> - .depend is re-generated if config.h/config.mak/Makefile changed
>   -> not need manual 'make dep' after changing config.h file
> 
> Bad in the new method:
> - doesn't compile if the user doesn't have the 'makedepend' utility.
>   (it's part of the X11 binaries!)
>   Workaround: type 'make' again.. and again until all compiles.
>   We should detect this case at ./configure and make empty .depend files!
> - library rebuilding if source changed is not yet solved by this

In my own projects I use the dependency generation of gcc. If gcc-only
isn't a problem you can consider this.

---- start makefile part ----
# include the dependencies
include $(OBJ:.o=.d)

# calculate the dependencies
%.d: %.c
        PACKAGE=`dirname $<`/ ./depend.sh $(CFLAGS) $< > $@
---- end makefile part ----

---- start depend.sh ----
#!/bin/sh

gcc -M -MG $* | \
    sed -e 's@ /[^ ]*@@g' -e "s@^\(.*\)\.o:@$PACKAGE\1.d $PACKAGE\1.o:@" | \
    uniq
---- end depend.sh ----

	Raimar

-- 
 email: rf13 at inf.tu-dresden.de
 "These download files are in Microsoft Word 6.0 format. After
  unzipping, these files can be viewed in any text editor, including
  all versions of Microsoft Word, WordPad, and Microsoft Word Viewer."
    -- http://www.microsoft.com/hwdev/pc99.htm





More information about the MPlayer-users mailing list