GTK_INCLUDE = `pkg-config gtk+-2.0 --cflags`
GTK_LIB = `pkg-config gtk+-2.0 --libs`

CFLAGS = -O2 -Wall -fPIC $(GTK_INCLUDE) -I/usr/pkg/include

LIBS = $(GTK_LIB)

LFLAGS = -shared -L/usr/pkg/lib

CC = gcc

all: reminder.so

reminder.so: reminder.c calendar.xpm
	$(CC) $(CFLAGS) -o reminder.so $(LFLAGS) $(LIBS) reminder.c

clean:
	rm -f *.o core *.so

install:
	if [ -d /usr/lib/gkrellm2/plugins/ ] ; then \
		install -c -s -m 644 reminder.so /usr/lib/gkrellm2/plugins/ ; \
	elif [ -d /usr/local/lib/gkrellm2/plugins/ ] ; then \
		install -c -s -m 644 reminder.so /usr/local/lib/gkrellm2/plugins/ ; \
	elif [ -d /usr/pkg/lib/gkrellm2/plugins/ ] ; then \
		install -c -s -m 644 reminder.so /usr/pkg/lib/gkrellm2/plugins/ ; \
	else \
		install -D -c -s -m 644 reminder.so /usr/lib/gkrellm2/plugins/reminder.so ; \
	fi

uninstall:
	rm -f /usr/lib/gkrellm/plugins2/reminder.so
	rm -f /usr/local/lib/gkrellm2/plugins/reminder.so
	rm -f /usr/pkg/lib/gkrellm/plugins2/reminder.so
