# -*- mode: Makefile -*-
#*****************************************************************************\
# $RCSfile$
#
# Copyright (C) 2001-2002  Martin Blais <blais@furius.ca>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#****************************************************************************/
#
# Generate with xxdiff.t template, as `tmake -t xxdiff.t xxdiff.pro > Makefile'
#

TEMPLATE = app
CONFIG = debug qt thread warn_on


#===============================================================================
# xxdiff.t 
 
this all doesn't work, qmake sucks, too limited.


# -*- mode: Makefile -*-
#############################################################################
#!
#! $RCSfile$
#!
#! This is a tmake template for building Unix applications.
#!
#$ IncludeTemplate("app.t");

#
# Compute current date/time.
#
COMPILE_DATE=#$ Now()

#-------------------------------------------------------------------------------
# support for documentation transformation

.SUFFIXES: .qml

.qml.h: 
	sed -e 's/\"/\\\"/g;s/$$/\\\n\\/;1s/^/char text[]=\"/;$$s/\\$$/\"\;/' $< > $@
	echo 's/\"/\\\"/g;s/$$/\\\n\\/;1s/^/char text[]=\"/;$$s/\\$$/\"\;/' 

help.o: doc.h
help.obj: doc.h

# Make the version number dependent on everything, so that we always recompile
# this file whenever we link, thus updating that number.
version.o: $(HEADERS) $(SOURCES) $(INTERFACES)
version.obj: $(HEADERS) $(SOURCES) $(INTERFACES)


#
# Additional dependencies.
# Note: this is lame, find a better way to do this.  The problem is that tmake
# does note include dependencies for files it cannot find in the include path.
#
cmdline.o: $(YACCOUTH)
cmdline.obj: $(YACCOUTH)

#===============================================================================

QMAKE_CFLAGS_RELEASE -= -fno-exceptions
QMAKE_YACC = bison
QMAKE_YACCFLAGS += --fixed-output-files

# For KDE support, uncomment the following lines:
#QMAKE_CFLAGS += -DXX_KDE -I/usr/include/kde
#QMAKE_CXXFLAGS += -DXX_KDE -I/usr/include/kde
#QMAKE_LIBS += -lkdeui -lkio -lqt-mt

debug:QMAKE_CFLAGS += -DXX_DEBUG
debug:QMAKE_CXXFLAGS += -DXX_DEBUG

#XX_VERSION=2.5-devel
XX_VERSION=2.6

QMAKE_CFLAGS_DEBUG += -DXX_VERSION="\"$$XX_VERSION ($(COMPILE_DATE))\""
QMAKE_CFLAGS_RELEASE += -DXX_VERSION="\"$$XX_VERSION\""

INCLUDEPATH += .

QMAKE_CLEAN += doc.h

# Needed for Windows compile?
#REQUIRES=full-config

#
# win32-msvc
#

win32-msvc:DEFINES += QT_DLL QT_THREAD_SUPPORT WINDOWS HAVE_STRING_H
#win32-msvc:QMAKE_CFLAGS += -GX
win32-msvc:QMAKE_CXXFLAGS += -GX
win32-msvc:INCLUDEPATH += winfixes

#win32-msvc:QMAKE_LFLAGS += /NODEFAULTLIB:MSVCRT

#
# irix-n32
#

irix-n32:QMAKE_CXXFLAGS += -woff 1375,1424,3201,1209,1110 -LANG:std
irix-n32:QMAKE_CXXFLAGS += -DCOMPILER_MIPSPRO

# always disable full warnings for C code.
irix-n32:QMAKE_CFLAGS_WARN_ON =
irix-n32:QMAKE_CC = cc
irix-n32:QMAKE_CFLAGS = $$QMAKE_CXXFLAGS

irix-n32:QMAKE_MOC = ${QTDIR}/bin/moc

irix-n32:QMAKE_LIBS += -lC -lCio -lm
irix-n32:QMAKE_LIBDIR_QT = $(QTDIR)/lib32
irix-n32:QMAKE_LIBS += -Wl,-rpath -Wl,$(QTDIR)/lib32

