Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, May 2007
qmake subdir target name


Message 1 in thread

Hi all, 

I have an old project with its own Makefile which has to be integrated into a 
new qt-based project. Assuming the following directories: 

trunk/
      oldprj
      newprj

The newprj dir contains the pro file: 

newprj.pro:
TEMPLATE = subdirs
SUBDIRS += ../oldprj

Fine, it results in a build command like this: 

cd ../oldprj && make -f Makefile

And now the problem: I need to name a target, so what I would like to get is:

cd ../oldprj && make -f Makefile target

My guess is I have to use a variable inside the SUBDIRS statement and set an 
attribute for this variable. 

Thanks for your help

	Mathias

--
 [ signature omitted ] 

Message 2 in thread

In similar situation I have used "top-level" makefile in trunk/, which
looks like

.PHONY: all newprj oldprj clean
all: newprj oldprj

newprj: oldprj
    cd newprj && qmake && make
oldprj:
    cd oldprj && make non-qt-target
clean:
    cd newprj && qmake && make clean
    cd oldprj && make clean

This may not be the optimal solution you want, but maybe it helps...

Another solution may be to modify Makefile of the old project to have
desired target as default. (first rule makefile encounters in the is
the default, so move desired rule to top or add some phony rule like
"all: desired_target" to top)

Martin Petricek

 cd ol
On 5/9/07, Mathias Waack <Mathias.Waack@xxxxxxxxxx> wrote:
> Hi all,
>
> I have an old project with its own Makefile which has to be integrated into a
> new qt-based project. Assuming the following directories:
>
> trunk/
>       oldprj
>       newprj
>
> The newprj dir contains the pro file:
>
> newprj.pro:
> TEMPLATE = subdirs
> SUBDIRS += ../oldprj
>
> Fine, it results in a build command like this:
>
> cd ../oldprj && make -f Makefile
>
> And now the problem: I need to name a target, so what I would like to get is:
>
> cd ../oldprj && make -f Makefile target
>
> My guess is I have to use a variable inside the SUBDIRS statement and set an
> attribute for this variable.
>
> Thanks for your help
>
>         Mathias
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>

--
 [ signature omitted ] 

Message 3 in thread

On Wednesday 09 May 2007 11:03, Mathias Waack wrote:
> Hi all,
>
> I have an old project with its own Makefile which has to be integrated into
> a new qt-based project. Assuming the following directories:
>
> trunk/
>       oldprj
>       newprj
>
> The newprj dir contains the pro file:
>
> newprj.pro:
> TEMPLATE = subdirs
> SUBDIRS += ../oldprj
>
> Fine, it results in a build command like this:
>
> cd ../oldprj && make -f Makefile
>
> And now the problem: I need to name a target, so what I would like to get
> is:
>
> cd ../oldprj && make -f Makefile target
>
> My guess is I have to use a variable inside the SUBDIRS statement and set
> an attribute for this variable.

I've found one solution using the QMAKE_EXTRA_TARGETS: 

TEMPLATE = subdirs
QMAKE_EXTRA_TARGETS = oldprj

oldproj.target = 
oldproj.commands = (cd ../oldprj; make -f Makefile target)

Mathias

--
 [ signature omitted ]