[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: am_edit magic
From:       Stephan Kulow <coolo () kde ! org>
Date:       2000-03-16 19:40:32
[Download RAW message or body]

Werner Trobin wrote:
> 
> Stephan Kulow wrote:
> >
> > David Faure wrote:
> > >
> > > On Wed, Mar 15, 2000 at 07:28:30PM +0100, Werner Trobin wrote:
> > > > Michael Koch wrote:
> > > > >
> > > > > Am Wed, 15 Mar 2000 schrieb Werner Trobin:
> > > > > > Hi!
> > > > > >
> > > > > > Does anyone (except Coolo :) know how to change the
> > > > > > compilation order for KOffice (e.g. filters/ after
> > > > > > all the other dirs)?
> > > > >
> > > > > Currently it compiles all subdirs beginning with lib and then the rest.
> > > > > The rest is ordered alphabetically. No other rule currently.
> > > >
> > > > Hehe - I'd like to change the order :)
> > >
> > > Hmm... there is always one guy that wants to do things
> > > the wrong way ;-)))
> > > Hrmpf, I said it was no problem when Werner asked me ;-)
> > >
> > > Well, what about "zfilters" ? :-)))))
> > >
> > > or moving all apps into koffice/apps ? Why not...
> > >
> > Well, if someone does the parsing, nothing speaks about
> >
> > echo "COMPILE_LAST = filter" >> koffice/Makefile.am
> 
> Hmm??? Please explain this to a perl/m4/<whatever> idiot :)
> What I do at the moment is to change this in the Makefile
> manually...
> 
This has nothing to do with perl/m4 - it's simple /bin/sh (at
least as simple as /bin/sh can get ;-) magic in 
admin/Makefile.common's subdir target. configure only takes
the lines of subdirs (or inst-apps after a copy ;) and puts
it into TOPSUBDIRS, where it ends as SUBDIRS later.

Look here:

subdirs:
        @files=`ls -1 | sort`; \
        dirs= ;\
        lib_dirs= ;\
        for i in $$files; do if test -d $$i; then \
                case $$i in \
                  lib*) \
                        lib_dirs="$$lib_dirs $$i" ;; \
                  *) \
                        dirs="$$dirs $$i" ;; \
                esac ;\
           fi; \
        done ;\
        rm -f SUBDIRS ;\
        for i in $$lib_dirs $$dirs; do \
        echo $$i >> ./SUBDIRS; \
        done
        @if test -r subdirs && diff subdirs SUBDIRS > /dev/null; then \
          rm -f SUBDIRS; \
        fi
        @test -r SUBDIRS && mv SUBDIRS subdirs

What you had to do is to add a little grep and sed on the toplevel Makefile
to add a third case "compile last". But then I would suggest to make it more
general and introduce a COMPILE_FIRST too

Greetings, Stephan
P.S. There are some wonderful books out there about shell programming, but
trial and error is still how you learn it fastests ;-)

-- 
Programmers, heed this: If someone starts asking you about
agricultural genomes, it's likely time to get a handler. 
                                zdnet.com about Torvalds

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic