]> git.ipfire.org Git - thirdparty/systemd.git/blame - Makefile.am
util: fix space calculation in get_process_cmdline()
[thirdparty/systemd.git] / Makefile.am
CommitLineData
47be870b
LP
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
18ACLOCAL_AMFLAGS = -I m4
19
8c4a3079 20# Dirs of external packages
d122948d
LP
21dbuspolicydir=@dbuspolicydir@
22dbussessionservicedir=@dbussessionservicedir@
23dbussystemservicedir=@dbussystemservicedir@
24dbusinterfacedir=@dbusinterfacedir@
d1ab0ca0 25udevrulesdir=@udevrulesdir@
8c6db833
LP
26pamlibdir=@pamlibdir@
27pkgconfigdatadir=$(datadir)/pkgconfig
036643a2 28
8c4a3079 29# Our own, non-special dirs
d1ab0ca0 30pkgsysconfdir=$(sysconfdir)/systemd
d1ab0ca0 31sessionunitdir=$(pkgdatadir)/session
8c4a3079
LP
32
33# And these are the special ones for /
34rootdir=@rootdir@
8c4a3079
LP
35rootbindir=$(rootdir)/bin
36rootlibexecdir=$(rootdir)/lib/systemd
37systemunitdir=$(rootdir)/lib/systemd/system
70fcff31 38
47be870b
LP
39AM_CPPFLAGS = \
40 -include $(top_builddir)/config.h \
036643a2 41 -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
70fcff31 42 -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
0571e011 43 -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
061978fa 44 -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
036643a2 45 -DSESSION_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/session\" \
70fcff31 46 -DSESSION_DATA_UNIT_PATH=\"$(sessionunitdir)\" \
8c4a3079 47 -DCGROUP_AGENT_PATH=\"$(rootlibexecdir)/systemd-cgroups-agent\" \
f401faf5 48 -DSYSTEMD_BINARY_PATH=\"$(rootbindir)/systemd\" \
2cb1a60d 49 -DSYSTEMCTL_BINARY_PATH=\"$(rootbindir)/systemctl\" \
8c6db833 50 -DRUNTIME_DIR=\"$(localstatedir)/run\" \
e99e38bb 51 -I $(top_srcdir)/src
47be870b 52
8c4a3079 53rootbin_PROGRAMS = \
134dc482 54 systemd \
4a2a8b5a
LP
55 systemctl \
56 systemd-notify
a9b5b032 57
8c4a3079 58bin_PROGRAMS = \
10e87ee7
LP
59 systemd-install
60
61if HAVE_GTK
62bin_PROGRAMS += \
8e274523 63 systemadm
a9b5b032 64endif
8e274523 65
8c4a3079 66rootlibexec_PROGRAMS = \
8e274523 67 systemd-logger \
0b7964b8
LP
68 systemd-cgroups-agent \
69 systemd-initctl
47be870b
LP
70
71noinst_PROGRAMS = \
72 test-engine \
15ae422b 73 test-job-type \
af5bc85d 74 test-ns \
8c47c732 75 test-loopback \
8c6db833
LP
76 test-daemon \
77 test-cgroup
78
79if HAVE_PAM
80pamlib_LTLIBRARIES = \
81 pam_systemd.la
82endif
47be870b 83
d1ab0ca0 84dist_dbuspolicy_DATA = \
dfac97b2 85 src/org.freedesktop.systemd1.conf
e24067c3 86
d122948d
LP
87dist_dbussystemservice_DATA = \
88 src/org.freedesktop.systemd1.service
89
d1ab0ca0 90dist_udevrules_DATA = \
dfac97b2 91 src/99-systemd.rules
5cc5d790 92
d122948d 93dbusinterface_DATA = \
4288f619
LP
94 org.freedesktop.systemd1.Manager.xml \
95 org.freedesktop.systemd1.Job.xml \
96 org.freedesktop.systemd1.Unit.xml \
97 org.freedesktop.systemd1.Service.xml \
98 org.freedesktop.systemd1.Socket.xml \
871d7de4 99 org.freedesktop.systemd1.Timer.xml \
4288f619
LP
100 org.freedesktop.systemd1.Target.xml \
101 org.freedesktop.systemd1.Device.xml \
102 org.freedesktop.systemd1.Mount.xml \
103 org.freedesktop.systemd1.Automount.xml \
104 org.freedesktop.systemd1.Snapshot.xml \
01f78473
LP
105 org.freedesktop.systemd1.Swap.xml \
106 org.freedesktop.systemd1.Path.xml
4288f619 107
d1ab0ca0 108dist_systemunit_DATA = \
70fcff31 109 units/emergency.service \
f92a18f5 110 units/basic.target \
5e6afdd3
LP
111 units/getty.target \
112 units/halt.target \
70449379
LP
113 units/local-fs.target \
114 units/network.target \
115 units/nss-lookup.target \
683f468c 116 units/mail-transfer-agent.target \
5e6afdd3
LP
117 units/poweroff.target \
118 units/reboot.target \
5e6afdd3 119 units/rescue.target \
f0b02ca2 120 units/rpcbind.target \
70449379
LP
121 units/rtc-set.target \
122 units/shutdown.target \
123 units/sigpwr.target \
124 units/sockets.target \
125 units/swap.target \
70fcff31 126 units/systemd-initctl.socket \
670802d4
LP
127 units/systemd-logger.socket \
128 units/dev-hugepages.automount \
129 units/dev-hugepages.mount \
130 units/dev-mqueue.automount \
131 units/dev-mqueue.mount \
132 units/proc-sys-fs-binfmt_misc.automount \
133 units/proc-sys-fs-binfmt_misc.mount \
134 units/sys-kernel-debug.automount \
135 units/sys-kernel-debug.mount \
6d526de2
LP
136 units/sys-kernel-security.automount \
137 units/sys-kernel-security.mount \
138 units/var-lock.mount \
670802d4 139 units/var-run.mount
70fcff31 140
6f6083dc 141nodist_systemunit_DATA = \
f92a18f5 142 units/sysinit.target \
5e6afdd3
LP
143 units/getty@.service \
144 units/graphical.target \
6f6083dc 145 units/remote-fs.target \
5e6afdd3 146 units/multi-user.target \
dfac97b2 147 units/systemd-initctl.service \
a7b6f8e5 148 units/systemd-logger.service \
af65a091
LP
149 units/syslog.target \
150 units/dbus.target
d1ab0ca0 151
0d26c910
LP
152dist_sessionunit_DATA = \
153 units/session/default.target
154
6f6083dc 155nodist_sessionunit_DATA = \
a1b256b0
LP
156 units/session/remote-fs.target \
157 units/session/exit.service
fb1bd35a 158
e24067c3 159EXTRA_DIST = \
f92a18f5 160 units/sysinit.target.m4 \
5e6afdd3
LP
161 units/getty@.service.m4 \
162 units/graphical.target.m4 \
163 units/multi-user.target.m4 \
705dbf3a 164 units/remote-fs.target.m4 \
70fcff31 165 units/systemd-initctl.service.in \
70fcff31 166 units/systemd-logger.service.in \
a7b6f8e5 167 units/syslog.target.in \
af65a091 168 units/dbus.target.in \
a1b256b0 169 units/session/exit.service.in \
64ca679e 170 systemd.pc.in
e24067c3 171
5e6afdd3
LP
172if TARGET_FEDORA
173dist_systemunit_DATA += \
174 units/fedora/halt.service \
175 units/fedora/killall.service \
176 units/fedora/poweroff.service \
177 units/fedora/prefdm.service \
178 units/fedora/rc-local.service \
179 units/fedora/reboot.service \
180 units/fedora/sysinit.service
181endif
182
65b0095b
KS
183if TARGET_SUSE
184dist_systemunit_DATA += \
185 units/suse/halt.service \
186 units/suse/poweroff.service \
187 units/suse/reboot.service
188endif
189
ea2d9ed4
MAP
190if TARGET_GENTOO
191dist_systemunit_DATA += \
192 units/gentoo/halt.service \
193 units/gentoo/killall.service \
194 units/gentoo/poweroff.service \
195 units/gentoo/reboot.service \
196 units/gentoo/xdm.service
197endif
198
1ebdf2d8
TG
199if TARGET_ARCH
200dist_systemunit_DATA += \
201 units/arch/sysinit.service \
202 units/arch/rc-local.service \
203 units/arch/halt.service \
204 units/arch/poweroff.service \
205 units/arch/reboot.service
206endif
207
240a3a85
LP
208dist_doc_DATA = \
209 README \
795750ca
LP
210 LICENSE \
211 DISTRO_PORTING \
240a3a85
LP
212 src/sd-daemon.h \
213 src/sd-daemon.c
214
8c6db833
LP
215pkgconfigdata_DATA = \
216 systemd.pc
217
139be57d
LP
218noinst_LTLIBRARIES = \
219 libsystemd-basic.la \
220 libsystemd-core.la
221
139be57d 222libsystemd_basic_la_SOURCES = \
e99e38bb
LP
223 src/util.c \
224 src/hashmap.c \
225 src/set.c \
226 src/strv.c \
227 src/conf-parser.c \
228 src/socket-util.c \
229 src/log.c \
230 src/ratelimit.c
47be870b 231
139be57d 232libsystemd_core_la_SOURCES = \
e99e38bb
LP
233 src/unit.c \
234 src/job.c \
235 src/manager.c \
84e3543e 236 src/path-lookup.c \
e99e38bb
LP
237 src/load-fragment.c \
238 src/service.c \
239 src/automount.c \
240 src/mount.c \
241 src/swap.c \
242 src/device.c \
243 src/target.c \
244 src/snapshot.c \
245 src/socket.c \
246 src/timer.c \
01f78473 247 src/path.c \
e99e38bb
LP
248 src/load-dropin.c \
249 src/execute.c \
250 src/dbus.c \
251 src/dbus-manager.c \
252 src/dbus-unit.c \
253 src/dbus-job.c \
254 src/dbus-service.c \
255 src/dbus-socket.c \
871d7de4 256 src/dbus-timer.c \
e99e38bb
LP
257 src/dbus-target.c \
258 src/dbus-mount.c \
259 src/dbus-automount.c \
260 src/dbus-swap.c \
261 src/dbus-snapshot.c \
262 src/dbus-device.c \
263 src/dbus-execute.c \
01f78473 264 src/dbus-path.c \
e99e38bb
LP
265 src/cgroup.c \
266 src/mount-setup.c \
267 src/hostname-setup.c \
268 src/loopback-setup.c \
11c3a4ee 269 src/kmod-setup.c \
e99e38bb
LP
270 src/utmp-wtmp.c \
271 src/specifier.c \
272 src/unit-name.c \
273 src/fdset.c \
0213c3f8 274 src/namespace.c \
8c6db833
LP
275 src/tcpwrap.c \
276 src/cgroup-util.c
47be870b 277
139be57d
LP
278libsystemd_core_la_CFLAGS = \
279 $(AM_CFLAGS) \
280 $(DBUS_CFLAGS) \
281 $(UDEV_CFLAGS) \
282 $(CGROUP_CFLAGS)
283
284libsystemd_core_la_LIBADD = \
285 libsystemd-basic.la \
286 $(DBUS_LIBS) \
287 $(UDEV_LIBS) \
288 $(CGROUP_LIBS) \
289 $(LIBWRAP_LIBS) \
290 $(PAM_LIBS)
291
9a1ac7b9
LP
292# This is needed because automake is buggy in how it generates the
293# rules for C programs, but not Vala programs. We therefore can't
294# list the .h files as dependencies if we want make dist to work.
295
462b33e9 296EXTRA_DIST += \
139be57d
LP
297 ${libsystemd_basic_la_SOURCES:.c=.h} \
298 ${libsystemd_core_la_SOURCES:.c=.h} \
e99e38bb
LP
299 src/macro.h \
300 src/ioprio.h \
301 src/missing.h \
302 src/list.h \
303 src/securebits.h \
304 src/linux/auto_dev-ioctl.h \
305 src/initreq.h \
514f4ef5 306 src/sd-daemon.h \
9a1ac7b9 307 src/special.h \
9335c44f 308 src/dbus-common.h
6f6083dc
LP
309
310MANPAGES = \
160cd5c9 311 man/systemd.1 \
6f6083dc
LP
312 man/systemctl.1 \
313 man/systemadm.1 \
314 man/systemd-install.1 \
c5abba08 315 man/systemd-notify.1 \
f9378423
LP
316 man/sd_notify.3 \
317 man/sd_booted.3 \
318 man/sd_listen_fds.3 \
319 man/sd_is_fifo.3 \
6f6083dc
LP
320 man/systemd.unit.5 \
321 man/systemd.service.5 \
1f812fea 322 man/systemd.socket.5 \
cdb788e4 323 man/systemd.mount.5 \
65232ea7 324 man/systemd.automount.5 \
e0cabd4b 325 man/systemd.swap.5 \
11fcc3ab 326 man/systemd.timer.5 \
b36b082c 327 man/systemd.path.5 \
da49e9ab 328 man/systemd.target.5 \
eec575d8 329 man/systemd.device.5 \
b2c20dd9 330 man/systemd.snapshot.5 \
dd1eb43b 331 man/systemd.exec.5 \
6f6083dc 332 man/daemon.7 \
359957ee
LP
333 man/sd-daemon.7 \
334 man/runlevel.8 \
160cd5c9
LP
335 man/telinit.8 \
336 man/halt.8 \
337 man/shutdown.8 \
6f6083dc
LP
338 man/pam_systemd.8
339
340MANPAGES_ALIAS = \
341 man/reboot.8 \
342 man/poweroff.8 \
343 man/sd_is_socket.3 \
344 man/sd_is_socket_unix.3 \
345 man/sd_is_socket_inet.3 \
346 man/sd_notifyf.3 \
347 man/init.1
348
349man/reboot.8: man/halt.8
350man/poweroff.8: man/halt.8
351man/sd_is_socket.3: man/sd_is_fifo.3
352man/sd_is_socket_unix.3: man/sd_is_fifo.3
353man/sd_is_socket_inet.3: man/sd_is_fifo.3
354man/sd_notifyf.3: man/sd_notify.3
355man/init.1: man/systemd.1
356
357dist_man_MANS = \
358 $(MANPAGES) \
359 $(MANPAGES_ALIAS)
9f2c5942
LP
360
361nodist_man_MANS = \
9f235308 362 man/systemd.special.7
d1ab0ca0 363
6f6083dc
LP
364XML_FILES = \
365 ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
366
367XML_IN_FILES = \
368 ${patsubst %.1,%.xml.in,${patsubst %.3,%.xml.in,${patsubst %.5,%.xml.in,${patsubst %.7,%.xml.in,${patsubst %.8,%.xml.in,$(nodist_man_MANS)}}}}}
369
9f2c5942 370dist_noinst_DATA = \
6f6083dc 371 ${XML_FILES:.xml=.html}
d1ab0ca0 372
9f2c5942 373nodist_noinst_DATA = \
6f6083dc 374 ${XML_IN_FILES:.xml.in=.html}
d1ab0ca0
LP
375
376EXTRA_DIST += \
6f6083dc
LP
377 $(XML_FILES) \
378 $(XML_IN_FILES) \
379 ${nodist_man_MANS:=.in} \
380 ${XML_IN_FILES:.xml.in=.html.in}
d1ab0ca0 381
47be870b 382systemd_SOURCES = \
e99e38bb 383 src/main.c
47be870b 384
10e87ee7
LP
385systemd_CFLAGS = \
386 $(AM_CFLAGS) \
47be870b 387 $(DBUS_CFLAGS) \
8e274523
LP
388 $(UDEV_CFLAGS) \
389 $(CGROUP_CFLAGS)
47be870b
LP
390
391systemd_LDADD = \
139be57d 392 libsystemd-core.la
47be870b
LP
393
394test_engine_SOURCES = \
e99e38bb 395 src/test-engine.c
47be870b 396
10e87ee7 397test_engine_CFLAGS = $(systemd_CFLAGS)
47be870b
LP
398test_engine_LDADD = $(systemd_LDADD)
399
400test_job_type_SOURCES = \
e1d680ad 401 src/test-job-type.c
47be870b 402
10e87ee7 403test_job_type_CFLAGS = $(systemd_CFLAGS)
47be870b
LP
404test_job_type_LDADD = $(systemd_LDADD)
405
15ae422b 406test_ns_SOURCES = \
139be57d 407 src/test-ns.c
15ae422b 408
10e87ee7 409test_ns_CFLAGS = $(systemd_CFLAGS)
15ae422b
LP
410test_ns_LDADD = $(systemd_LDADD)
411
af5bc85d 412test_loopback_SOURCES = \
e99e38bb
LP
413 src/test-loopback.c \
414 src/loopback-setup.c
af5bc85d 415
139be57d
LP
416test_loopback_LDADD = \
417 libsystemd-basic.la
418
8c47c732 419test_daemon_SOURCES = \
8c47c732
LP
420 src/test-daemon.c \
421 src/sd-daemon.c
af5bc85d 422
139be57d
LP
423test_daemon_LDADD = \
424 libsystemd-basic.la
425
8c6db833
LP
426test_cgroup_SOURCES = \
427 src/test-cgroup.c \
428 src/cgroup-util.c
429
430test_cgroup_CFLAGS = \
431 $(AM_CFLAGS) \
432 $(CGROUP_CFLAGS)
433
434test_cgroup_LDADD = \
435 libsystemd-basic.la \
436 $(CGROUP_LIBS)
437
47be870b 438systemd_logger_SOURCES = \
e99e38bb 439 src/logger.c \
0213c3f8
LP
440 src/sd-daemon.c \
441 src/tcpwrap.c
442
443systemd_logger_LDADD = \
139be57d 444 libsystemd-basic.la \
0213c3f8 445 $(LIBWRAP_LIBS)
47be870b 446
0b7964b8 447systemd_initctl_SOURCES = \
e99e38bb
LP
448 src/initctl.c \
449 src/sd-daemon.c
0b7964b8 450
10e87ee7
LP
451systemd_initctl_CFLAGS = \
452 $(AM_CFLAGS) \
0b7964b8
LP
453 $(DBUS_CFLAGS)
454
455systemd_initctl_LDADD = \
139be57d 456 libsystemd-basic.la \
0b7964b8
LP
457 $(DBUS_LIBS)
458
8e274523 459systemd_cgroups_agent_SOURCES = \
e99e38bb 460 src/cgroups-agent.c
8e274523 461
10e87ee7
LP
462systemd_cgroups_agent_CFLAGS = \
463 $(AM_CFLAGS) \
8e274523
LP
464 $(DBUS_CFLAGS)
465
466systemd_cgroups_agent_LDADD = \
139be57d 467 libsystemd-basic.la \
8e274523
LP
468 $(DBUS_LIBS)
469
7e4249b9
LP
470systemctl_SOURCES = \
471 src/systemctl.c \
9a1ac7b9
LP
472 src/utmp-wtmp.c \
473 src/dbus-common.c
139be57d
LP
474
475systemctl_CFLAGS = \
476 $(AM_CFLAGS) \
477 $(DBUS_CFLAGS)
7e4249b9 478
139be57d
LP
479systemctl_LDADD = \
480 libsystemd-basic.la \
481 $(DBUS_LIBS)
7e4249b9 482
4a2a8b5a
LP
483systemd_notify_SOURCES = \
484 src/notify.c \
139be57d
LP
485 src/sd-daemon.c
486
487systemd_notify_LDADD = \
488 libsystemd-basic.la
4a2a8b5a 489
10e87ee7
LP
490systemd_install_SOURCES = \
491 src/install.c \
9a1ac7b9
LP
492 src/path-lookup.c \
493 src/dbus-common.c
139be57d
LP
494
495systemd_install_LDADD = \
9a1ac7b9
LP
496 libsystemd-basic.la \
497 $(DBUS_LIBS)
e99e38bb 498
139be57d
LP
499systemd_install_CFLAGS = \
500 $(AM_CFLAGS) \
501 $(DBUS_CFLAGS)
47be870b 502
47be870b 503systemadm_SOURCES = \
e99e38bb
LP
504 src/systemadm.vala \
505 src/systemd-interfaces.vala
47be870b 506
10e87ee7
LP
507systemadm_CFLAGS = \
508 $(AM_CFLAGS) \
509 $(DBUSGLIB_CFLAGS) \
510 $(GTK_CFLAGS) \
511 -Wno-unused-variable \
512 -Wno-unused-function \
513 -Wno-shadow \
514 -Wno-format-nonliteral
515
516systemadm_VALAFLAGS = \
517 --pkg=dbus-glib-1 \
518 --pkg=posix \
519 --pkg=gtk+-2.0 \
520 -g
521
139be57d
LP
522systemadm_LDADD = \
523 $(DBUSGLIB_LIBS) \
524 $(GTK_LIBS)
c1e1601e 525
8c6db833
LP
526pam_systemd_la_SOURCES = \
527 src/pam-module.c \
528 src/cgroup-util.c \
529 src/sd-daemon.c
530
531pam_systemd_la_CFLAGS = \
532 $(AM_CFLAGS) \
533 $(CGROUP_CFLAGS) \
534 -fvisibility=hidden
535
536pam_systemd_la_LDFLAGS = \
537 -module \
538 -export-dynamic \
539 -avoid-version \
540 -shared \
541 -export-symbols-regex '^pam_sm_.*'
542
543pam_systemd_la_LIBADD = \
544 libsystemd-basic.la \
545 $(PAM_LIBS) \
546 $(CGROUP_LIBS)
547
5e6afdd3 548SED_PROCESS = \
a00e4879 549 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
1136a371 550 $(SED) -e 's,@rootlibexecdir\@,$(rootlibexecdir),g' \
5e6afdd3 551 -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
a1b256b0 552 -e 's,@SPECIAL_DBUS_SERVICE\@,$(SPECIAL_DBUS_SERVICE),g' \
1136a371 553 -e 's,@SYSTEMCTL\@,$(rootbindir)/systemctl,g' \
8c6db833
LP
554 -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
555 -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
556 -e 's,@systemunitdir\@,$(systemunitdir),g' \
557 -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
558 -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
559 -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' \
560 -e 's,@prefix\@,$(prefix),g' \
2d02719c 561 < $< > $@
70fcff31 562
9f2c5942 563units/%: units/%.in Makefile
5e6afdd3
LP
564 $(SED_PROCESS)
565
2a3d6294 566man/%: man/%.in Makefile
5e6afdd3
LP
567 $(SED_PROCESS)
568
8c6db833
LP
569%.pc: %.pc.in Makefile
570 $(SED_PROCESS)
571
fb1bd35a 572M4_PROCESS_SYSTEM = \
a00e4879 573 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
9f2c5942 574 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@
fb1bd35a
LP
575
576M4_PROCESS_SESSION = \
a00e4879 577 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
9f2c5942 578 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@
5e6afdd3 579
9f2c5942 580units/%: units/%.m4 Makefile
fb1bd35a 581 $(M4_PROCESS_SYSTEM)
5e6afdd3 582
9f2c5942 583units/session/%: units/%.m4 Makefile
fb1bd35a 584 $(M4_PROCESS_SESSION)
a7b6f8e5 585
c1e1601e 586CLEANFILES = \
6f6083dc
LP
587 $(nodist_systemunit_DATA) \
588 $(nodist_sessionunit_DATA) \
589 $(nodist_man_MANS) \
590 ${XML_IN_FILES:.xml.in=.html} \
591 $(pkgconfigdata_DATA)
4697132b 592
42e39f0b
LP
593if HAVE_VALAC
594CLEANFILES += \
6f6083dc 595 ${systemadm_SOURCES:.vala=.c}
42e39f0b
LP
596endif
597
c3bd7322 598if HAVE_XSLTPROC
c6365917
LP
599XSLTPROC_FLAGS = \
600 --nonet \
601 --param funcsynopsis.style "'ansi'"
602
9f2c5942 603XSLTPROC_PROCESS_MAN = \
a00e4879 604 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
c6365917 605 $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
d1ab0ca0 606
9f2c5942 607XSLTPROC_PROCESS_MAN_IN = \
a00e4879 608 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
c6365917 609 $(XSLTPROC) -o ${@:.in=} $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
9f2c5942
LP
610 mv ${@:.in=} $@
611
612XSLTPROC_PROCESS_HTML = \
a00e4879 613 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
c6365917 614 $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
d1ab0ca0 615
9f2c5942 616XSLTPROC_PROCESS_HTML_IN = \
a00e4879 617 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
c6365917 618 $(XSLTPROC) -o ${@:.in=} $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $< && \
9f2c5942
LP
619 mv ${@:.in=} $@
620
6f6083dc 621man/%.1: man/%.xml
f9378423
LP
622 $(XSLTPROC_PROCESS_MAN)
623
6f6083dc 624man/%.1.in: man/%.xml.in
f9378423
LP
625 $(XSLTPROC_PROCESS_MAN)
626
6f6083dc 627man/%.3: man/%.xml
359957ee
LP
628 $(XSLTPROC_PROCESS_MAN)
629
6f6083dc 630man/%.3.in: man/%.xml.in
359957ee
LP
631 $(XSLTPROC_PROCESS_MAN)
632
9f2c5942
LP
633man/%.5: man/%.xml
634 $(XSLTPROC_PROCESS_MAN)
635
636man/%.5.in: man/%.xml.in
637 $(XSLTPROC_PROCESS_MAN)
638
639man/%.7: man/%.xml
640 $(XSLTPROC_PROCESS_MAN)
641
642man/%.7.in: man/%.xml.in
643 $(XSLTPROC_PROCESS_MAN_IN)
644
f9378423
LP
645man/%.8: man/%.xml
646 $(XSLTPROC_PROCESS_MAN)
647
648man/%.8.in: man/%.xml.in
649 $(XSLTPROC_PROCESS_MAN_IN)
650
9f2c5942
LP
651man/%.html: man/%.xml
652 $(XSLTPROC_PROCESS_HTML)
653
654man/%.html.in: man/%.xml.in
655 $(XSLTPROC_PROCESS_HTML_IN)
656
d1ab0ca0
LP
657CLEANFILES += \
658 $(dist_man_MANS) \
6f6083dc
LP
659 ${nodist_man_MANS:=.in} \
660 ${XML_FILES:.xml=.html} \
661 ${XML_IN_FILES:.xml.in=.html.in}
c3bd7322 662endif
d1ab0ca0 663
4288f619
LP
664org.freedesktop.systemd1.%.xml: systemd
665 $(AM_V_GEN)./systemd --introspect=${@:.xml=} > $@
666
6f6083dc
LP
667CLEANFILES += \
668 $(dbusinterface_DATA)
4288f619 669
4697132b 670install-data-hook:
64c1b5bf 671 $(MKDIR_P) -m 0755 \
43aa226d
LP
672 $(DESTDIR)$(systemunitdir) \
673 $(DESTDIR)$(sessionunitdir) \
5e6afdd3 674 $(DESTDIR)$(systemunitdir)/sockets.target.wants \
f92a18f5 675 $(DESTDIR)$(systemunitdir)/sysinit.target.wants \
64c1b5bf 676 $(DESTDIR)$(pkgsysconfdir)/system \
5e6afdd3
LP
677 $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
678 $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
679 $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
64c1b5bf 680 $(DESTDIR)$(pkgsysconfdir)/session \
e82e442b 681 $(DESTDIR)$(sysconfdir)/xdg/systemd
a3723b97
LP
682 $(MKDIR_P) -m 0755 $(DESTDIR)/cgroup || \
683 echo "Don't forget to create /cgroup! Couldn't create it for you, continuing anyway."
e9da3678
LP
684 ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
685 rm -f session && \
5e6afdd3
LP
686 $(LN_S) $(pkgsysconfdir)/session session )
687 ( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
70449379 688 rm -f systemd-initctl.socket systemd-logger.socket && \
5e6afdd3
LP
689 $(LN_S) ../systemd-logger.socket systemd-logger.socket && \
690 $(LN_S) ../systemd-initctl.socket systemd-initctl.socket )
70449379 691 ( cd $(DESTDIR)$(sessionunitdir) && \
fb1bd35a 692 rm -f shutdown.target sockets.target local-fs.target swap.target && \
8c4a3079
LP
693 $(LN_S) $(systemunitdir)/shutdown.target shutdown.target && \
694 $(LN_S) $(systemunitdir)/sockets.target sockets.target && \
695 $(LN_S) $(systemunitdir)/local-fs.target local-fs.target && \
696 $(LN_S) $(systemunitdir)/swap.target swap.target )
5e6afdd3
LP
697 ( cd $(DESTDIR)$(systemunitdir) && \
698 rm -f runlevel0.target runlevel1.target runlevel6.target && \
699 $(LN_S) poweroff.target runlevel0.target && \
700 $(LN_S) rescue.target runlevel1.target && \
701 $(LN_S) reboot.target runlevel6.target )
702 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
703 rm -f default.target ctrl-alt-del.target kbrequest.target && \
704 $(LN_S) $(systemunitdir)/graphical.target default.target && \
705 $(LN_S) $(systemunitdir)/reboot.target ctrl-alt-del.target && \
706 $(LN_S) $(systemunitdir)/rescue.target kbrequest.target && \
707 rm -f runlevel2.target runlevel3.target runlevel4.target runlevel5.target && \
708 $(LN_S) $(systemunitdir)/multi-user.target runlevel2.target && \
709 $(LN_S) $(systemunitdir)/multi-user.target runlevel3.target && \
710 $(LN_S) $(systemunitdir)/multi-user.target runlevel4.target && \
711 $(LN_S) $(systemunitdir)/graphical.target runlevel5.target )
712 ( cd $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants && \
713 rm -f getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service && \
714 $(LN_S) $(systemunitdir)/getty@.service getty@tty1.service && \
715 $(LN_S) $(systemunitdir)/getty@.service getty@tty2.service && \
716 $(LN_S) $(systemunitdir)/getty@.service getty@tty3.service && \
717 $(LN_S) $(systemunitdir)/getty@.service getty@tty4.service && \
718 $(LN_S) $(systemunitdir)/getty@.service getty@tty5.service && \
719 $(LN_S) $(systemunitdir)/getty@.service getty@tty6.service )
720 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
f92a18f5
LP
721 rm -f getty.target remote-fs.target && \
722 $(LN_S) $(systemunitdir)/getty.target getty.target && \
723 $(LN_S) $(systemunitdir)/remote-fs.target remote-fs.target )
724 ( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
6d526de2
LP
725 rm -f dev-hugepages.automount \
726 dev-mqueue.automount \
727 proc-sys-fs-binfmt_misc.automount \
728 sys-kernel-debug.automount \
6d526de2 729 sys-kernel-security.automount && \
670802d4
LP
730 $(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
731 $(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
732 $(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
6d526de2 733 $(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount && \
8c4a3079 734 $(LN_S) ../sys-kernel-security.automount sys-kernel-security.automount )
d122948d
LP
735 ( cd $(DESTDIR)$(dbussessionservicedir) && \
736 rm -f org.freedesktop.systemd1.service && \
737 $(LN_S) ../system-services/org.freedesktop.systemd1.service org.freedesktop.systemd1.service )
5e6afdd3 738if TARGET_FEDORA
a3723b97
LP
739 $(MKDIR_P) -m 0755 \
740 $(DESTDIR)$(SYSTEM_SYSVINIT_PATH)
1e287fe3
LP
741 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
742 rm -f display-manager.service && \
743 $(LN_S) $(systemunitdir)/prefdm.service display-manager.service )
5e6afdd3 744 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
af65a091
LP
745 rm -f prefdm.service && \
746 $(LN_S) ../prefdm.service prefdm.service )
5e6afdd3
LP
747 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
748 rm -f rc-local.service && \
749 $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
750 ( cd $(DESTDIR)$(systemunitdir) && \
751 rm -f local.service && \
752 $(LN_S) rc-local.service local.service )
a3723b97 753 ( cd $(DESTDIR)$(SYSTEM_SYSVINIT_PATH) && \
1afaf573 754 $(LN_S) halt reboot > /dev/null 2>&1 || true )
5e6afdd3 755endif
f306f4c4
MAP
756if TARGET_GENTOO
757 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
758 rm -f display-manager.service && \
759 $(LN_S) $(systemunitdir)/xdm.service display-manager.service )
760 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
af65a091
LP
761 rm -f prefdm.service && \
762 $(LN_S) ../prefdm.service prefdm.service )
f306f4c4 763endif
5e6afdd3 764
d1ab0ca0 765DISTCHECK_CONFIGURE_FLAGS = \
d2d12cd1
LP
766 --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
767 --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
768 --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
769 --with-dbusinterfacedir=$$dc_install_base/$(dbusinterfacedir) \
8c4a3079 770 --with-udevrulesdir=$$dc_install_base/$(udevrulesdir) \
8c6db833 771 --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
8c4a3079 772 --with-rootdir=$$dc_install_base/$(rootdir)