Mercurial > projects > pk-update-icon
annotate Makefile @ 18:9537882d759f
add an about dialog
author | Guido Berhoerster <guido@berhoerster.name> |
---|---|
date | Thu, 20 Oct 2011 13:03:37 +0200 |
parents | 7af115023d5a |
children | b18c70b2a6ca |
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 | 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 | 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 |
14
64f05992d8ec
GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents:
13
diff
changeset
|
21 OBJS = main.o pkui-icon.o pkui-backend.o |
7
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)\" \ |
16
7af115023d5a
add CLI, make delay and interval configurable
Guido Berhoerster <guido@berhoerster.name>
parents:
15
diff
changeset
|
29 -DVERSION=\"$(VERSION)\" \ |
8
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
30 -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
|
31 LDLIBS := $(shell pkg-config --libs gtk+-2.0 unique-1.0 libnotify packagekit-glib2) |
0 | 32 |
7
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
33 .DEFAULT_TARGET = all |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
34 |
15
c7eac2574c76
add clobber target
Guido Berhoerster <guido@berhoerster.name>
parents:
14
diff
changeset
|
35 .PHONY: all clean clobber install |
7
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
36 |
8
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
37 all: $(PACKAGE) $(MOFILES) $(AUTOSTART_FILE) |
7
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
38 |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
39 $(PACKAGE): $(OBJS) |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
40 $(LINK.o) $^ $(LDLIBS) -o $@ |
0 | 41 |
8
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
42 $(POTFILE): po/POTFILES.in |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
43 cd po/ && $(INTLTOOL_UPDATE) --pot --gettext-package="$(PACKAGE)" |
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 pot: $(POTFILE) |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
46 |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
47 update-po: $(POTFILE) |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
48 cd po/ && for lang in $(patsubst po/%.mo,%,$(MOFILES)); do \ |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
49 $(INTLTOOL_UPDATE) --dist --gettext-package="$(PACKAGE)" \ |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
50 $${lang}; \ |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
51 done |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
52 |
0 | 53 %.o: %.c |
7
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
54 $(COMPILE.c) -MD -o $@ $< |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
55 @cp $*.d $*.P; \ |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
56 $(SED) -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
57 -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \ |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
58 rm -f $*.d |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
59 |
8
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
60 %.desktop: %.desktop.in $(MOFILES) |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
61 $(INTLTOOL_MERGE) --desktop-style --utf8 po $< $@ |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
62 |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
63 %.mo: %.po |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
64 $(MSGFMT) -o $@ $< |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
65 |
7
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
66 install: |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
67 $(INSTALL.exec) $(PACKAGE) $(DESTDIR)$(bindir)/$(PACKAGE) |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
68 $(INSTALL.data) $(AUTOSTART_FILE) \ |
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
69 $(DESTDIR)$(xdgautostartdir)/$(AUTOSTART_FILE) |
8
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
70 for lang in $(patsubst po/%.mo,%,$(MOFILES)); do \ |
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
71 $(INSTALL.data) po/$${lang}.mo \ |
13
dca97330d81e
fix the locale path
Guido Berhoerster <guido@berhoerster.name>
parents:
10
diff
changeset
|
72 $(DESTDIR)$(localedir)/$${lang}/LC_MESSAGES/$(PACKAGE).mo; \ |
8
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
73 done |
10 | 74 $(INSTALL.data) $(PACKAGE).1 \ |
75 $(DESTDIR)$(mandir)/man1/$(PACKAGE).1 | |
0 | 76 |
77 clean: | |
8
58a3312a1c59
add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents:
7
diff
changeset
|
78 rm -f $(PACKAGE) $(OBJS) $(POTFILE) $(MOFILES) $(AUTOSTART_FILE) |
7
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
79 |
15
c7eac2574c76
add clobber target
Guido Berhoerster <guido@berhoerster.name>
parents:
14
diff
changeset
|
80 clobber: clean |
c7eac2574c76
add clobber target
Guido Berhoerster <guido@berhoerster.name>
parents:
14
diff
changeset
|
81 rm -f *.P |
c7eac2574c76
add clobber target
Guido Berhoerster <guido@berhoerster.name>
parents:
14
diff
changeset
|
82 |
7
56a7ed833d0a
allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents:
6
diff
changeset
|
83 -include $(patsubst %.o,%.P,$(OBJS)) |