# $Id: common.gmk,v 1.51 2008/04/04 10:35:20 gcosmo Exp $ # ---------------------------------------------------------------- # Common part of GNUmakefile for libraries. John Allison, 5/7/95. # ---------------------------------------------------------------- # Libraries are created according to G4SYSTEM. G.Cosmo, 11/6/96. # Introduced G4LIBDIR and G4TMPDIR. G.Cosmo, 23/6/98. # Introduced Qt moc rule, L.Garnier 16/2/08. ifndef G4LIBDIR G4LIBDIR := $(G4LIB)/$(G4SYSTEM) endif G4TMPDIR := $(G4TMP)/$(G4SYSTEM)/$(name) ifneq ($(G4INTY_BUILD_QT),) moc_inc := $(shell (grep -l "Q_OBJECT" ../$(dirMoc)/include/*.hh)) moc_tst := $(shell ls -al testMoc.gmk) moc_sources := $(patsubst ../$(dirMoc)/include/%.hh, src/%_moc.cc, $(moc_inc)) # moc_dir_name := $(patsubst G4%_moc, %, $(name)) # moc_tst := $(shell ls -al ../$(moc_dir_name) >/Users/garnier/tst) # moc_inc := $(shell (grep -l "Q_OBJECT" ../$(moc_dir_name)/include/*.hh)) # moc_tst := $(shell ls -al $(moc_inc) >/Users/garnier/tst) # moc_sources := $(patsubst ../$(moc_dir_name)/include/%.hh, src/%_moc.cc, $(moc_inc)) endif ############################################################################### # # Actual moc files for Qt files # # moc sources and headers: used for Qt signal/slot # - all headers which use signals/slots have the macro "Q_OBJECT" present # in the class definitions; these all need to be processed by the # "meta object compiler (moc)" which generates extra source code to # implement the signal/slots, i.e., if "foo.h" contains the token "Q_OBJECT" # it will be used by moc to generate the file "foo_moc.cpp" (the _moc. is # just an arbitrary extension to make it easier to identify sources # generated by moc). ifneq ($(G4INTY_BUILD_QT),) src/%_moc.cc: ../$(dirMoc)/include/%.hh @echo Making moc file for $< ... @if [ `$(QTHOME)/bin/moc -v 2>&1 | grep "Qt 3" | wc -l ` -gt 0 ]; then \ $(QTMOC) -o $@ $<;\ else $(QTMOC) $(MOC_MACRO) -o $@ $<; \ fi; src/%.cc: @echo Making toto $< ... @if [ ! -d $(G4TMPDIR) ] ; then mkdir -p $(G4TMPDIR) ;fi endif