[Top][All Lists]

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

Need Code to Run Before Targets Are Processed?

From: Bobby Dill
Subject: Need Code to Run Before Targets Are Processed?
Date: Thu, 31 Jul 2008 14:30:35 -0700
User-agent: KMail/1.9.7

In my last post, I was asking about a for loop that I have finally figured out 
how to get around. Now, I'm faced with a new problem. Here is the entire
bin_PROGRAMS = colortool
# Generate a *.h file from a *.ui file
%.h: %.ui
        uic $< -o $@
# Generate a *.cpp file from a *.ui file
%.cpp: %.ui
        uic $< -i $*.h -o $@
# This rule lets GNU make create any moc_*.cpp from the equivalent *.h
# You have one .h file, it's called myapp.h. Therefore, here I list
# its mocced name, moc_myapp.cpp.
moc_%.cpp: %.h
        moc $< -o $@

# This code must be run before anything is compiled
forms="mainform \
        colorname \
        findform \

        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 section

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

# Make a list *.ui.h file names and there respective mocced file names.
# Also create a list of file that will be generate from the *.ui files.

colortool_SOURCES = main.cpp \
        images.cpp \

# Use as sources but do not install any source file
# generate from the *.ui files or any moc file generated
# afterwords.
nodist_colortool_SOURCES = $(uicgen) \
BUILT_SOURCES = $(uicgen)

# set the include path found by configure
INCLUDES = $(all_includes) $(QTDIR)/include

# the library search path.
colortool_LDFLAGS = $(all_libraries) -L$(QTDIR)/lib

CLEANFILES = $(uicgen) $(mocced)

There is code in this file that generates some necessary make rules and 
defines several variables. I need it to run before anything is compiled. Is 
there a way to force automake to do this?

reply via email to

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