Commit 3b747f1f authored by js9's avatar js9

Unifying creation of moc .C files from Qt widget .h files to a single implicit

rule.  Among other things, this fixes dependencies for outdated moc .C files.



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@1137 18c085ea-50e0-402c-830e-de6fd14e8384
parent 153a6315
......@@ -59,6 +59,8 @@
# Date: October 13, 2005
#
# Modifications:
# Jeremy Meredith, Thu Jun 7 13:23:18 EDT 2007
# Build rules to _moc.C are now in make-targets.in. Remove them from here.
#
##############################################################################
......@@ -73,8 +75,6 @@ LIBDEP=
CXXFLAGS=@CXXFLAGS@ @QT_CXXFLAGS@
CPPFLAGS=@CPPFLAGS@ -I$(TOPDIR)/include/visit -I.
MOC=@QT_MOC@
# Files
# -----
HDRMOC = CQScore.h
......@@ -110,11 +110,6 @@ cqscore: $(OBJ)
moc: $(SRCMOC)
# Source file specific rules
# --------------------------
${SRCMOC}:
${MOC} ${@:_moc.C=.h} > $@
# Automatic dependency stuff
# --------------------------
@TARGETS@
......@@ -381,6 +381,9 @@
# Jeremy Meredith, Tue Jun 5 17:31:29 EDT 2007
# Removed the test program; it no longer exists.
#
# Jeremy Meredith, Thu Jun 7 13:23:18 EDT 2007
# Build rules for _moc.C are now in make-targets.in. Remove them from here.
#
##############################################################################
##
......@@ -399,8 +402,6 @@ LDFLAGS=@LDFLAGS@ @QT_LDFLAGS@
LIBDEP=
CXXFLAGS=-I. @CXXFLAGS@ @QT_CXXFLAGS@ -I../include/visit
MOC=@QT_MOC@
##
## Files...
##
......@@ -610,9 +611,6 @@ moc: $(SRCMOC)
##
## Source file specific rules
##
.h_moc.C:
$(MOC) $< > $@
main.o: main.C QvisMainWindow.h
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c main.C
......
......@@ -79,7 +79,6 @@
@VARIABLES@
CXXFLAGS=-I. -I../include -I../include/visit @CXXFLAGS@
MOC=@QT_MOC@
##
## Files...
......
......@@ -132,6 +132,17 @@ distclean: clean
$(F77) $(F77FLAGS) -c $<
##
## Implicit rule for Qt MOC source.
##
## Jeremy Meredith, Thu Jun 7 13:24:49 EDT 2007
## Added initial version.
##
.h_moc.C:
@$(RM) $@
@QT_MOC@ $< > $@
## Jeremy Meredith, Fri May 11 13:51:37 PDT 2001
## Create GUI, Viewer and Engine shared libraries. This is for plugins.
##
......
......@@ -61,6 +61,10 @@
# Jeremy Meredith, Tue Aug 29 16:16:06 EDT 2006
# Fixed flags for compilation.
#
# Jeremy Meredith, Thu Jun 7 13:23:18 EDT 2007
# Build rules for _moc.C are now in make-targets.in. Remove them from here,
# and use those instead. Also clean up libraries and flags.
#
##############################################################################
@SET_MAKE@
......@@ -76,9 +80,11 @@ WIDGETS = ClipEditor.h Viewer.h
# Compile flags
# -------------
INCDIR = -I. -I../../include/qt -I../../include/visit
LDFLAGS = @LDFLAGS@
LIBS = @QT_LIBS@ $(X_LIBS) -lGL @LIBS@
LIBS=@QT_LIBS@ $(X_LIBS) @LIBS@
LDFLAGS=@QT_LDFLAGS@ @LDFLAGS@
LIBDEP=
CXXFLAGS=@CXXFLAGS@ @QT_CXXFLAGS@
CPPFLAGS=@CPPFLAGS@ -I$(TOPDIR)/include/visit -I.
# Derived objects
# ---------------
......@@ -86,8 +92,6 @@ OBJ = $(SRC:.C=.o)
MOCSRC = $(WIDGETS:.h=_moc.C)
MOCOBJ = $(MOCSRC:.C=.o)
MOC = @QT_MOC@
# Targets
# -------
......@@ -97,18 +101,9 @@ all: $(PROG)
$(PROG): Makefile $(OBJ) $(MOCOBJ)
$(CXX) $(LIBDIR) $(LDFLAGS) $(OBJ) $(MOCOBJ) -o $(PROG) $(LIBS)
# (compile)
.C.o : $(SRC)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(INCDIR) -c $<
# (moc)
$(MOCSRC) or_no_widgets:
@rm -f $@
$(MOC) $(@:_moc.C=.h) > $@
# (clean)
clean :
rm -f $(OBJ) $(MOCOBJ) $(MOCSRC) $(PROG)
distclean: clean
rm -f Makefile
@TARGETS@
......@@ -68,6 +68,9 @@
# Eric Brugger, Tue Jul 27 14:07:55 PDT 2004
# I added -I$(TOPDIR)/include/visit to pick up visitstream.h.
#
# Jeremy Meredith, Thu Jun 7 13:23:18 EDT 2007
# Build rules for _moc.C are now in make-targets.in. Remove them from here.
#
##############################################################################
......@@ -81,8 +84,6 @@ LIBDEP=
CXXFLAGS=@CXXFLAGS@ @QT_CXXFLAGS@
CPPFLAGS=@CPPFLAGS@ @SILO_INCLUDE@ -I$(TOPDIR)/include/visit -I.
MOC=@QT_MOC@
# Files
# -----
HDRMOC = Explorer.h \
......@@ -129,11 +130,6 @@ install_bin: $(tmpbin)/silex
moc: $(SRCMOC)
# Source file specific rules
# --------------------------
${SRCMOC}:
${MOC} ${@:_moc.C=.h} > $@
# Automatic dependency stuff
# --------------------------
@TARGETS@
......@@ -200,6 +200,9 @@
// Need to include Mesa and OpenGL for the Mac dependences
// Wrapped Mac dependences in #ifdef
//
// Jeremy Meredith, Thu Jun 7 13:22:18 EDT 2007
// Remove build rule for moc.C from .h. This is now in make-targets.in.
//
// ****************************************************************************
class MakefileGeneratorPlugin
......@@ -349,7 +352,6 @@ class MakefileGeneratorPlugin
out << " -I"<<vtkdir<<"/Imaging \\"<<endl;
out << " -I"<<vtkdir<<"/Rendering \\"<<endl;
out << " -I"<<vtkdir<<"/Utilities"<<endl;
out << "MOC="<<visithome<<"/bin/moc" << endl;
if(type == "database")
out << "CXXFLAGS=$(CXXFLAGSORIG)";
else
......@@ -801,18 +803,6 @@ class MakefileGeneratorPlugin
}
out << "" << endl;
out << "##" << endl;
out << "## moc" << endl;
out << "##" << endl;
out << "$(MOCSRC) or_no_widgets: $(WIDGETS)" << endl;
out << "\t@rm -f $@" << endl;
out << "\t$(MOC) $(@:_moc.C=.h) > $@" << endl;
out << "" << endl;
out << "$(VIEWERMOCSRC) or_no_viewer_widgets: $(VIEWERWIDGETS)" << endl;
out << "\t@rm -f $@" << endl;
out << "\t$(MOC) $(@:_moc.C=.h) > $@" << endl;
out << "" << endl;
out << "" << endl;
out << "##" << endl;
out << "## Automatic dependency stuff" << endl;
out << "##" << endl;
out << "include "<<visithome<<"/include/make-targets" << endl;
......
......@@ -71,6 +71,9 @@
# Eric Brugger, Tue Oct 5 13:00:24 PDT 2004
# I replaced QTDIR with QT_BIN.
#
# Jeremy Meredith, Thu Jun 7 13:23:18 EDT 2007
# Build rules for _moc.C are now in make-targets.in. Remove them from here.
#
##############################################################################
@SET_MAKE@
......@@ -109,9 +112,6 @@ CPPFLAGS=@CPPFLAGS@ -I$(TOPDIR)/include/visit -I../xml -I.
.SUFFIXES: .C _moc.C _moc.o
.h_moc.C:
@QT_BIN@/moc $< > $@
all: $(tmpbin)/xmledit
clean:
......
......@@ -320,6 +320,9 @@
# Jeremy Meredith, Tue Jun 5 17:26:11 EDT 2007
# Added an ALLOBJ= definition. This is for updated dependency generation.
#
# Jeremy Meredith, Thu Jun 7 13:23:18 EDT 2007
# Build rules for _moc.C are now in make-targets.in. Remove them from here.
#
##############################################################################
##
......@@ -345,7 +348,6 @@ LIBS=-L../../lib -L../../vtkqt -lengineproxy -lenginerpc -lviewerrpc \
LDFLAGS=@LDFLAGS@ @QT_LDFLAGS@
LIBDEP=
MOC=@QT_MOC@
CXXFLAGS=@CXXFLAGS@ @QT_CXXFLAGS@
CPPFLAGS=@PLATFORM_CPPFLAGS@ @CPPFLAGS@ $(VTK_INCLUDE) -I../../vtkqt \
-I./icons -I../../include -I../../include/visit -I.
......@@ -481,12 +483,6 @@ install_bin: $(tmpbin)/viewer
moc: $(SRCMOC)
##
## Source file specific rules
##
${SRCMOC}:
${MOC} ${@:_moc.C=.h} > $@
##
## Automatic dependency stuff
##
......
......@@ -102,6 +102,10 @@
# Thomas R. Treadway, Wed May 9 11:39:17 PDT 2007
# Added OpenGL libraries (framework) for MacOS X10.3 build
#
# Jeremy Meredith, Thu Jun 7 13:23:18 EDT 2007
# Build rules for _moc.C are now in make-targets.in. Remove them from here.
# Also clean up the naming of the widgets and moc files.
#
##############################################################################
##
......@@ -109,7 +113,6 @@
##
@SET_MAKE@
@VARIABLES@
MOC=@QT_MOC@
CXXFLAGS=@CXXFLAGS@ @QT_CXXFLAGS@
CPPFLAGS=@CPPFLAGS@ -I. -I../include/visit @VTK_INCLUDES@
......@@ -122,7 +125,8 @@ NOT_DISTRIB=moc_vtkQtRenderWindowInteractor.C moc_vtkQtGLWidget.C
SRC=vtkQtGLWidget.C vtkQtRenderWindow.C vtkQtRenderWindowInteractor.C vtkQtImagePrinter.C
HDR=vtkQtGLWidget.h vtkQtRenderWindow.h vtkQtRenderWindowInteractor.h vtkQtImagePrinter.h
MOCSRC=moc_vtkQtRenderWindowInteractor.C moc_vtkQtGLWidget.C
WIDGETS=vtkQtRenderWindowInteractor.h vtkQtGLWidget.h
MOCSRC=$(WIDGETS:.h=_moc.C)
MOCOBJ=$(MOCSRC:.C=.o)
OBJ=$(SRC:.C=.o) $(MOCOBJ)
......@@ -148,21 +152,6 @@ message:
@echo "*** Building VTK/Qt Render Window Library ($(LIB))"
@echo "****************************************************************************"
##
## Source file specific rules
##
moc_vtkQtRenderWindowInteractor.o: moc_vtkQtRenderWindowInteractor.C \
vtkQtRenderWindowInteractor.h
moc_vtkQtRenderWindowInteractor.C: vtkQtRenderWindowInteractor.h
$(MOC) vtkQtRenderWindowInteractor.h -o moc_vtkQtRenderWindowInteractor.C
moc_vtkQtGLWidget.o: moc_vtkQtGLWidget.C \
vtkQtGLWidget.h
moc_vtkQtGLWidget.C: vtkQtGLWidget.h
$(MOC) vtkQtGLWidget.h -o moc_vtkQtGLWidget.C
##
## Misc stuff
##
......
......@@ -74,6 +74,9 @@
# Brad Whitlock, Tue Feb 20 11:45:46 PDT 2007
# Moved QvisColorTableButton and 2 others from the gui.
#
# Jeremy Meredith, Thu Jun 7 13:23:18 EDT 2007
# Build rules to _moc.C are now in make-targets.in. Remove them from here.
#
##############################################################################
##
......@@ -84,7 +87,6 @@
CXXFLAGS=-I. -I../include/visit -I../include @QT_CXXFLAGS@ @CXXFLAGS@
CPPFLAGS=-I. @CPPFLAGS@
MOC=@QT_MOC@
##
## Files...
......@@ -122,12 +124,6 @@ message:
moc: $(SRCMOC)
##
## Source file specific rules
##
${SRCMOC}:
${MOC} ${@:_moc.C=.h} > $@
##
## Automatic dependency stuff
##
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment