########## PYTHON-QT MAKEFILE

########## User configurable stuff

PYTHONINCLUDE = /home/didx/Python-1.5.1/Include
PYTHONCONFIG  = /home/didx/Python-1.5.1
QTINCLUDE     = /home/didx/qt/include
QTLIB         = /home/didx/qt/lib


###########################################################################
# DON'T CHANGE THIS BIT!
#
# If you don't have GNU make then you'll need to rewrite IFILES, HEADERS etc
# adding whatever comes after addsuffix to each class name.
#
CLASSES=Object \
         Application \
	PopupMenu \
	 Layout \
          BoxLayout GridLayout\
	 Widget \
	  Button \
	   CheckBox PushButton RadioButton \
          ComboBox \
	  Dialog \
           TabDialog \
	  LineEdit \
	  Frame \
	   GroupBox \
            ButtonGroup \
           Label \
           TableView \
            ListBox \
	    MultiLineEdit \
	  ScrollBar \
	FileDialog \
	MenuData \
	qdbtcellmatrix \
	 qdbtsection \
	    qdbttable \
	qdbtheader \
	     qdbtslidebar \
	   qdbttabular \
	qdbtlined \
      qdbttabcell \
     qdbtutil \
	qdbt_tabular \
	etreelist \
	treeview \
	mainwindow \
	toolbar \
	splitter \
	toolbutton \
	extWidget \
        whatsthis
	

//IFILES=$(addsuffix .i, $(CLASSES)) *.i 
IFILES=*.i
HEADERS=$(addsuffix .h, $(CLASSES)) 
SOURCES=$(addsuffix .cc, $(CLASSES))
OBJECTS=$(addsuffix .o, $(CLASSES))
MSRCS=$(addsuffix .moc.cc, $(CLASSES))
MOBJS=$(addsuffix .moc.o, $(CLASSES))



all: pythonqtcmodule.so
	@echo
	@echo
	@echo Make sure that pythonqtcmodule.so and pythonqt.py are
	@echo in a directory in PYTHONPATH

clean:
	rm -f *.pyc *.o

pythonqt.py pythonqt_wrap.c: pythonqt.i $(HEADERS) $(IFILES) 
	swig -python -shadow -c++ pythonqt.i

%.moc.cc: %.h
	moc $< -o $@

.cc.o:
	@echo Compiling $<
	@g++ -O -I$(PYTHONINCLUDE) \
		-I$(PYTHONCONFIG) \
		-I$(QTINCLUDE) \
		-c $< -o $@

.c.o:
	@echo Compiling $<
	@g++ -O -I$(PYTHONINCLUDE) \
		-I$(PYTHONCONFIG) \
		-I$(QTINCLUDE) \
		-c $< -o $@

######## If you have problems you may need to change the
######## ld arguments

pythonqtcmodule.so: $(OBJECTS) $(MOBJS) pythonqt_wrap.o 
	@echo Generating shared module
	#	ld -L$(QTLIB) -lqt -G \
	#		$(OBJECTS) $(MOBJS) \
	#		pythonqt_wrap.o \
	#		-o pythonqtcmodule.so
	gcc -shared $(OBJECTS) $(MOBJS) -o pythonqtcmodule.so \
		    pythonqt_wrap.o -L$(QTLIB) -lqt

