annotate Makefile @ 32:cd271b582019 version-0.2.2

release pk-update-icon-0.2.2
author Guido Berhoerster <gber@opensuse.org>
date Wed, 18 Jul 2012 11:54:03 +0200
parents 3104191b44ca
children b84b4ae937e3
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
22
b18c70b2a6ca add dist target to Makefile
Guido Berhoerster <guido@berhoerster.name>
parents: 16
diff changeset
4 TAR := tar
b18c70b2a6ca add dist target to Makefile
Guido Berhoerster <guido@berhoerster.name>
parents: 16
diff changeset
5 GZIP := gzip
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
6 SED := sed
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
7 MSGFMT := msgfmt
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
8 INTLTOOL_UPDATE := intltool-update
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
9 INTLTOOL_MERGE := intltool-merge
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
10
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
11 DESTDIR ?=
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
12 prefix ?= /usr/local
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
13 bindir ?= $(prefix)/bin
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
14 datadir ?= $(prefix)/share
10
fe1a21ab4f69 add a man page
Guido Berhoerster <guido@berhoerster.name>
parents: 9
diff changeset
15 mandir ?= $(datadir)/man
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
16 localedir ?= $(datadir)/locale
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
17 sysconfdir ?= /etc
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
18 xdgautostartdir ?= $(sysconfdir)/xdg/autostart
0
f5e03fc667f8 initial commit
Pavol Rusnak <stick@gk2.sk>
parents:
diff changeset
19
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
20 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
21 APP_NAME = org.opensuse.pk-update-icon
32
cd271b582019 release pk-update-icon-0.2.2
Guido Berhoerster <gber@opensuse.org>
parents: 29
diff changeset
22 VERSION = 0.2.2
22
b18c70b2a6ca add dist target to Makefile
Guido Berhoerster <guido@berhoerster.name>
parents: 16
diff changeset
23 DISTNAME := $(PACKAGE)-$(VERSION)
14
64f05992d8ec GObject-based rewrite
Guido Berhoerster <guido@berhoerster.name>
parents: 13
diff changeset
24 OBJS = main.o pkui-icon.o pkui-backend.o
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
25 AUTOSTART_FILE = $(PACKAGE).desktop
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
26 MOFILES := $(patsubst %.po,%.mo,$(wildcard po/*.po))
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
27 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
28 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
29 -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
30 -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
31 -DAPP_NAME=\"$(APP_NAME)\" \
16
7af115023d5a add CLI, make delay and interval configurable
Guido Berhoerster <guido@berhoerster.name>
parents: 15
diff changeset
32 -DVERSION=\"$(VERSION)\" \
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
33 -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
34 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
35
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
36 .DEFAULT_TARGET = all
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
37
22
b18c70b2a6ca add dist target to Makefile
Guido Berhoerster <guido@berhoerster.name>
parents: 16
diff changeset
38 .PHONY: all clean clobber dist install
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
39
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
40 all: $(PACKAGE) $(MOFILES) $(AUTOSTART_FILE)
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
41
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
42 $(PACKAGE): $(OBJS)
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
43 $(LINK.o) $^ $(LDLIBS) -o $@
0
f5e03fc667f8 initial commit
Pavol Rusnak <stick@gk2.sk>
parents:
diff changeset
44
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
45 $(POTFILE): po/POTFILES.in
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
46 cd po/ && $(INTLTOOL_UPDATE) --pot --gettext-package="$(PACKAGE)"
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
47
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
48 pot: $(POTFILE)
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
49
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
50 update-po: $(POTFILE)
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
51 cd po/ && for lang in $(patsubst po/%.mo,%,$(MOFILES)); do \
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
52 $(INTLTOOL_UPDATE) --dist --gettext-package="$(PACKAGE)" \
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
53 $${lang}; \
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
54 done
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
55
0
f5e03fc667f8 initial commit
Pavol Rusnak <stick@gk2.sk>
parents:
diff changeset
56 %.o: %.c
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
57 $(COMPILE.c) -MD -o $@ $<
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
58 @cp $*.d $*.P; \
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
59 $(SED) -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
60 -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
61 rm -f $*.d
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
62
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
63 %.desktop: %.desktop.in $(MOFILES)
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
64 $(INTLTOOL_MERGE) --desktop-style --utf8 po $< $@
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
65
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
66 %.mo: %.po
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
67 $(MSGFMT) -o $@ $<
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
68
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
69 install:
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
70 $(INSTALL.exec) $(PACKAGE) $(DESTDIR)$(bindir)/$(PACKAGE)
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
71 $(INSTALL.data) $(AUTOSTART_FILE) \
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
72 $(DESTDIR)$(xdgautostartdir)/$(AUTOSTART_FILE)
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
73 for lang in $(patsubst po/%.mo,%,$(MOFILES)); do \
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
74 $(INSTALL.data) po/$${lang}.mo \
13
dca97330d81e fix the locale path
Guido Berhoerster <guido@berhoerster.name>
parents: 10
diff changeset
75 $(DESTDIR)$(localedir)/$${lang}/LC_MESSAGES/$(PACKAGE).mo; \
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
76 done
10
fe1a21ab4f69 add a man page
Guido Berhoerster <guido@berhoerster.name>
parents: 9
diff changeset
77 $(INSTALL.data) $(PACKAGE).1 \
fe1a21ab4f69 add a man page
Guido Berhoerster <guido@berhoerster.name>
parents: 9
diff changeset
78 $(DESTDIR)$(mandir)/man1/$(PACKAGE).1
0
f5e03fc667f8 initial commit
Pavol Rusnak <stick@gk2.sk>
parents:
diff changeset
79
f5e03fc667f8 initial commit
Pavol Rusnak <stick@gk2.sk>
parents:
diff changeset
80 clean:
8
58a3312a1c59 add internationalization support
Guido Berhoerster <guido@berhoerster.name>
parents: 7
diff changeset
81 rm -f $(PACKAGE) $(OBJS) $(POTFILE) $(MOFILES) $(AUTOSTART_FILE)
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
82
15
c7eac2574c76 add clobber target
Guido Berhoerster <guido@berhoerster.name>
parents: 14
diff changeset
83 clobber: clean
c7eac2574c76 add clobber target
Guido Berhoerster <guido@berhoerster.name>
parents: 14
diff changeset
84 rm -f *.P
c7eac2574c76 add clobber target
Guido Berhoerster <guido@berhoerster.name>
parents: 14
diff changeset
85
22
b18c70b2a6ca add dist target to Makefile
Guido Berhoerster <guido@berhoerster.name>
parents: 16
diff changeset
86 dist: clobber
b18c70b2a6ca add dist target to Makefile
Guido Berhoerster <guido@berhoerster.name>
parents: 16
diff changeset
87 rm -f $(DISTNAME)
b18c70b2a6ca add dist target to Makefile
Guido Berhoerster <guido@berhoerster.name>
parents: 16
diff changeset
88 ln -s -f . $(DISTNAME)
b18c70b2a6ca add dist target to Makefile
Guido Berhoerster <guido@berhoerster.name>
parents: 16
diff changeset
89 $(TAR) cv $(DISTNAME)/* | $(GZIP) > $(DISTNAME).tar.gz
b18c70b2a6ca add dist target to Makefile
Guido Berhoerster <guido@berhoerster.name>
parents: 16
diff changeset
90
7
56a7ed833d0a allow overriding CFLAGS
Guido Berhoerster <guido@berhoerster.name>
parents: 6
diff changeset
91 -include $(patsubst %.o,%.P,$(OBJS))