# these should match debian unstable. adjust accordingly.
CC		= gcc
LIBS		= -L/usr/lib -lepplet
CFLAGS		= -O -Wall -I/usr/include
IMLIB-CONFIG	= imlib-config
BIN_PREFIX	= /usr/bin
ICON_PREFIX	= /usr/share/enlightenment/epplet_icons
DOX_PREFIX	= /usr/share/enlightenment/epplet_data

all: e-weather

e-weather:E-Weather.c
	$(CC) $(CFLAGS) E-Weather.c -o E-Weather.epplet $(LIBS) \
        $(shell $(IMLIB-CONFIG) --cflags) $(shell $(IMLIB-CONFIG) --libs)

install: install-epplet install-docs

install-epplet:
	install -m 755 E-Weather.epplet $(BIN_PREFIX)/E-Weather.epplet
	install -m 644 E-Weather.icon $(ICON_PREFIX)/E-Weather.icon

install-docs:
	mkdir -p $(DOX_PREFIX)/E-Weather
	install -d -m 755 E-Weather.ABOUT $(DOX_PREFIX)/E-Weather/E-Weather.ABOUT
	install -m 644 E-Weather.ABOUT/MAIN $(DOX_PREFIX)/E-Weather/E-Weather.ABOUT/MAIN
	install -m 644 E-Weather.ABOUT/aircut3.ttf $(DOX_PREFIX)/E-Weather/E-Weather.ABOUT/aircut3.ttf
	install -m 644 E-Weather.ABOUT/bg.png $(DOX_PREFIX)/E-Weather/E-Weather.ABOUT/bg.png
	install -m 644 E-Weather.ABOUT/buttons.png $(DOX_PREFIX)/E-Weather/E-Weather.ABOUT/buttons.png
	install -m 644 E-Weather.ABOUT/config.png $(DOX_PREFIX)/E-Weather/E-Weather.ABOUT/config.png

clean:
	rm E-Weather.epplet

.PHONY: e-weather all install install-docs clean