
export cc       = g++
export cflags	 = -g -W #-Wall 
bin      = idesk
includes = `xft-config --cflags; imlib2-config --cflags; pkg-config --cflags libstartup-notification-1.0`


libs	 = `xft-config --libs; imlib2-config --libs; pkg-config --libs libstartup-notification-1.0`

objs     = XDesktopContainer.o XIcon.o XImlib2Image.o Database.o \
		   DesktopConfig.o DesktopIconConfig.o Misc.o Main.o XImlib2Shadow.o \
		   XIconWithShadow.o Action.o \
		   ActionConfig.o App.o XImlib2Caption.o

headers  = XDesktopContainer.h XIcon.h XImlib2Image.h Database.h \
		   DesktopConfig.h DesktopIconConfig.h Misc.h XImlib2Shadow.h \
		   XIconWithShadow.h AbstractClasses.h \
		   Action.h ActionConfig.h App.h XImlib2Caption.h cursors.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 *~
