CXXFLAGS = -I${QTDIR}/include -I${KDEDIR}/include -I.
LDFLAGS =  -L${QTDIR}/lib -L${KDEDIR}/lib -L/usr/X11R6/lib
LDADD = -ldl -lqt -lICE -lkdecore -lkdeui -lDCOP

all: myapp autoclient 

autoclient : asmartwidget_stub.o aclient.o
	g++ asmartwidget_stub.o aclient.o $(LDFLAGS) $(LDADD) -o autoclient

myapp      : asmartwidget.o asmartwidget_skel.o asmartwidget_moc.o myapp.o
	g++ myapp.o asmartwidget.o asmartwidget_skel.o asmartwidget_moc.o\
		 $(LDFLAGS) $(LDADD) -o myapp

.cpp.o:
	g++ $(CXXFLAGS) -c $<

asmartwidget.kidl: asmartwidget.h
	dcopidl asmartwidget.h > asmartwidget.kidl || rm -f asmartwidget.kidl
asmartwidget_moc.cpp: asmartwidget.h
	${QTDIR}/bin/moc asmartwidget.h -o asmartwidget_moc.cpp
asmartwidget_skel.cpp: asmartwidget.kidl
	dcopidl2cpp asmartwidget.kidl
asmartwidget_stub.cpp: asmartwidget.kidl



clean :
	rm -f *.o *_moc.cpp *_skel.* *_stub.* *.kidl myapp autoclient

