[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need Code to Run Before Targets Are Processed?

From: Ineiev
Subject: Re: Need Code to Run Before Targets Are Processed?
Date: Fri, 1 Aug 2008 10:33:00 +0400

Hello, Bobby

On 8/1/08, Bobby Dill <address@hidden> wrote:
>  # This code must be run before anything is compiled
>  forms="mainform \
>         colorname \
>         findform \
>         optionsform"
>         uicode := $(foreach i, $(forms), $(i).ui.h)
>         mocced := $(foreach i, $(forms), moc_$(i).cpp)
>         uicgen := $(foreach i, $(forms), $(i).h $(i).cpp)
>         %foreach i in $(forms)
>         $(i).h: $(i).ui
>         $(i).cpp: $(i).ui $(i).h
>         %end
>  # End section

When I needed something like this, I wrote an m4 template for
(file named it looked like this:

##expanded form "$1" begins
uicode+= $1.h
mocced+= $1.cpp
uicgen+= $1.h $1.cpp
$1.h: $1.ui
$1.cpp: $1.ui $1.h
##expanded form "$1" ends

#and so on for every form

#to initially generate, issue this command manually:
        m4 $(srcdir)/ > $(srcdir)/

I don't know if there is a better solution.

>  # Create an image collection from all the images in the images directory
>  images.cpp: $(wildcard images/*)
>         uic -embed colortool $^ -o $@

Automake does not support wildcards (I believe this means that such
code may break some make targets like distcheck). They argue this
issue in Automake info, section FAQ->wildcards. The summary of their
considerations is that you should know your sources to keep them neat
and that it is technically hard to provide this feature portably.

Navigare necesse est. Vivere non est necesse.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]