annotate Makefile @ 18:4a5330979433

Modernize and improve build system Do not clobber CPPFLAGS, use XCPPFLAGS instead. Request POSIX:2004 headers and libraries. Remove support for FreeBSD < 9. Add support for DragonFly BSD.
author Guido Berhoerster <guido+xwrited@berhoerster.name>
date Wed, 14 Sep 2016 09:46:59 +0200
parents 48caa69c609d
children f0accfc74f7b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
1 #
18
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
2 # Copyright (C) 2016 Guido Berhoerster <guido+xwrited@berhoerster.name>
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
3 #
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
4 # Permission is hereby granted, free of charge, to any person obtaining
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
5 # a copy of this software and associated documentation files (the
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
6 # "Software"), to deal in the Software without restriction, including
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
7 # without limitation the rights to use, copy, modify, merge, publish,
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
8 # distribute, sublicense, and/or sell copies of the Software, and to
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
9 # permit persons to whom the Software is furnished to do so, subject to
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
10 # the following conditions:
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
11 #
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
12 # The above copyright notice and this permission notice shall be included
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
13 # in all copies or substantial portions of the Software.
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
14 #
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
16 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
17 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
18 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
19 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
20 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
21 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
22 #
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
23
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
24 PACKAGE = xwrited
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
25 APP_NAME = org.guido-berhoerster.code.xwrited
14
129f316b99aa Release version 2
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 5
diff changeset
26 VERSION = 2
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
27 DISTNAME := $(PACKAGE)-$(VERSION)
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
28
18
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
29 # gcc, clang, icc, Sun/Solaris Studio
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
30 CC := $(CC) -std=c99
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
31 COMPILE.c = $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS) $(TARGET_ARCH) -c
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
32 # gcc, clang, icc
18
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
33 MAKEDEPEND.c = $(CC) -MM $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS)
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
34 # Sun/Solaris Studio
18
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
35 #MAKEDEPEND.c = $(CC) -xM1 $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS)
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
36 # X makedepend
18
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
37 #MAKEDEPEND.c = makedepend -f- -Y -- $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(XCPPFLAGS) --
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
38 INSTALL := install
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
39 INSTALL.exec := $(INSTALL) -D -m 0755
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
40 INSTALL.data := $(INSTALL) -D -m 0644
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
41 PAX := pax
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
42 GZIP := gzip
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
43 SED := sed
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
44 PASTE := paste
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
45 MSGFMT := msgfmt
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
46 INTLTOOL_UPDATE := intltool-update
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
47 INTLTOOL_MERGE := intltool-merge
5
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
48 XSLTPROC := xsltproc
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
49 DOCBOOK5_MANPAGES_STYLESHEET = http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
50
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
51 define generate-manpage-rule =
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
52 %.$(1): %.$(1).xml
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
53 $$(XSLTPROC) \
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
54 --xinclude \
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
55 --stringparam package $$(PACKAGE) \
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
56 --stringparam version $$(VERSION)\
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
57 data/docbook-update-source-data.xsl $$< | \
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
58 $$(XSLTPROC) \
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
59 --xinclude \
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
60 $$(DOCBOOK5_MANPAGES_FLAGS) \
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
61 --output $$@ \
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
62 $$(DOCBOOK5_MANPAGES_STYLESHEET) \
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
63 -
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
64 endef
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
65
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
66 DESTDIR ?=
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
67 prefix ?= /usr/local
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
68 bindir ?= $(prefix)/bin
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
69 datadir ?= $(prefix)/share
5
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
70 mandir ?= $(datadir)/man
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
71 localedir ?= $(datadir)/locale
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
72 sysconfdir ?= /etc
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
73 xdgautostartdir ?= $(sysconfdir)/xdg/autostart
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
74
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
75 OS_NAME := $(shell uname -s)
3
6e2d746b06ae Support FreeBSD > 9.0
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 2
diff changeset
76 OS_RELEASE := $(shell uname -r)
6e2d746b06ae Support FreeBSD > 9.0
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 2
diff changeset
77
18
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
78 ifeq ($(shell pkg-config --exists 'glib-2.0 >= 2.25.5' && printf "true"),true)
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
79 HAVE_GLIB_GDBUS = 1
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
80 else
18
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
81 HAVE_GLIB_GDBUS = 0
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
82 endif
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
83
18
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
84 PKGCONFIG_LIBS := dbus-1 glib-2.0 libnotify
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
85 ifeq ($(HAVE_GLIB_GDBUS),1)
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
86 PKGCONFIG_LIBS += dbus-glib-1
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
87 endif
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
88 OBJS = main.o xwrited-debug.o xwrited-unique.o
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
89 ifneq ($(findstring $(OS_NAME),Linux FreeBSD),)
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
90 OBJS += xwrited-utmp-utempter.o
2
c53bcdabbba7 Make use of GDBus for glib >= 2.25.5
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 0
diff changeset
91 else
18
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
92 OBJS += xwrited-utmp-utmpx.o
2
c53bcdabbba7 Make use of GDBus for glib >= 2.25.5
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 0
diff changeset
93 endif
5
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
94 MANPAGES = data/$(PACKAGE).1
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
95 AUTOSTART_FILE = data/$(PACKAGE).desktop
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
96 MOFILES := $(patsubst %.po,%.mo,$(wildcard po/*.po))
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
97 POTFILE = po/$(PACKAGE).pot
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
98 POSRCS := $(shell $(SED) -e 's/\#.*//' -e '/^[ \t]*$$/d' \
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
99 -e 's/^\[[^]]*\]//' po/POTFILES.in | $(PASTE) -s -d ' ')
5
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
100 DOCBOOK5_MANPAGES_FLAGS = --stringparam man.authors.section.enabled 0 \
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
101 --stringparam man.copyright.section.enabled 0
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
102
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
103 .DEFAULT_TARGET = all
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
104
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
105 .PHONY: all clean clobber dist install
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
106
5
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
107 all: $(PACKAGE) $(MANPAGES) $(MOFILES) $(AUTOSTART_FILE)
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
108
18
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
109 $(PACKAGE): CPPFLAGS := $(shell pkg-config --cflags $(PKGCONFIG_LIBS)) \
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
110 -D_XOPEN_SOURCE=600 \
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
111 -DPACKAGE="\"$(PACKAGE)\"" \
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
112 -DAPP_NAME=\"$(APP_NAME)\" \
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
113 -DVERSION=\"$(VERSION)\" \
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
114 -DLOCALEDIR="\"$(localedir)\"" \
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
115 -DG_LOG_DOMAIN=\"$(PACKAGE)\"
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
116 $(PACKAGE): LDLIBS := $(shell pkg-config --libs $(PKGCONFIG_LIBS))
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
117 ifeq ($(HAVE_GLIB_GDBUS),1)
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
118 $(PACKAGE): XCPPFLAGS += -DHAVE_GLIB_GDBUS
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
119 endif
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
120 ifeq ($(OS_NAME),Linux)
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
121 $(PACKAGE): LDLIBS += -lutempter
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
122 else ifeq ($(OS_NAME),FreeBSD)
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
123 $(PACKAGE): LDLIBS += -lulog
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
124 else ifeq ($(OS_NAME),SunOS)
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
125 $(PACKAGE): XCPPFLAGS += -I/usr/xpg4/include
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
126 $(PACKAGE): XLDFLAGS += -L/usr/xpg4/lib -R/usr/xpg4/lib
4a5330979433 Modernize and improve build system
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 17
diff changeset
127 endif
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
128 $(PACKAGE): $(OBJS)
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
129 $(LINK.o) $^ $(LDLIBS) -o $@
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
130
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
131 $(POTFILE): po/POTFILES.in $(POSRCS)
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
132 cd po/ && $(INTLTOOL_UPDATE) --pot --gettext-package="$(PACKAGE)"
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
133
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
134 pot: $(POTFILE)
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
135
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
136 update-po: $(POTFILE)
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
137 cd po/ && for lang in $(patsubst po/%.mo,%,$(MOFILES)); do \
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
138 $(INTLTOOL_UPDATE) --dist --gettext-package="$(PACKAGE)" \
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
139 $${lang}; \
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
140 done
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
141
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
142 %.o: %.c
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
143 $(MAKEDEPEND.c) $< | $(SED) -f deps.sed >$*.d
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
144 $(COMPILE.c) -o $@ $<
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
145
5
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
146 $(foreach section,1 2 3 4 5 6 7 8 9,$(eval $(call generate-manpage-rule,$(section))))
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
147
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
148 %.desktop: %.desktop.in $(MOFILES)
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
149 $(INTLTOOL_MERGE) --desktop-style --utf8 po $< $@
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
150
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
151 %.mo: %.po
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
152 $(MSGFMT) -o $@ $<
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
153
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
154 install:
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
155 $(INSTALL.exec) $(PACKAGE) "$(DESTDIR)$(bindir)/$(PACKAGE)"
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
156 for lang in $(patsubst po/%.mo,%,$(MOFILES)); do \
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
157 $(INSTALL.data) po/$${lang}.mo \
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
158 "$(DESTDIR)$(localedir)/$${lang}/LC_MESSAGES/$(PACKAGE).mo"; \
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
159 done
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
160 $(INSTALL.data) $(AUTOSTART_FILE) \
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
161 "$(DESTDIR)$(xdgautostartdir)/$(notdir $(AUTOSTART_FILE))"
5
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
162 $(INSTALL.data) data/$(PACKAGE).1 \
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
163 "$(DESTDIR)$(mandir)/man1/$(PACKAGE).1"
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
164
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
165 clean:
5
f0c7f45022c0 Add manpage
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 3
diff changeset
166 rm -f $(PACKAGE) $(OBJS) $(POTFILE) $(MOFILES) $(MANPAGES) $(AUTOSTART_FILE)
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
167
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
168 clobber: clean
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
169 rm -f $(patsubst %.o,%.d,$(OBJS))
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
170
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
171 dist: clobber
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
172 $(PAX) -w -x ustar -s ',.*/\..*,,' -s ',./[^/]*\.tar\.gz,,' \
17
48caa69c609d Exclude "." from tarballs
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 14
diff changeset
173 -s ',^\.$$,,' -s ',\./,$(DISTNAME)/,' . | \
48caa69c609d Exclude "." from tarballs
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents: 14
diff changeset
174 $(GZIP) > $(DISTNAME).tar.gz
0
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
175
52694b49dcc4 Initial revision
Guido Berhoerster <guido+xwrited@berhoerster.name>
parents:
diff changeset
176 -include $(patsubst %.o,%.d,$(OBJS))