
includes = `pkg-config gdk-2.0 gdk-pixbuf-xlib-2.0 librsvg-2.0 --cflags`

libs	 = `pkg-config imlib gdk-2.0 gdk-pixbuf-xlib-2.0 libart-2.0 libxml-2.0 pangoft2 librsvg-2.0 --libs` 

objs     = XDesktopContainer.o XIcon.o XIdeskImage.o XCaption.o Database.o \
		   DesktopConfig.o DesktopIconConfig.o Misc.o Main.o XShadowImage.o \
		   XIconWithShadow.o SimpleSvgImage.o XPngImage.o Action.o \
		   ActionConfig.o App.o

headers  = XDesktopContainer.h XIcon.h XIdeskImage.h XCaption.h Database.h \
		   DesktopConfig.h DesktopIconConfig.h Misc.h XShadowImage.h \
		   XIconWithShadow.h SimpleSvgImage.h XPngImage.h AbstractClasses.h \
		   Action.h ActionConfig.h App.h

all: idesk
	cp ./idesk ..

idesk: $(objs)
	$(cc) $(objs) -o $@ $(libs)

$(objs): %.o: %.cpp $(headers)
	$(cc) $(cflags) $(includes) -c $< -o $@

.PHONY : clean
clean:
	rm -f $(objs) idesk core

.PHONY : tidy
tidy: clean
	rm *.*~
	rm *~
