On Wed, 2011-06-08 at 09:41 +0200, Erich Titl wrote:
> Hi David
> 
> at 16.05.2011 21:33, davidMbrooke wrote:
> > On Mon, 2011-05-16 at 10:40 +0200, Erich Titl wrote:
> ...
> 
> > Hi Erich,
> > 
> > I have noticed the same behaviour. Some of the makefiles automatically
> > derive the directory name from the source .tar.gz contents but that does
> > not work for buildclean / srcclean so they have to save off the
> > directory name to a file (called "DIRNAME") in order to use the name
> > later, when the environment variables are not set.
> > 
> > Would a similar approach work for you? Look at the first few lines of
> > e.g. repo/nfs-utils/buildtool.mk as an example.
> > 
> 
> I have not thought about this for some time, honestly I was a bit
> disappointed y this behaviour.
> Not feeling compelled to dig into the perl modules I have decided to use
> the following approach to this im my makefiles.
> 
> There is always a .source .build e.t.c.... created in the build
> directory, for the sake of makefile dependencies. These files do not
> need to be in the actual source tree of the package, but can reside on
> top of it. Also these files need not be stubs but may contain
> information, thus instead of just touching .source I echo the root of
> the unpacked tarball into it, for example in openswan.
> 
> OPENSWAN_DIR:=$(OPENSWAN_SOURCE:.tar.gz=)
> OPENSWAN_TARGET_DIR:=$(BT_BUILD_DIR)/openswan
> 
> export USE_AGGRESSIVE=false
> export USE_XAUTH=true
> export USE_BASH=false
> export USE_EXTRACRYPTO=true
> 
> 
> .source:
>         zcat $(OPENSWAN_SOURCE) | tar -xvf -
>         echo $(OPENSWAN_DIR) > .source
> 
> .....
> 
> clean:
>         -rm -f .build
>         rm -rf $(OPENSWAN_TARGET_DIR)
>         for i in $(KARCHS); do \
>             rm -rf
> $(BT_STAGING_DIR)/lib/modules/$(BT_KERNEL_RELEASE)-$$i/kernel/net/ipsec ;\
>         done;
>         make -C `cat .source` clean
> 
> srcclean: clean
>         rm -rf `cat .source`
> 
> This allows to get rid of the redundant information in buildtool.mk
> while maintaining the current infrastructure.
> 
> cheers
> 
> Erich

Yes, so that's the same basic approach as with the "DIRNAME" file in my
nfs-utils example. It's not ideal but I agree it's better than
hard-coding the directory name in buildtool.mk as well as having
the .tar.gz filename in buildtool.cfg.

Note that some applications do not follow the naming convention of
DIRECTORYNAME.tar.gz which I presume is why the tools/getdirname.pl
script was created. This actually looks inside the file to see what the
directory is called.

davidMbrooke



------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev

_______________________________________________
leaf-devel mailing list
leaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/leaf-devel

Reply via email to