# Needs GNU Make  3.74
# 
#
# Find all .h files in directory -> this will be the target moc files 
# No dependencies

MOC=moc
CC=g++

INCLUDE=-I/usr/local/kde/include
LFLAGS  = -L/usr/X11R6/lib -L$(KDEDIR)/lib -lXext -lqt -lkdecore -lkdeui -ltcp

HEADER  =$(wildcard *.h)
MOC_OBJ	=$(patsubst %.h,%.moc,$(wildcard *.h))
OBJS	=$(patsubst %.cpp,%.o,$(wildcard *.cpp))

OBJS2  = $(wildcard *.moc)

all:	$(MOC_OBJ) $(OBJS)
	g++ $(LFLAGS) -o xx *.o 
	    
# Compile all .h files to moc-files
$(MOC_OBJ): %.moc:%.h
	 $(MOC) -i $< -o $@

# Compile all *.cpp 
$(OBJS): %.o:%.cpp
	$(CC) $(INCLUDE) -c $<


clean:
	rm -f *.moc
	rm -f *.o
	rm -f *~
