all: telescope

#DEFINES = -DKDE
DEFINES = -DMAEMO

SOURCES = TeleWindow.cpp Main.cpp XTools.cpp Thumbnail.cpp Settings.cpp

DEPS = x11 xcomposite xdamage xrender imlib2 xft

SHAREFILES = header-left.png header-right.png header-middle.png

CFLAGS += -Wall -Werror -O2 $(DEFINES) `pkg-config --cflags $(DEPS)`


OBJS = $(SOURCES:%.cpp=%.o)

telescope: $(OBJS)
	g++ `pkg-config --libs $(DEPS)` $^ -o $@

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


depend: $(SOURCES)
	g++ -M -MM -MG -MP $(CFLAGS) $(SOURCES) >$@


include depend


clean:
	rm -f *.o telescope depend *~


install: telescope telescope-svc $(SHAREFILES)
	cp telescope $(DESTDIR)/usr/bin/
	cp telescope-svc $(DESTDIR)/etc/init.d/
	mkdir -p $(DESTDIR)/usr/share/telescope
	cp $(SHAREFILES) $(DESTDIR)/usr/share/telescope/
