#############################################################################
# Makefile for building moc
# Generated by tmake at 18:01, 1999/02/26
#     Project: moc
#    Template: moc.t
#############################################################################

####### System-dependendant options

####### BEGIN
#
#   This section was automatically generated from
#      /usr/lib/qt-1.44/Makefile for building on
#       on Mon Apr 19 13:48:46 CDT 1999
#

# Compiling
SYSCONF_CXX		= g++

# Compiling with support libraries
SYSCONF_CXXFLAGS_X11	= -I/usr/X11R6/include
SYSCONF_CXXFLAGS_QT	= -I$(QTDIR)/include
SYSCONF_CXXFLAGS_OPENGL	= -I/usr/X11R6/include

# Compiline YACC output
SYSCONF_CXXFLAGS_YACC     = -Wno-unused -Wno-parentheses

# Linking with support libraries
# X11
SYSCONF_LFLAGS_X11	= -L/usr/X11R6/lib
SYSCONF_LIBS_X11	= -lX11 -lXext
# Qt, Qt+OpenGL
SYSCONF_LFLAGS_QT	= -L$(QTDIR)/lib
SYSCONF_LIBS_QT		= -lqt
SYSCONF_LIBS_QT_OPENGL	= -lqgl
# OpenGL
SYSCONF_LFLAGS_OPENGL	= -L/usr/X11R6/lib
SYSCONF_LIBS_OPENGL	= -lMesaGL -lMesaGLU -lXmu -lXext -lm
# Yacc
SYSCONF_LIBS_YACC	= 

# Linking applications
SYSCONF_LINK		= g++
SYSCONF_LFLAGS		= 
SYSCONF_LIBS		= 

# Link flags shared objects
SYSCONF_LFLAGS_SHOBJ	= -shared

# Meta-object compiler
SYSCONF_MOC		= $(QTDIR)/bin/moc

# Linking shared libraries
#   - Build the $(TARGET) library, eg. lib$(TARGET).so.0.0
#   - Place target in $(DESTDIR) - which has a trailing /
#   - Usually needs to incorporate $(VER_MAJ) and $(VER_MIN)
#
SYSCONF_LINK_SHLIB	= g++
SYSCONF_LINK_TARGET_SHARED	= lib$(TARGET).so.$(VER_MAJ).$(VER_MIN)
SYSCONF_LINK_LIB_SHARED	=  $(SYSCONF_LINK_SHLIB) -shared -Wl,-soname,lib$(TARGET).so.$(VER_MAJ) \
				     $(LFLAGS) -o $(SYSCONF_LINK_TARGET_SHARED) \
				     $(OBJECTS) $(OBJMOC) $(LIBS); \
				 mv $(SYSCONF_LINK_TARGET_SHARED) $(DESTDIR); \
				 cd $(DESTDIR); \
				 rm -f lib$(TARGET).so lib$(TARGET).so.$(VER_MAJ); \
				 ln -s $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).so; \
				 ln -s $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).so.$(VER_MAJ)

# Linking static libraries
#   - Build the $(TARGET) library, eg. lib$(TARGET).a
#   - Place target in $(DESTDIR) - which has a trailing /
#
SYSCONF_AR		= ar cqs
SYSCONF_LINK_TARGET_STATIC = lib$(TARGET).a
SYSCONF_LINK_LIB_STATIC	= rm -f $(DESTDIR)$(SYSCONF_LINK_TARGET_STATIC) ; \
				 $(SYSCONF_AR) $(DESTDIR)$(SYSCONF_LINK_TARGET_STATIC) $(OBJECTS) $(OBJMOC) 
# Compiling application source
SYSCONF_CXXFLAGS	= -pipe -O2 -fno-strength-reduce
# Compiling library source
SYSCONF_CXXFLAGS_LIB	= -O2 -fno-strength-reduce -fPIC
# Compiling shared-object source
SYSCONF_CXXFLAGS_SHOBJ	= -O2 -fno-strength-reduce -fPIC
# Default link type (stati linking is still be used where required)
SYSCONF_LINK_LIB	= $(SYSCONF_LINK_LIB_SHARED)
SYSCONF_LINK_TARGET	= $(SYSCONF_LINK_TARGET_SHARED)

