PLUGIN_INSTALLDIR ?= /usr/local/share/gkrellm/plugins


GNOME_INCLUDE = `gnome-config --cflags gnome gnomeui`
GNOME_LIB = `gnome-config --libs gnome gnomeui`

GTK_INCLUDE = `gtk-config --cflags`
GTK_LIB = `gtk-config --libs`

FLAGS = -O2 -Wall -fPIC $(GNOME_INCLUDE) $(GTK_INCLUDE)
LIBS = $(GNOME_LIB) $(GTK_LIB)
LFLAGS = -shared

ifeq ($(debug),1)
	FLAGS += -g
endif

ifeq ($(enable_nls),1)
	FLAGS += -DENABLE_NLS -DLOCALEDIR=\"$(LOCALEDIR)\"
endif


CC = gcc $(FLAGS) $(CFLAGS)

OBJS = gkrellm-gnome.o

gkrellm-gnome.so: $(OBJS)
	$(CC) $(OBJS) -o gkrellm-gnome.so $(LFLAGS) $(LIBS)

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

install: 
	install -d -m 755 $(PLUGIN_INSTALLDIR)
	install -c -s -m 755 gkrellm-gnome.so $(PLUGIN_INSTALLDIR)

gkrellm-gnome.c.o: gkrellm-gnome.c