irix-n32:QMAKE_CFLAGS_RELEASE += -OPT:Olimit=4000


#
# linux-g++
#

linux-g++:QMAKE_CXXFLAGS += -DCOMPILER_GNU

# debugging memory problems
#linux-g++:QMAKE_CXXFLAGS += -fcheck-memory-usage
#linux-g++:QMAKE_LIBS += -lmpatrol -lbfd -liberty

#
# solaris-cc
#

solaris-cc:QMAKE_CXXFLAGS += -DCOMPILER_SUNWSPRO

#
# aix-xlc
#

aix-xlc:QMAKE_CXXFLAGS += -DCOMPILER_AIXXLC

#
# osf1-g++
#

osf1-g++:QMAKE_CXXFLAGS += -DCOMPILER_GNU


# Add diff files to link against directly
DIFFUTILS_DIR = ../diffutils-2.7

# QMAKE_LIBS +=  \
# 	$$DIFFUTILS_DIR/analyze.o \
# 	$$DIFFUTILS_DIR/cmpbuf.o \
# 	$$DIFFUTILS_DIR/dir.o \
# 	$$DIFFUTILS_DIR/io.o \
# 	$$DIFFUTILS_DIR/util.o \
# 	$$DIFFUTILS_DIR/context.o \
# 	$$DIFFUTILS_DIR/ed.o \
# 	$$DIFFUTILS_DIR/ifdef.o \
# 	$$DIFFUTILS_DIR/normal.o \
# 	$$DIFFUTILS_DIR/side.o \
# 	$$DIFFUTILS_DIR/fnmatch.o \
# 	$$DIFFUTILS_DIR/regex.o \
# 	$$DIFFUTILS_DIR/version.o \
# 	$$DIFFUTILS_DIR/diff.o \
# 	$$DIFFUTILS_DIR/diff3.o

HEADERS = \
	optionsDialog.h \
	searchDialog.h \
	app.h \
	app.inline.h \
	cmdline.h \
	suicideMessageBox.h \
	defs.h \
	types.h \
	diffs.h \
	diffs.inline.h \
	builder.h \
	builder.inline.h \
	builderFiles2.h \
	builderFiles3.h \
	builderDirs2.h \
	builderUnmerge.h \
	exceptions.h \
	buffer.h \
	buffer.inline.h \
	help.h \
	hordiffImp.h \
	line.h \
	line.inline.h \
	main.h \
	overview.h \
	resParser.h \
	resources.h \
	resources.inline.h \
	accelUtil.h \
	copyLabel.h \
	text.h \
	scrollView.h \
	central.h \
	merged.h \
	lineNumbers.h \
	util.h \
	markers.h \
	getopt.h \
	diffutils.h \
	diffutils_hack.h \
	doc.qml \
	kdeSupport.h \
	version.h

SOURCES = \
	optionsDialog.cpp \
	searchDialog.cpp \
	app.cpp \
	cmdline.cpp \
	suicideMessageBox.cpp \
	main.cpp \
	overview.cpp \
	copyLabel.cpp \
	text.cpp \
	scrollView.cpp \
	central.cpp \
	merged.cpp \
	lineNumbers.cpp \
	util.cpp \
	help.cpp \
	exceptions.cpp \
	builder.cpp \
	builderFiles2.cpp \
	builderFiles3.cpp \
	builderDirs2.cpp \
	builderUnmerge.cpp \
	diffs.cpp \
	hordiffImp.cpp \
	line.cpp \
	buffer.cpp \
	resources.cpp \
	accelUtil.cpp \
	resParser.cpp \
	markers.cpp \
	getopt.c \
	getopt1.c \
	version.c

#	diffutils.cpp \

INTERFACES = \
	markersWidgetBase.ui \
	optionsDialogBase.ui \
	searchDialogBase.ui

LEXSOURCES = resParser.l

YACCSOURCES = resParser.y

resParser.o: resParser_lex.cpp



TARGET = xxdiff

#DEPENDPATH=../../include

#REQUIRES=large-config