####### End of automatically generated section
####### END

####### Compiler, tools and options

CXX	=	$(SYSCONF_CXX)
CXXFLAGS=	$(SYSCONF_CXXFLAGS_QT) $(SYSCONF_CXXFLAGS_YACC) $(SYSCONF_CXXFLAGS)
LFLAGS	=	$(SYSCONF_LFLAGS)
LIBS	=	$(SYSCONF_LIBS_YACC) $(SYSCONF_LIBS)
MOC	=	$(SYSCONF_MOC)

####### Target

TARGET	= moc
DESTDIR = ./
VER_MAJ = 1
VER_MIN = 0

####### Files

HEADERS =	
SOURCES =	mocgen.cpp \
		../tools/qbuffer.cpp \
		../tools/qcollection.cpp \
		../tools/qdatetime.cpp \
		../tools/qdatastream.cpp \
		../tools/qgarray.cpp \
		../tools/qgdict.cpp \
		../tools/qglist.cpp \
		../tools/qglobal.cpp \
		../tools/qgvector.cpp \
		../tools/qiodevice.cpp \
		../tools/qstring.cpp
OBJECTS =	mocgen.o \
		qbuffer.o \
		qcollection.o \
		qdatetime.o \
		qdatastream.o \
		qgarray.o \
		qgdict.o \
		qglist.o \
		qglobal.o \
		qgvector.o \
		qiodevice.o \
		qstring.o
SRCMOC	=	
OBJMOC	=	

####### Implicit rules

.SUFFIXES: .cpp .cxx .cc .C .c

.cpp.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.cxx.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.cc.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.C.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.c.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

####### Build rules

all: $(DESTDIR)$(TARGET)

$(DESTDIR)$(TARGET): $(OBJECTS) $(OBJMOC) 
	$(SYSCONF_LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS)

moc: $(SRCMOC)

tmake:
	tmake moc.pro

clean:
	-rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC)
	-rm -f *~ core

####### Compile

mocgen.o: mocgen.cpp \
		../../include/qlist.h \
		../../include/qglist.h \
		../../include/qcollection.h \
		../../include/qglobal.h \
		../../include/qgeneric.h \
		../../include/qstring.h \
		../../include/qarray.h \
		../../include/qgarray.h \
		../../include/qshared.h \
		../../include/qdatetime.h \
		lex.yy.c
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o mocgen.o mocgen.cpp

qbuffer.o: ../tools/qbuffer.cpp \
		../../include/qbuffer.h \
		../../include/qiodevice.h \
		../../include/qglobal.h \
		../../include/qstring.h \
		../../include/qarray.h \
		../../include/qgarray.h \
		../../include/qshared.h \
		../../include/qgeneric.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qbuffer.o ../tools/qbuffer.cpp

qcollection.o: ../tools/qcollection.cpp \
		../../include/qcollection.h \
		../../include/qglobal.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qcollection.o ../tools/qcollection.cpp

qdatetime.o: ../tools/qdatetime.cpp \
		../../include/qdatetime.h \
		../../include/qstring.h \
		../../include/qarray.h \
		../../include/qgarray.h \
		../../include/qshared.h \
		../../include/qglobal.h \
		../../include/qgeneric.h \
		../../include/qdatastream.h \
		../../include/qiodevice.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qdatetime.o ../tools/qdatetime.cpp

qdatastream.o: ../tools/qdatastream.cpp \
		../../include/qdatastream.h \
		../../include/qiodevice.h \
		../../include/qglobal.h \
		../../include/qstring.h \
		../../include/qarray.h \
		../../include/qgarray.h \
		../../include/qshared.h \
		../../include/qgeneric.h \
		../../include/qbuffer.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qdatastream.o ../tools/qdatastream.cpp

