# $Id$ # # common rules for compilation of Qt's uic-generated cpp files generated from header files. # # this file is automatically included if UIC is set # # Variables: # # srcdir ... source directory. # UIC ... The path of the uic binary. use uic-qt4 to be save when qt3-dev is installed, too. # UICFILES ... list of .ui files to preproces using uic. # MOC ... The path of the moc binary. use moc-qt4 to be save when qt3-dev is installed, too. # UICTRFUNC ... optional, an alternate tr(anslation) function for uic's -tr option. # # UICTRFUNC hints: # # 1. the aprorpriate header must be included in the .ui files like this: # # myi18n.h # # Do not use , because this is disabled in debian's qt3-dev-tools, # see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=410642 # # 2. to be recognized by common-gettext.mk your function must look like one of these: # QString qs_$(I18N_PFX)_i18n(const char *msg) # QString qs_$(I18N_PFX)_i18n_c(const char *msg) # UICSOURCES=$(addsuffix _uic.cpp,$(basename $(UICFILES))) UICHEADERS=$(addsuffix .h,$(basename $(UICFILES))) UICOBJS=$(addsuffix _uic.o,$(basename $(UICHEADERS))) UICDEPENDS=$(addsuffix _uic.d,$(basename $(UICHEADERS))) UICMOCOBJS=$(addsuffix _uicmoc.o,$(basename $(UICHEADERS))) UICMOCDEPENDS=$(addsuffix _uicmoc.d,$(basename $(UICHEADERS))) UICMOCSOURCES=$(addsuffix _uicmoc.cpp,$(basename $(UICHEADERS))) OBJS:=$(OBJS) $(UICOBJS) $(UICMOCOBJS) DEPENDS:=$(DEPENDS) $(UICDEPENDS) $(UICMOCDEPENDS) .SECONDARY: $(UICMOCSOURCES) $(UICSOURCES) ifeq ($(UICTRFUNC),) UICOPTIONS= else UICOPTIONS=-tr $(UICTRFUNC) endif %_uic.o %_uic.d: %_uic.cpp $(CXX) $(ABI_CFLAGS) $(CXXFLAGS) $(EXT_CFLAGS) $(INCLUDES) -MMD -MT '$*_uic.d $*_uic.o' -c $< -o $*_uic.o %.h: $(srcdir)/%.ui $(UIC) $< -o $@ %_uic.cpp: %.h $(srcdir)/%.ui $(UIC) $(UICOPTIONS) -i $+ -o $@ %_uicmoc.cpp: %.h $(MOC) -o $@ $< %_uicmoc.o %_uicmoc.d: %_uicmoc.cpp $(CXX) $(ABI_CFLAGS) $(CXXFLAGS) $(EXT_CFLAGS) $(INCLUDES) -MMD -MT '$*_uicmoc.d $*_uicmoc.o' -c $< -o $*_uicmoc.o ifneq ($(UICHEADERS),) install-dev:: $(UICHEADERS) mkdir -p $(HEADERDESTDIR) install -m 644 -p $(UICHEADERS) $(HEADERDESTDIR) endif clean:: rm -f $(UICSOURCES) $(UICHEADERS) $(UICMOCSOURCES)