view Makefile @ 14:64f05992d8ec

GObject-based rewrite use asynchronous packagekit-glib API use persistent menu widget and notification object update existing notification when new updates become available, close it when no updates are available show status icon when updates are available, hide it when no updates are available hide icon when gpk-update-viewer is executed, check for updates when gpk-update-viewer exits introduce a startup delay before the first check for updates is made add context menu item to manually trigger a check for updates remove context menu item for quitting pk-update-icon
author Guido Berhoerster <guido@berhoerster.name>
date Thu, 20 Oct 2011 08:19:22 +0200
parents dca97330d81e
children c7eac2574c76
line wrap: on
line source

INSTALL :=	install
INSTALL.exec :=	$(INSTALL) -D -m 0755
INSTALL.data :=	$(INSTALL) -D -m 0644
SED :=		sed
MSGFMT :=	msgfmt
INTLTOOL_UPDATE :=	intltool-update
INTLTOOL_MERGE :=	intltool-merge

DESTDIR ?=
prefix ?=	/usr/local
bindir ?=	$(prefix)/bin
datadir ?=	$(prefix)/share
mandir ?=	$(datadir)/man
localedir ?=	$(datadir)/locale
sysconfdir ?=	/etc
xdgautostartdir ?=	$(sysconfdir)/xdg/autostart

PACKAGE =	pk-update-icon
APP_NAME =	org.opensuse.pk-update-icon
VERSION =	0.1
OBJS =		main.o pkui-icon.o pkui-backend.o
AUTOSTART_FILE =	$(PACKAGE).desktop
MOFILES :=	$(patsubst %.po,%.mo,$(wildcard po/*.po))
POTFILE =	po/$(PACKAGE).pot
CPPFLAGS := 	$(shell pkg-config --cflags gtk+-2.0 unique-1.0 libnotify packagekit-glib2) \
		-DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \
		-DPACKAGE="\"$(PACKAGE)\"" \
		-DAPP_NAME=\"$(APP_NAME)\" \
		-DLOCALEDIR="\"$(localedir)\""
LDLIBS :=	$(shell pkg-config --libs gtk+-2.0 unique-1.0 libnotify packagekit-glib2)

.DEFAULT_TARGET = all

.PHONY: all clean install

all: $(PACKAGE) $(MOFILES) $(AUTOSTART_FILE)

$(PACKAGE): $(OBJS)
	$(LINK.o) $^ $(LDLIBS) -o $@

$(POTFILE): po/POTFILES.in
	cd po/ && $(INTLTOOL_UPDATE) --pot --gettext-package="$(PACKAGE)"

pot: $(POTFILE)

update-po: $(POTFILE)
	cd po/ && for lang in $(patsubst po/%.mo,%,$(MOFILES)); do \
		$(INTLTOOL_UPDATE) --dist --gettext-package="$(PACKAGE)" \
				   $${lang}; \
	done

%.o: %.c
	$(COMPILE.c) -MD -o $@ $<
	@cp $*.d $*.P; \
	$(SED) -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
	       -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
	rm -f $*.d

%.desktop: %.desktop.in $(MOFILES)
	$(INTLTOOL_MERGE) --desktop-style --utf8 po $< $@

%.mo: %.po
	$(MSGFMT) -o $@ $<

install:
	$(INSTALL.exec) $(PACKAGE) $(DESTDIR)$(bindir)/$(PACKAGE)
	$(INSTALL.data) $(AUTOSTART_FILE) \
			$(DESTDIR)$(xdgautostartdir)/$(AUTOSTART_FILE)
	for lang in $(patsubst po/%.mo,%,$(MOFILES)); do \
		$(INSTALL.data) po/$${lang}.mo \
			$(DESTDIR)$(localedir)/$${lang}/LC_MESSAGES/$(PACKAGE).mo; \
	done
	$(INSTALL.data) $(PACKAGE).1 \
			$(DESTDIR)$(mandir)/man1/$(PACKAGE).1

clean:
	rm -f $(PACKAGE) $(OBJS) $(POTFILE) $(MOFILES) $(AUTOSTART_FILE)

-include $(patsubst %.o,%.P,$(OBJS))