Mercurial > projects > pk-update-icon
annotate Makefile @ 9:0e50d3652326
use libunique to ensure that only a single instance of pk-update-icon can be run
author | Guido Berhoerster <guido@berhoerster.name> |
---|---|
date | Tue, 11 Oct 2011 17:07:49 +0200 |
parents | 58a3312a1c59 |
children | fe1a21ab4f69 |
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 |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
13 localedir ?= $(datadir)/locale |
7
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
14 sysconfdir ?= /etc |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
15 xdgautostartdir ?= $(sysconfdir)/xdg/autostart |
0 | 16 |
7
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
17 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
|
18 APP_NAME = org.opensuse.pk-update-icon |
7
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
19 VERSION = 0.1 |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
20 OBJS = main.o notify.o packagekit.o |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
21 AUTOSTART_FILE = $(PACKAGE).desktop |
8
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
22 MOFILES := $(patsubst %.po,%.mo,$(wildcard po/*.po)) |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
23 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
|
24 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
|
25 -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \ |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
26 -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
|
27 -DAPP_NAME=\"$(APP_NAME)\" \ |
8
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
28 -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
|
29 LDLIBS := $(shell pkg-config --libs gtk+-2.0 unique-1.0 libnotify packagekit-glib2) |
0 | 30 |
7
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
31 .DEFAULT_TARGET = all |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
32 |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
33 .PHONY: all clean install |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
34 |
8
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
35 all: $(PACKAGE) $(MOFILES) $(AUTOSTART_FILE) |
7
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
36 |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
37 $(PACKAGE): $(OBJS) |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
38 $(LINK.o) $^ $(LDLIBS) -o $@ |
0 | 39 |
8
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
40 $(POTFILE): po/POTFILES.in |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
41 cd po/ && $(INTLTOOL_UPDATE) --pot --gettext-package="$(PACKAGE)" |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
42 |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
43 pot: $(POTFILE) |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
44 |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
45 update-po: $(POTFILE) |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
46 cd po/ && for lang in $(patsubst po/%.mo,%,$(MOFILES)); do \ |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
47 $(INTLTOOL_UPDATE) --dist --gettext-package="$(PACKAGE)" \ |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
48 $${lang}; \ |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
49 done |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
50 |
0 | 51 %.o: %.c |
7
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
52 $(COMPILE.c) -MD -o $@ $< |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
53 @cp $*.d $*.P; \ |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
54 $(SED) -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
55 -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \ |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
56 rm -f $*.d |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
57 |
8
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
58 %.desktop: %.desktop.in $(MOFILES) |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
59 $(INTLTOOL_MERGE) --desktop-style --utf8 po $< $@ |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
60 |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
61 %.mo: %.po |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
62 $(MSGFMT) -o $@ $< |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
63 |
7
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
64 install: |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
65 $(INSTALL.exec) $(PACKAGE) $(DESTDIR)$(bindir)/$(PACKAGE) |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
66 $(INSTALL.data) $(AUTOSTART_FILE) \ |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
67 $(DESTDIR)$(xdgautostartdir)/$(AUTOSTART_FILE) |
8
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
68 for lang in $(patsubst po/%.mo,%,$(MOFILES)); do \ |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
69 $(INSTALL.data) po/$${lang}.mo \ |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
70 $(DESTDIR)$(LOCALEDIR)/$${lang}/$(PACKAGE).mo; \ |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
71 done |
0 | 72 |
73 clean: | |
8
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
74 rm -f $(PACKAGE) $(OBJS) $(POTFILE) $(MOFILES) $(AUTOSTART_FILE) |
7
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
75 |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
76 -include $(patsubst %.o,%.P,$(OBJS)) |