all: telescope

#DEFINES = -DKDE
DEFINES = -DMAEMO

SOURCES = TeleWindow.cpp    \
          Main.cpp          \
          XTools.cpp        \
          Thumbnail.cpp     \
          Settings.cpp      \
          Mapping.cpp       \
          Mappings.cpp

DEPS = x11 xcomposite xdamage xrender imlib2 xft

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

CONFFILES = telescope.conf telescope.keys

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) $(CONFFILES)
	cp telescope $(DESTDIR)/usr/bin/
	cp telescope-svc $(DESTDIR)/etc/init.d/
	mkdir -p $(DESTDIR)/usr/share/telescope
	cp $(SHAREFILES) $(DESTDIR)/usr/share/telescope/
	cp $(CONFFILES) $(DESTDIR)/etc/
