#!/usr/bin/make -f

PLUGINS:=$(shell pkg-config --variable=pluginsdir lxpanel)
ifeq "$(PLUGINS)" ""
  PLUGINS:=$(shell pkg-config --variable=libdir lxpanel)/lxpanel/plugins
endif

all:	vpnmon.so

resources.c:	resources.xml
	glib-compile-resources --target=resources.c --generate-source resources.xml

vpnmon.so:	vpnmon2.c resources.c
	gcc -Wall `pkg-config --cflags gtk+-2.0 lxpanel` -shared -fPIC vpnmon2.c resources.c -o vpnmon.so `pkg-config --libs lxpanel`

install:	vpnmon.so
	install -m 644 vpnmon.so $(PLUGINS)

dist-clean:
	rm resources.c vpnmon.so