qgarray.o: ../tools/qgarray.cpp \
		../../include/qgarray.h \
		../../include/qshared.h \
		../../include/qglobal.h \
		../../include/qstring.h \
		../../include/qarray.h \
		../../include/qgeneric.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qgarray.o ../tools/qgarray.cpp

qgdict.o: ../tools/qgdict.cpp \
		../../include/qgdict.h \
		../../include/qcollection.h \
		../../include/qglobal.h \
		../../include/qlist.h \
		../../include/qglist.h \
		../../include/qgeneric.h \
		../../include/qstring.h \
		../../include/qarray.h \
		../../include/qgarray.h \
		../../include/qshared.h \
		../../include/qdatastream.h \
		../../include/qiodevice.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qgdict.o ../tools/qgdict.cpp

qglist.o: ../tools/qglist.cpp \
		../../include/qglist.h \
		../../include/qcollection.h \
		../../include/qglobal.h \
		../../include/qgvector.h \
		../../include/qdatastream.h \
		../../include/qiodevice.h \
		../../include/qstring.h \
		../../include/qarray.h \
		../../include/qgarray.h \
		../../include/qshared.h \
		../../include/qgeneric.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qglist.o ../tools/qglist.cpp

qglobal.o: ../tools/qglobal.cpp \
		../../include/qglobal.h \
		../../include/qdict.h \
		../../include/qgdict.h \
		../../include/qcollection.h \
		../../include/qgeneric.h \
		../../include/qstring.h \
		../../include/qarray.h \
		../../include/qgarray.h \
		../../include/qshared.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qglobal.o ../tools/qglobal.cpp

qgvector.o: ../tools/qgvector.cpp \
		../../include/qgvector.h \
		../../include/qcollection.h \
		../../include/qglobal.h \
		../../include/qglist.h \
		../../include/qstring.h \
		../../include/qarray.h \
		../../include/qgarray.h \
		../../include/qshared.h \
		../../include/qgeneric.h \
		../../include/qdatastream.h \
		../../include/qiodevice.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qgvector.o ../tools/qgvector.cpp

qiodevice.o: ../tools/qiodevice.cpp \
		../../include/qiodevice.h \
		../../include/qglobal.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qiodevice.o ../tools/qiodevice.cpp

qstring.o: ../tools/qstring.cpp \
		../../include/qstring.h \
		../../include/qarray.h \
		../../include/qgarray.h \
		../../include/qshared.h \
		../../include/qglobal.h \
		../../include/qgeneric.h \
		../../include/qdatastream.h \
		../../include/qiodevice.h \
		../../include/qapplication.h \
		../../include/qwidget.h \
		../../include/qwindowdefs.h \
		../../include/qobjectdefs.h \
		../../include/qobject.h \
		../../include/qevent.h \
		../../include/qrect.h \
		../../include/qsize.h \
		../../include/qpoint.h \
		../../include/qpaintdevice.h \
		../../include/qpalette.h \
		../../include/qcolor.h \
		../../include/qcursor.h \
		../../include/qfont.h \
		../../include/qfontmetrics.h \
		../../include/qfontinfo.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qstring.o ../tools/qstring.cpp


####### Lex/yacc programs and options

LEX	=	flex
YACC	=	yacc -d

####### Lex/yacc files

LEXIN	=	moc.l
LEXOUT  =	lex.yy.c
YACCIN	=	moc.y
YACCOUT =	y.tab.c
YACCHDR =	y.tab.h
MOCGEN  =	mocgen.cpp

####### Process lex/yacc files

$(LEXOUT): $(LEXIN)
	$(LEX) $(LEXIN)

$(MOCGEN): $(YACCIN) $(LEXOUT)
	$(YACC) $(YACCIN)
	-rm -f $(MOCGEN)
	-mv $(YACCOUT) $(MOCGEN)
