chiark / gitweb /
e562b18a2d178e519b6b3ef771624d15cfdefa12
[elogind.git] / Makefile.am
1 #  This file is part of systemd.
2 #
3 #  Copyright 2010 Lennart Poettering
4 #
5 #  systemd is free software; you can redistribute it and/or modify it
6 #  under the terms of the GNU General Public License as published by
7 #  the Free Software Foundation; either version 2 of the License, or
8 #  (at your option) any later version.
9 #
10 #  systemd is distributed in the hope that it will be useful, but
11 #  WITHOUT ANY WARRANTY; without even the implied warranty of
12 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 #  General Public License for more details.
14 #
15 #  You should have received a copy of the GNU General Public License
16 #  along with systemd; If not, see <http://www.gnu.org/licenses/>.
17
18 ACLOCAL_AMFLAGS = -I m4
19
20 dbuspolicydir=$(sysconfdir)/dbus-1/system.d
21 udevrulesdir=@udevrulesdir@
22
23 pkgsysconfdir=$(sysconfdir)/systemd
24 systemunitdir=$(pkgdatadir)/system
25 sessionunitdir=$(pkgdatadir)/session
26
27 AM_CPPFLAGS = \
28         -include $(top_builddir)/config.h \
29         -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
30         -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
31         -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
32         -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
33         -DSESSION_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/session\" \
34         -DSESSION_DATA_UNIT_PATH=\"$(sessionunitdir)\" \
35         -DCGROUP_AGENT_PATH=\"$(pkglibexecdir)/systemd-cgroups-agent\" \
36         -DSYSTEMD_BINARY_PATH=\"$(sbindir)/systemd\"
37
38 VALA_CFLAGS = \
39         -Wno-unused-variable \
40         -Wno-unused-function
41
42 sbin_PROGRAMS = \
43         systemd
44
45 bin_PROGRAMS = \
46         systemctl
47
48 if HAVE_GTK
49 bin_PROGRAMS += \
50         systemadm
51 endif
52
53 pkglibexec_PROGRAMS = \
54         systemd-logger \
55         systemd-cgroups-agent \
56         systemd-initctl
57
58 noinst_PROGRAMS = \
59         test-engine \
60         test-job-type \
61         test-ns \
62         test-loopback
63
64 dist_dbuspolicy_DATA = \
65         org.freedesktop.systemd1.conf
66
67 dist_udevrules_DATA = \
68         99-systemd.rules
69
70 dist_systemunit_DATA = \
71         units/emergency.service \
72         units/systemd-initctl.socket \
73         units/systemd-logger.socket
74
75 systemunit_DATA = \
76         systemd-initctl.service \
77         systemd-logger.service
78
79 EXTRA_DIST = \
80         units/systemd-initctl.service.in \
81         units/systemd-logger.service.in \
82         LICENSE \
83         README
84
85 # This is needed because automake is buggy in how it generates the
86 # rules for C programs, but not Vala programs.  We therefore can't
87 # list the .h files as dependencies if we want make dist to work.
88 BASIC_SOURCES = \
89         util.c \
90         hashmap.c \
91         set.c \
92         strv.c \
93         conf-parser.c \
94         socket-util.c \
95         log.c \
96         ratelimit.c
97
98 COMMON_SOURCES = \
99         $(BASIC_SOURCES) \
100         unit.c \
101         job.c \
102         manager.c \
103         load-fragment.c \
104         service.c \
105         automount.c \
106         mount.c \
107         swap.c \
108         device.c \
109         target.c \
110         snapshot.c \
111         socket.c \
112         timer.c \
113         load-dropin.c \
114         execute.c \
115         dbus.c \
116         dbus-manager.c \
117         dbus-unit.c \
118         dbus-job.c \
119         dbus-service.c \
120         dbus-socket.c \
121         dbus-target.c \
122         dbus-mount.c \
123         dbus-automount.c \
124         dbus-swap.c \
125         dbus-snapshot.c \
126         dbus-device.c \
127         dbus-execute.c \
128         cgroup.c \
129         mount-setup.c \
130         hostname-setup.c \
131         loopback-setup.c \
132         utmp-wtmp.c \
133         specifier.c \
134         unit-name.c \
135         fdset.c \
136         namespace.c
137
138 EXTRA_DIST += \
139         ${COMMON_SOURCES:.c=.h} \
140         macro.h \
141         ioprio.h \
142         missing.h \
143         list.h \
144         securebits.h \
145         linux/auto_dev-ioctl.h \
146         initreq.h
147
148 dist_man_MANS = \
149         systemd.unit.5 \
150         systemd.service.5
151
152 HTMLMANS = \
153         systemd.unit.html \
154         systemd.service.html
155
156 dist_noinst_DATA = \
157         $(HTMLMANS)
158
159 EXTRA_DIST += \
160         man/systemd.unit.xml \
161         man/systemd.service.xml
162
163 systemd_SOURCES = \
164         $(COMMON_SOURCES) \
165         main.c
166
167 systemd_CPPFLAGS = \
168         $(AM_CPPFLAGS) \
169         $(DBUS_CFLAGS) \
170         $(UDEV_CFLAGS) \
171         $(CGROUP_CFLAGS)
172
173 systemd_LDADD = \
174         $(DBUS_LIBS) \
175         $(UDEV_LIBS) \
176         $(CGROUP_LIBS)
177
178 test_engine_SOURCES = \
179         $(COMMON_SOURCES) \
180         test-engine.c
181
182 test_engine_CPPFLAGS = $(systemd_CPPFLAGS)
183 test_engine_LDADD = $(systemd_LDADD)
184
185 test_job_type_SOURCES = \
186         $(COMMON_SOURCES) \
187         test-engine.c
188
189 test_job_type_CPPFLAGS = $(systemd_CPPFLAGS)
190 test_job_type_LDADD = $(systemd_LDADD)
191
192 test_ns_SOURCES = \
193         $(BASIC_SOURCES) \
194         test-ns.c \
195         namespace.c
196
197 test_ns_CPPFLAGS = $(systemd_CPPFLAGS)
198 test_ns_LDADD = $(systemd_LDADD)
199
200 test_loopback_SOURCES = \
201         $(BASIC_SOURCES) \
202         test-loopback.c \
203         loopback-setup.c
204
205 test_loopback_CPPFLAGS = $(systemd_CPPFLAGS)
206 test_loopback_LDADD = $(systemd_LDADD)
207
208 systemd_logger_SOURCES = \
209         $(BASIC_SOURCES) \
210         logger.c
211
212 systemd_initctl_SOURCES = \
213         $(BASIC_SOURCES) \
214         initctl.c
215
216 systemd_initctl_CPPFLAGS = \
217         $(AM_CPPFLAGS) \
218         $(DBUS_CFLAGS)
219
220 systemd_initctl_LDADD = \
221         $(DBUS_LIBS)
222
223 systemd_cgroups_agent_SOURCES = \
224         $(BASIC_SOURCES) \
225         cgroups-agent.c
226
227 systemd_cgroups_agent_CPPFLAGS = \
228         $(AM_CPPFLAGS) \
229         $(DBUS_CFLAGS)
230
231 systemd_cgroups_agent_LDADD = \
232         $(DBUS_LIBS)
233
234 VALAFLAGS = -g --save-temps --pkg=dbus-glib-1 --pkg=posix --pkg gtk+-2.0
235
236 systemctl_SOURCES = \
237         systemctl.vala \
238         systemd-interfaces.vala
239
240 systemctl_CPPFLAGS = $(AM_CPPFLAGS) $(DBUSGLIB_CFLAGS) $(VALA_CFLAGS)
241 systemctl_LDADD = $(DBUSGLIB_LIBS)
242
243 systemadm_SOURCES = \
244         systemadm.vala \
245         systemd-interfaces.vala
246
247 systemadm_CPPFLAGS = $(AM_CPPFLAGS) $(DBUSGLIB_CFLAGS) $(GTK_CFLAGS) $(VALA_CFLAGS)
248 systemadm_LDADD = $(DBUSGLIB_LIBS) $(GTK_LIBS)
249
250 systemd-initctl.service: units/systemd-initctl.service.in Makefile
251         sed -e 's,@libexecdir\@,$(libexecdir),g' \
252                 -e 's,@pkglibexecdir\@,$(pkglibexecdir),g' \
253                 < $< > $@
254
255 systemd-logger.service: units/systemd-logger.service.in Makefile
256         sed -e 's,@libexecdir\@,$(libexecdir),g' \
257                 -e 's,@pkglibexecdir\@,$(pkglibexecdir),g' \
258                 < $< > $@
259
260 CLEANFILES = \
261         systemd-interfaces.c \
262         systemctl.c \
263         systemadm.c \
264         systemd-initctl.service \
265         systemd-logger.service
266
267 if HAVE_XSLTPROC
268 %.5: man/%.xml
269         $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
270
271 %.html: man/%.xml
272         $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
273
274 CLEANFILES += \
275         $(dist_man_MANS) \
276         $(HTMLMANS)
277 endif
278
279 install-data-hook:
280         $(MKDIR_P) -m 0755 \
281                 $(DESTDIR)$(pkgsysconfdir)/system \
282                 $(DESTDIR)$(pkgsysconfdir)/session \
283                 $(DESTDIR)$(sysconfdir)/xdg/systemd \
284                 $(DESTDIR)/cgroup/debug
285         rm -f $(DESTDIR)$(sysconfdir)/xdg/systemd/session
286         ln -sf $(DESTDIR)$(pkgsysconfdir)/session $(DESTDIR)$(sysconfdir)/xdg/systemd/session
287
288 DISTCHECK_CONFIGURE_FLAGS = \
289         --with-udevrulesdir=$$dc_install_base/$(udevrulesdir)