#
#  Makefile
#  2002-05-27
#
#  voctrain - a vocabulary trainer for linux and windows
#  Copyright (C) 2002  Andreas Dangel <a.dangel@gmx.de>
#
#  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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

##############################################################################
# Ein paar Pfade
##############################################################################
QTHEADERS = /usr/lib/qt2/include/ # Qt 2.3 Include Path
QTPATH    = /usr/lib/qt2/lib/ # Qt 2.3 Library

MOC       = /usr/lib/qt2/bin/moc
UIC       = /usr/lib/qt2/bin/uic

##############################################################################
# Flags
##############################################################################
LDFLAGS  = -L$(QTPATH) -lqt
CXXFLAGS = -Wall -I$(QTHEADERS)


##############################################################################
# Fertige Programme
##############################################################################
all: test1 test2

test1: test1.o vocable.o lesson.o vocabulary.o vocabularyparser.o
	$(CXX) -o $@ $+ $(LDFLAGS)

test2: test2.o vocable.o lesson.o vocabulary.o vocabularyparser.o
	$(CXX) -o $@ $+ $(LDFLAGS)

##############################################################################
# Abhngigkeiten
##############################################################################
vocable.o: vocable.cpp vocable.h

lesson.o: lesson.cpp lesson.h vocable.h

vocabulary.o: vocabulary.cpp vocabulary.h lesson.h

vocabularyparser.o: vocabularyparser.cpp vocabularyparser.h vocabulary.h lesson.h vocable.h

test1.o: test1.cpp vocable.h lesson.h vocabulary.h

test2.o: test2.cpp vocable.h lesson.h vocabulary.h vocabularyparser.h

##############################################################################
# *.ui
##############################################################################
editorform.h: editorform.ui
	$(UIC) -o $@ $<

editorform.cpp: editorform.ui editorform.h
	$(UIC) -o $@ -impl editorform.h $<

##############################################################################
# moc
##############################################################################
moc_editorform.cpp: editorform.h

moc_editorformimpl.cpp: editorformimpl.h

moc_editorform.o: moc_editorform.cpp editorform.h

moc_editorformimpl.o: moc_editorformimpl.cpp editorformimpl.h editorform.h

##############################################################################
# Aufrumen....clean
##############################################################################
clean:
	rm -f ./*.o
	rm -f ./test1
	rm -f ./test2

##############################################################################
# Allgemein
##############################################################################
%.o: %.cpp
	$(CXX) $(CXXFLAGS) -o $@ -c $<

moc_%.cpp: %.h
	$(MOC) $< -o $@

