annotate Makefile @ 11:2da5037fdfad

add compatibility with libnotify version < 0.7
author Guido Berhoerster <guido@berhoerster.name>
date Tue, 11 Oct 2011 17:07:49 +0200
parents fe1a21ab4f69
children dca97330d81e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
1 INSTALL := install
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
2 INSTALL.exec := $(INSTALL) -D -m 0755
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
3 INSTALL.data := $(INSTALL) -D -m 0644
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
4 SED := sed
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
5 MSGFMT := msgfmt
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
6 INTLTOOL_UPDATE := intltool-update
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
7 INTLTOOL_MERGE := intltool-merge
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
8
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
9 DESTDIR ?=
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
10 prefix ?= /usr/local
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
11 bindir ?= $(prefix)/bin
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
12 datadir ?= $(prefix)/share
10
fe1a21ab4f69 add a man page
Guido Berhoerster <guido@berhoerster.name>
parents: 9
diff changeset
13 mandir ?= $(datadir)/man
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
14 localedir ?= $(datadir)/locale
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
15 sysconfdir ?= /etc
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
16 xdgautostartdir ?= $(sysconfdir)/xdg/autostart
0
f5e03fc667f8 initial commit
Pavol Rusnak <stick@gk2.sk>
parents:
diff changeset
17
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
18 PACKAGE = pk-update-icon
9
0e50d3652326 use libunique to ensure that only a single instance of pk-update-icon can be run
Guido Berhoerster <guido@berhoerster.name>
parents: 8
diff changeset
19 APP_NAME = org.opensuse.pk-update-icon
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
20 VERSION = 0.1
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
21 OBJS = main.o notify.o packagekit.o
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
22 AUTOSTART_FILE = $(PACKAGE).desktop
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
23 MOFILES := $(patsubst %.po,%.mo,$(wildcard po/*.po))
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
24 POTFILE = po/$(PACKAGE).pot
9
0e50d3652326 use libunique to ensure that only a single instance of pk-update-icon can be run
Guido Berhoerster <guido@berhoerster.name>
parents: 8
diff changeset
25 CPPFLAGS := $(shell pkg-config --cflags gtk+-2.0 unique-1.0 libnotify packagekit-glib2) \
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
26 -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
27 -DPACKAGE="\"$(PACKAGE)\"" \
9
0e50d3652326 use libunique to ensure that only a single instance of pk-update-icon can be run
Guido Berhoerster <guido@berhoerster.name>
parents: 8
diff changeset
28 -DAPP_NAME=\"$(APP_NAME)\" \
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
29 -DLOCALEDIR="\"$(localedir)\""
9
0e50d3652326 use libunique to ensure that only a single instance of pk-update-icon can be run
Guido Berhoerster <guido@berhoerster.name>
parents: 8
diff changeset
30 LDLIBS := $(shell pkg-config --libs gtk+-2.0 unique-1.0 libnotify packagekit-glib2)
0
f5e03fc667f8 initial commit
Pavol Rusnak <stick@gk2.sk>
parents:
diff changeset
31
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
32 .DEFAULT_TARGET = all
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
33
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
34 .PHONY: all clean install
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
35
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
36 all: $(PACKAGE) $(MOFILES) $(AUTOSTART_FILE)
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
37
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
38 $(PACKAGE): $(OBJS)
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
39 $(LINK.o) $^ $(LDLIBS) -o $@
0
f5e03fc667f8 initial commit
Pavol Rusnak <stick@gk2.sk>
parents:
diff changeset
40
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
41 $(POTFILE): po/POTFILES.in
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
42 cd po/ && $(INTLTOOL_UPDATE) --pot --gettext-package="$(PACKAGE)"
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
43
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
44 pot: $(POTFILE)
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
45
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
46 update-po: $(POTFILE)
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
47 cd po/ && for lang in $(patsubst po/%.mo,%,$(MOFILES)); do \
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
48 $(INTLTOOL_UPDATE) --dist --gettext-package="$(PACKAGE)" \
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
49 $${lang}; \
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
50 done
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
51
0
f5e03fc667f8 initial commit
Pavol Rusnak <stick@gk2.sk>
parents:
diff changeset
52 %.o: %.c
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
53 $(COMPILE.c) -MD -o $@ $<
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
54 @cp $*.d $*.P; \
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
55 $(SED) -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
56 -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
57 rm -f $*.d
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
58
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
59 %.desktop: %.desktop.in $(MOFILES)
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
60 $(INTLTOOL_MERGE) --desktop-style --utf8 po $< $@
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
61
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
62 %.mo: %.po
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
63 $(MSGFMT) -o $@ $<
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
64
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
65 install:
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
66 $(INSTALL.exec) $(PACKAGE) $(DESTDIR)$(bindir)/$(PACKAGE)
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
67 $(INSTALL.data) $(AUTOSTART_FILE) \
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
68 $(DESTDIR)$(xdgautostartdir)/$(AUTOSTART_FILE)
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
69 for lang in $(patsubst po/%.mo,%,$(MOFILES)); do \
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
70 $(INSTALL.data) po/$${lang}.mo \
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
71 $(DESTDIR)$(LOCALEDIR)/$${lang}/$(PACKAGE).mo; \
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
72 done
10
fe1a21ab4f69 add a man page
Guido Berhoerster <guido@berhoerster.name>
parents: 9
diff changeset
73 $(INSTALL.data) $(PACKAGE).1 \
fe1a21ab4f69 add a man page
Guido Berhoerster <guido@berhoerster.name>
parents: 9
diff changeset
74 $(DESTDIR)$(mandir)/man1/$(PACKAGE).1
0
f5e03fc667f8 initial commit
Pavol Rusnak <stick@gk2.sk>
parents:
diff changeset
75
f5e03fc667f8 initial commit
Pavol Rusnak <stick@gk2.sk>
parents:
diff changeset
76 clean:
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
77 rm -f $(PACKAGE) $(OBJS) $(POTFILE) $(MOFILES) $(AUTOSTART_FILE)
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
78
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
79 -include $(patsubst %.o,%.P,$(OBJS))