Geant4 Cross Reference |
1 # -------------------------------------------- 2 # Common part of GNUmakefile for libraries. J 3 # -------------------------------------------- 4 # Libraries are created according to G4SYSTEM. 5 # Introduced G4LIBDIR and G4TMPDIR. G.Cosmo, 2 6 # Introduced Qt moc rule, L.Garnier 16/2/08. 7 8 ifndef G4LIBDIR 9 G4LIBDIR := $(G4LIB)/$(G4SYSTEM) 10 endif 11 G4TMPDIR := $(G4TMP)/$(G4SYSTEM)/$(name) 12 13 ifneq ($(G4INTY_BUILD_QT),) 14 moc_inc := $(shell ($(GREP) -l "Q_OBJECT" in 15 moc_sources := $(patsubst include/%.hh, moc/ 16 moc_objects := $(patsubst moc/%_moc.cc,$(G4T 17 moc_dependencies := $(patsubst moc/%_moc.cc, 18 endif 19 20 21 ############################################## 22 # 23 # Actual moc files for Qt files 24 # 25 # moc sources and headers: used for Qt signal/ 26 # - all headers which use signals/slots have t 27 # in the class definitions; these all need t 28 # "meta object compiler (moc)" which generat 29 # implement the signal/slots, i.e., if "foo. 30 # it will be used by moc to generate the fil 31 # just an arbitrary extension to make it eas 32 # generated by moc). 33 34 35 ifneq ($(G4INTY_BUILD_QT),) 36 $(G4TMPDIR)/%_moc.d: moc/%_moc.cc 37 @echo Making dependency for moc file $< ... 38 @if [ ! -d $(G4TMPDIR) ] ; then mkdir -p $(G 39 @set -e;\ 40 g++ $(GPPFLAGS) $(CPPFLAGS) -w -xc++ $< |\ 41 sed 's!$*\.o!$(G4TMPDIR)/& $@!' >$@;\ 42 [ -s $@ ] || rm -f $@ 43 44 moc/%_moc.cc: include/%.hh 45 @echo Making moc file for $< ... 46 @if [ ! -d moc ] ; then mkdir -p moc ;fi 47 @if [ `$(QTMOC) -v 2>&1 | $(GREP) "Qt 3" | w 48 $(QTMOC) -o $@ $<;\ 49 else $(QTMOC) $(MOC_MACRO) -o $@ $<; \ 50 fi; 51 52 # could be better if we not duplicate this rul 53 $(G4TMPDIR)/%_moc.o: moc/%_moc.cc 54 @echo Compiling $*.cc ... 55 ifdef CPPVERBOSE 56 @echo Compiling moc file $*.cc ... 57 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(OUT_OBJ) 58 else 59 @$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(OUT_OBJ 60 endif 61 endif