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