
TARGET = armada-backlight
APPLET = armada-backlight-applet
VERSION = 1.1

CC = gcc
CFLAGS = -O2
LD = gcc

INSTALL_BINDIR = $(shell gnome-config --bindir)
INSTALL_DATADIR = $(shell gnome-config --datadir)
INSTALL_SYSCONFDIR = $(shell gnome-config --sysconfdir)

all: armada-backlight

armada-backlight: armada-backlight.c

neat:
	rm -f *.o *~ core
	rm -rf .xvpics

clean: neat
	rm -f armada-backlight

install: armada-backlight
	cp armada-backlight armada-backlight-applet $(INSTALL_BINDIR)/
	chown root.root $(INSTALL_BINDIR)/armada-backlight
	chmod a=rx,+s $(INSTALL_BINDIR)/armada-backlight
	chmod a=rx $(INSTALL_BINDIR)/armada-backlight-applet
	cp armada-backlight.png $(INSTALL_DATADIR)/pixmaps/
	cp armada-backlight-applet.gnorba $(INSTALL_SYSCONFDIR)/CORBA/servers/
	cp armada-backlight-applet.desktop $(INSTALL_DATADIR)/applets/Utility/

uninstall:
	rm -f $(INSTALL_BINDIR)/armada-backlight
	rm -f $(INSTALL_BINDIR)/armada-backlight-applet
	rm -f $(INSTALL_DATADIR)/pixmaps/armada-backlight.png
	rm -f $(INSTALL_SYSCONFDIR)/CORBA/servers/armada-backlight-applet.gnorba
	rm -f $(INSTALL_DATADIR)/applets/Utility/armada-backlight-applet.desktop

package: clean
	tar cvzf ../../armada-backlight-$(VERSION).tar.gz -C ../.. armada-backlight
