chiark / gitweb /
udev: dm has been fixed in the meantime
[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 # Dirs of external packages
21 dbuspolicydir=@dbuspolicydir@
22 dbussessionservicedir=@dbussessionservicedir@
23 dbussystemservicedir=@dbussystemservicedir@
24 dbusinterfacedir=@dbusinterfacedir@
25 udevrulesdir=@udevrulesdir@
26 pamlibdir=@pamlibdir@
27 pkgconfigdatadir=$(datadir)/pkgconfig
28
29 # Our own, non-special dirs
30 pkgsysconfdir=$(sysconfdir)/systemd
31 sessionunitdir=$(pkgdatadir)/session
32
33 # And these are the special ones for /
34 rootdir=@rootdir@
35 rootbindir=$(rootdir)/bin
36 rootlibexecdir=$(rootdir)/lib/systemd
37 systemunitdir=$(rootdir)/lib/systemd/system
38
39 AM_CPPFLAGS = \
40         -include $(top_builddir)/config.h \
41         -DSYSTEM_CONFIG_FILE=\"$(pkgsysconfdir)/system.conf\" \
42         -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
43         -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
44         -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
45         -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
46         -DSESSION_CONFIG_FILE=\"$(pkgsysconfdir)/session.conf\" \
47         -DSESSION_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/session\" \
48         -DSESSION_DATA_UNIT_PATH=\"$(sessionunitdir)\" \
49         -DCGROUP_AGENT_PATH=\"$(rootlibexecdir)/systemd-cgroups-agent\" \
50         -DSYSTEMD_BINARY_PATH=\"$(rootbindir)/systemd\" \
51         -DSYSTEMCTL_BINARY_PATH=\"$(rootbindir)/systemctl\" \
52         -DRUNTIME_DIR=\"$(localstatedir)/run\" \
53         -DRANDOM_SEED=\"$(localstatedir)/lib/random-seed\" \
54         -I $(top_srcdir)/src
55
56 rootbin_PROGRAMS = \
57         systemd \
58         systemctl \
59         systemd-notify
60
61 bin_PROGRAMS = \
62         systemd-cgls
63
64 if HAVE_GTK
65 bin_PROGRAMS += \
66         systemadm
67 endif
68
69 rootlibexec_PROGRAMS = \
70         systemd-logger \
71         systemd-cgroups-agent \
72         systemd-initctl \
73         systemd-update-utmp \
74         systemd-random-seed \
75         systemd-shutdownd \
76         systemd-auto-console-getty
77
78 noinst_PROGRAMS = \
79         test-engine \
80         test-job-type \
81         test-ns \
82         test-loopback \
83         test-daemon \
84         test-cgroup \
85         test-env-replace
86
87 if HAVE_PAM
88 pamlib_LTLIBRARIES = \
89         pam_systemd.la
90 endif
91
92 dist_pkgsysconf_DATA = \
93         src/system.conf
94
95 dist_dbuspolicy_DATA = \
96         src/org.freedesktop.systemd1.conf
97
98 dist_dbussystemservice_DATA = \
99         src/org.freedesktop.systemd1.service
100
101 dist_udevrules_DATA = \
102         src/99-systemd.rules
103
104 dbusinterface_DATA = \
105         org.freedesktop.systemd1.Manager.xml \
106         org.freedesktop.systemd1.Job.xml \
107         org.freedesktop.systemd1.Unit.xml \
108         org.freedesktop.systemd1.Service.xml \
109         org.freedesktop.systemd1.Socket.xml \
110         org.freedesktop.systemd1.Timer.xml \
111         org.freedesktop.systemd1.Target.xml \
112         org.freedesktop.systemd1.Device.xml \
113         org.freedesktop.systemd1.Mount.xml \
114         org.freedesktop.systemd1.Automount.xml \
115         org.freedesktop.systemd1.Snapshot.xml \
116         org.freedesktop.systemd1.Swap.xml \
117         org.freedesktop.systemd1.Path.xml
118
119 dist_systemunit_DATA = \
120         units/emergency.service \
121         units/emergency.target \
122         units/basic.target \
123         units/getty.target \
124         units/halt.target \
125         units/local-fs.target \
126         units/network.target \
127         units/nss-lookup.target \
128         units/mail-transfer-agent.target \
129         units/poweroff.target \
130         units/reboot.target \
131         units/rescue.target \
132         units/rpcbind.target \
133         units/rtc-set.target \
134         units/shutdown.target \
135         units/umount.target \
136         units/sigpwr.target \
137         units/sockets.target \
138         units/swap.target \
139         units/dbus.target \
140         units/systemd-initctl.socket \
141         units/systemd-logger.socket \
142         units/systemd-shutdownd.socket \
143         units/systemd-auto-console-getty.service \
144         units/dev-hugepages.automount \
145         units/dev-hugepages.mount \
146         units/dev-mqueue.automount \
147         units/dev-mqueue.mount \
148         units/proc-sys-fs-binfmt_misc.automount \
149         units/proc-sys-fs-binfmt_misc.mount \
150         units/sys-kernel-debug.automount \
151         units/sys-kernel-debug.mount \
152         units/sys-kernel-security.automount \
153         units/sys-kernel-security.mount \
154         units/tmp.mount \
155         units/var-lock.mount \
156         units/var-lock.service \
157         units/var-run.mount \
158         units/var-run.service \
159         units/hwclock-save.service \
160         units/sysctl.service \
161         units/printer.target \
162         units/bluetooth.target \
163         units/smartcard.target
164
165 nodist_systemunit_DATA = \
166         units/sysinit.target \
167         units/getty@.service \
168         units/graphical.target \
169         units/remote-fs.target \
170         units/multi-user.target \
171         units/systemd-initctl.service \
172         units/systemd-logger.service \
173         units/systemd-shutdownd.service \
174         units/systemd-auto-console-getty.service \
175         units/systemd-update-utmp-runlevel.service \
176         units/systemd-update-utmp-shutdown.service \
177         units/systemd-random-seed-save.service \
178         units/systemd-random-seed-load.service \
179         units/syslog.target
180
181 dist_sessionunit_DATA = \
182         units/session/default.target
183
184 nodist_sessionunit_DATA = \
185         units/session/remote-fs.target \
186         units/session/exit.service
187
188 EXTRA_DIST = \
189         units/sysinit.target.m4 \
190         units/getty@.service.m4 \
191         units/graphical.target.m4 \
192         units/multi-user.target.m4 \
193         units/remote-fs.target.m4 \
194         units/systemd-initctl.service.in \
195         units/systemd-logger.service.in \
196         units/systemd-shutdownd.service.in \
197         units/systemd-auto-console-getty.service.in \
198         units/systemd-update-utmp-runlevel.service.in \
199         units/systemd-update-utmp-shutdown.service.in \
200         units/systemd-random-seed-save.service.in \
201         units/systemd-random-seed-load.service.in \
202         units/syslog.target.in \
203         units/session/exit.service.in \
204         systemd.pc.in
205
206 if TARGET_FEDORA
207 dist_systemunit_DATA += \
208         units/fedora/halt.service \
209         units/fedora/killall.service \
210         units/fedora/poweroff.service \
211         units/fedora/prefdm.service \
212         units/fedora/rc-local.service \
213         units/fedora/reboot.service \
214         units/fedora/sysinit.service \
215         units/fedora/single.service \
216         units/fedora/plymouth-quit.service \
217         units/fedora/plymouth-reboot.service \
218         units/fedora/plymouth-poweroff.service \
219         units/fedora/plymouth-halt.service
220 endif
221
222 if TARGET_SUSE
223 dist_systemunit_DATA += \
224         units/suse/halt.service \
225         units/suse/poweroff.service \
226         units/suse/reboot.service \
227         units/suse/fsck.target
228 endif
229
230 if TARGET_GENTOO
231 dist_systemunit_DATA += \
232         units/gentoo/halt.service \
233         units/gentoo/killall.service \
234         units/gentoo/poweroff.service \
235         units/gentoo/reboot.service \
236         units/gentoo/xdm.service
237 endif
238
239 if TARGET_ARCH
240 dist_systemunit_DATA += \
241         units/arch/sysinit.service \
242         units/arch/rc-local.service \
243         units/arch/halt.service \
244         units/arch/poweroff.service \
245         units/arch/reboot.service
246 endif
247
248 dist_doc_DATA = \
249         README \
250         LICENSE \
251         DISTRO_PORTING \
252         src/sd-daemon.h \
253         src/sd-daemon.c
254
255 pkgconfigdata_DATA = \
256         systemd.pc
257
258 noinst_LTLIBRARIES = \
259         libsystemd-basic.la \
260         libsystemd-core.la
261
262 libsystemd_basic_la_SOURCES = \
263         src/util.c \
264         src/label.c \
265         src/hashmap.c \
266         src/set.c \
267         src/strv.c \
268         src/conf-parser.c \
269         src/socket-util.c \
270         src/log.c \
271         src/ratelimit.c
272
273 libsystemd_basic_la_CFLAGS = \
274         $(AM_CFLAGS) \
275         $(SELINUX_CFLAGS)
276
277 libsystemd_basic_la_LIBADD = \
278         $(SELINUX_LIBS)
279
280 libsystemd_core_la_SOURCES = \
281         src/unit.c \
282         src/job.c \
283         src/manager.c \
284         src/path-lookup.c \
285         src/load-fragment.c \
286         src/service.c \
287         src/automount.c \
288         src/mount.c \
289         src/swap.c \
290         src/device.c \
291         src/target.c \
292         src/snapshot.c \
293         src/socket.c \
294         src/timer.c \
295         src/path.c \
296         src/load-dropin.c \
297         src/execute.c \
298         src/dbus.c \
299         src/dbus-manager.c \
300         src/dbus-unit.c \
301         src/dbus-job.c \
302         src/dbus-service.c \
303         src/dbus-socket.c \
304         src/dbus-timer.c \
305         src/dbus-target.c \
306         src/dbus-mount.c \
307         src/dbus-automount.c \
308         src/dbus-swap.c \
309         src/dbus-snapshot.c \
310         src/dbus-device.c \
311         src/dbus-execute.c \
312         src/dbus-path.c \
313         src/cgroup.c \
314         src/mount-setup.c \
315         src/hostname-setup.c \
316         src/loopback-setup.c \
317         src/kmod-setup.c \
318         src/specifier.c \
319         src/unit-name.c \
320         src/fdset.c \
321         src/namespace.c \
322         src/tcpwrap.c \
323         src/cgroup-util.c
324
325 libsystemd_core_la_CFLAGS = \
326         $(AM_CFLAGS) \
327         $(DBUS_CFLAGS) \
328         $(UDEV_CFLAGS) \
329         $(LIBWRAP_CFLAGS) \
330         $(PAM_CFLAGS) \
331         $(AUDIT_CFLAGS)
332
333 libsystemd_core_la_LIBADD = \
334         libsystemd-basic.la \
335         $(DBUS_LIBS) \
336         $(UDEV_LIBS) \
337         $(LIBWRAP_LIBS) \
338         $(PAM_LIBS) \
339         $(AUDIT_LIBS)
340
341 # This is needed because automake is buggy in how it generates the
342 # rules for C programs, but not Vala programs.  We therefore can't
343 # list the .h files as dependencies if we want make dist to work.
344
345 EXTRA_DIST += \
346         ${libsystemd_basic_la_SOURCES:.c=.h} \
347         ${libsystemd_core_la_SOURCES:.c=.h} \
348         src/macro.h \
349         src/ioprio.h \
350         src/missing.h \
351         src/list.h \
352         src/securebits.h \
353         src/linux/auto_dev-ioctl.h \
354         src/initreq.h \
355         src/sd-daemon.h \
356         src/special.h \
357         src/dbus-common.h \
358         src/bus-errors.h \
359         src/cgroup-show.h \
360         src/utmp-wtmp.h \
361         src/build.h \
362         src/shutdownd.h
363
364 MANPAGES = \
365         man/systemd.1 \
366         man/systemctl.1 \
367         man/systemadm.1 \
368         man/systemd-cgls.1 \
369         man/systemd-notify.1 \
370         man/sd_notify.3 \
371         man/sd_booted.3 \
372         man/sd_listen_fds.3 \
373         man/sd_is_fifo.3 \
374         man/systemd.unit.5 \
375         man/systemd.service.5 \
376         man/systemd.socket.5 \
377         man/systemd.mount.5 \
378         man/systemd.automount.5 \
379         man/systemd.swap.5 \
380         man/systemd.timer.5 \
381         man/systemd.path.5 \
382         man/systemd.target.5 \
383         man/systemd.device.5 \
384         man/systemd.snapshot.5 \
385         man/systemd.exec.5 \
386         man/daemon.7 \
387         man/sd-daemon.7 \
388         man/runlevel.8 \
389         man/telinit.8 \
390         man/halt.8 \
391         man/shutdown.8 \
392         man/pam_systemd.8 \
393         man/systemd.conf.5
394
395 MANPAGES_ALIAS = \
396         man/reboot.8 \
397         man/poweroff.8 \
398         man/sd_is_socket.3 \
399         man/sd_is_socket_unix.3 \
400         man/sd_is_socket_inet.3 \
401         man/sd_notifyf.3 \
402         man/init.1
403
404 man/reboot.8: man/halt.8
405 man/poweroff.8: man/halt.8
406 man/sd_is_socket.3: man/sd_is_fifo.3
407 man/sd_is_socket_unix.3: man/sd_is_fifo.3
408 man/sd_is_socket_inet.3: man/sd_is_fifo.3
409 man/sd_notifyf.3: man/sd_notify.3
410 man/init.1: man/systemd.1
411
412 dist_man_MANS = \
413         $(MANPAGES) \
414         $(MANPAGES_ALIAS)
415
416 nodist_man_MANS = \
417         man/systemd.special.7
418
419 XML_FILES = \
420         ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
421
422 XML_IN_FILES = \
423         ${patsubst %.1,%.xml.in,${patsubst %.3,%.xml.in,${patsubst %.5,%.xml.in,${patsubst %.7,%.xml.in,${patsubst %.8,%.xml.in,$(nodist_man_MANS)}}}}}
424
425 dist_noinst_DATA = \
426         ${XML_FILES:.xml=.html}
427
428 nodist_noinst_DATA = \
429         ${XML_IN_FILES:.xml.in=.html}
430
431 EXTRA_DIST += \
432         $(XML_FILES) \
433         $(XML_IN_FILES) \
434         ${nodist_man_MANS:=.in} \
435         ${XML_IN_FILES:.xml.in=.html.in}
436
437 systemd_SOURCES = \
438         src/main.c
439
440 systemd_CFLAGS = \
441         $(AM_CFLAGS) \
442         $(DBUS_CFLAGS) \
443         $(UDEV_CFLAGS)
444
445 systemd_LDADD = \
446         libsystemd-core.la
447
448 test_engine_SOURCES = \
449         src/test-engine.c
450
451 test_engine_CFLAGS = $(systemd_CFLAGS)
452 test_engine_LDADD = $(systemd_LDADD)
453
454 test_job_type_SOURCES = \
455         src/test-job-type.c
456
457 test_job_type_CFLAGS = $(systemd_CFLAGS)
458 test_job_type_LDADD = $(systemd_LDADD)
459
460 test_ns_SOURCES = \
461         src/test-ns.c
462
463 test_ns_CFLAGS = $(systemd_CFLAGS)
464 test_ns_LDADD = $(systemd_LDADD)
465
466 test_loopback_SOURCES = \
467         src/test-loopback.c \
468         src/loopback-setup.c
469
470 test_loopback_LDADD = \
471         libsystemd-basic.la
472
473 test_daemon_SOURCES = \
474         src/test-daemon.c \
475         src/sd-daemon.c
476
477 test_daemon_LDADD = \
478         libsystemd-basic.la
479
480 test_cgroup_SOURCES = \
481         src/test-cgroup.c \
482         src/cgroup-util.c
483
484 test_cgroup_CFLAGS = \
485         $(AM_CFLAGS)
486
487 test_cgroup_LDADD = \
488         libsystemd-basic.la
489
490 test_env_replace_SOURCES = \
491         src/test-env-replace.c
492
493 test_env_replace_CFLAGS = \
494         $(AM_CFLAGS)
495
496 test_env_replace_LDADD = \
497         libsystemd-basic.la
498
499 systemd_logger_SOURCES = \
500         src/logger.c \
501         src/sd-daemon.c \
502         src/tcpwrap.c
503
504 systemd_logger_LDADD = \
505         libsystemd-basic.la \
506         $(LIBWRAP_LIBS)
507
508 systemd_initctl_SOURCES = \
509         src/initctl.c \
510         src/sd-daemon.c \
511         src/dbus-common.c
512
513 systemd_initctl_CFLAGS = \
514         $(AM_CFLAGS) \
515         $(DBUS_CFLAGS)
516
517 systemd_initctl_LDADD = \
518         libsystemd-basic.la \
519         $(DBUS_LIBS)
520
521 systemd_update_utmp_SOURCES = \
522         src/update-utmp.c \
523         src/dbus-common.c \
524         src/utmp-wtmp.c
525
526 systemd_update_utmp_CFLAGS = \
527         $(AM_CFLAGS) \
528         $(DBUS_CFLAGS) \
529         $(AUDIT_CFLAGS)
530
531 systemd_update_utmp_LDADD = \
532         libsystemd-basic.la \
533         $(DBUS_LIBS) \
534         $(AUDIT_LIBS)
535
536 systemd_random_seed_SOURCES = \
537         src/random-seed.c
538
539 systemd_random_seed_CFLAGS = \
540         $(AM_CFLAGS)
541
542 systemd_random_seed_LDADD = \
543         libsystemd-basic.la
544
545 systemd_shutdownd_SOURCES = \
546         src/utmp-wtmp.c \
547         src/sd-daemon.c \
548         src/shutdownd.c
549
550 systemd_shutdownd_CFLAGS = \
551         $(AM_CFLAGS)
552
553 systemd_shutdownd_LDADD = \
554         libsystemd-basic.la
555
556 systemd_auto_console_getty_SOURCES = \
557         src/auto-console-getty.c \
558         src/dbus-common.c
559
560 systemd_auto_console_getty_CFLAGS = \
561         $(AM_CFLAGS) \
562         $(DBUS_CFLAGS)
563
564 systemd_auto_console_getty_LDADD = \
565         libsystemd-basic.la \
566         $(DBUS_LIBS)
567
568 systemd_cgroups_agent_SOURCES = \
569         src/cgroups-agent.c \
570         src/dbus-common.c
571
572 systemd_cgroups_agent_CFLAGS = \
573         $(AM_CFLAGS) \
574         $(DBUS_CFLAGS)
575
576 systemd_cgroups_agent_LDADD = \
577         libsystemd-basic.la \
578         $(DBUS_LIBS)
579
580 systemctl_SOURCES = \
581         src/systemctl.c \
582         src/utmp-wtmp.c \
583         src/dbus-common.c \
584         src/path-lookup.c \
585         src/sd-daemon.c \
586         src/cgroup-show.c \
587         src/cgroup-util.c
588
589 systemctl_CFLAGS = \
590         $(AM_CFLAGS) \
591         $(DBUS_CFLAGS)
592
593 systemctl_LDADD = \
594         libsystemd-basic.la \
595         $(DBUS_LIBS)
596
597 systemd_notify_SOURCES = \
598         src/notify.c \
599         src/sd-daemon.c
600
601 systemd_notify_LDADD = \
602         libsystemd-basic.la
603
604 systemd_cgls_SOURCES = \
605         src/cgls.c \
606         src/cgroup-show.c \
607         src/cgroup-util.c
608
609 systemd_cgls_CFLAGS = \
610         $(AM_CFLAGS)
611
612 systemd_cgls_LDADD = \
613         libsystemd-basic.la
614
615 systemadm_SOURCES = \
616         src/systemadm.vala \
617         src/systemd-interfaces.vala
618
619 systemadm_CFLAGS = \
620         $(AM_CFLAGS) \
621         $(DBUSGLIB_CFLAGS) \
622         $(GTK_CFLAGS) \
623         -Wno-unused-variable \
624         -Wno-unused-function \
625         -Wno-shadow \
626         -Wno-format-nonliteral
627
628 systemadm_VALAFLAGS = \
629         --pkg=dbus-glib-1 \
630         --pkg=posix \
631         --pkg=gtk+-2.0 \
632         -g
633
634 systemadm_LDADD = \
635         $(DBUSGLIB_LIBS) \
636         $(GTK_LIBS)
637
638 pam_systemd_la_SOURCES = \
639         src/pam-module.c \
640         src/cgroup-util.c \
641         src/sd-daemon.c
642
643 pam_systemd_la_CFLAGS = \
644         $(AM_CFLAGS)
645         -fvisibility=hidden
646
647 pam_systemd_la_LDFLAGS = \
648         -module \
649         -export-dynamic \
650         -avoid-version \
651         -shared \
652         -export-symbols-regex '^pam_sm_.*'
653
654 pam_systemd_la_LIBADD = \
655         libsystemd-basic.la \
656         $(PAM_LIBS)
657
658 SED_PROCESS = \
659         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
660         $(SED)  -e 's,@rootlibexecdir\@,$(rootlibexecdir),g' \
661                 -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
662                 -e 's,@SYSTEMCTL\@,$(rootbindir)/systemctl,g' \
663                 -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
664                 -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
665                 -e 's,@systemunitdir\@,$(systemunitdir),g' \
666                 -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
667                 -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
668                 -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' \
669                 -e 's,@prefix\@,$(prefix),g' \
670                 < $< > $@
671
672 units/%: units/%.in Makefile
673         $(SED_PROCESS)
674
675 man/%: man/%.in Makefile
676         $(SED_PROCESS)
677
678 %.pc: %.pc.in Makefile
679         $(SED_PROCESS)
680
681 M4_PROCESS_SYSTEM = \
682         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
683         $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@
684
685 M4_PROCESS_SESSION = \
686         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
687         $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@
688
689 units/%: units/%.m4 Makefile
690         $(M4_PROCESS_SYSTEM)
691
692 units/session/%: units/%.m4 Makefile
693         $(M4_PROCESS_SESSION)
694
695 CLEANFILES = \
696         $(nodist_systemunit_DATA) \
697         $(nodist_sessionunit_DATA) \
698         $(nodist_man_MANS) \
699         ${XML_IN_FILES:.xml.in=.html} \
700         $(pkgconfigdata_DATA)
701
702 if HAVE_VALAC
703 CLEANFILES += \
704         ${systemadm_SOURCES:.vala=.c}
705 endif
706
707 if HAVE_XSLTPROC
708 XSLTPROC_FLAGS = \
709         --nonet \
710         --param funcsynopsis.style "'ansi'"
711
712 XSLTPROC_PROCESS_MAN = \
713         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
714         $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
715
716 XSLTPROC_PROCESS_MAN_IN = \
717         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
718         $(XSLTPROC) -o ${@:.in=} $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
719         mv ${@:.in=} $@
720
721 XSLTPROC_PROCESS_HTML = \
722         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
723         $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
724
725 XSLTPROC_PROCESS_HTML_IN = \
726         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
727         $(XSLTPROC) -o ${@:.in=} $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $< && \
728         mv ${@:.in=} $@
729
730 man/%.1: man/%.xml
731         $(XSLTPROC_PROCESS_MAN)
732
733 man/%.1.in: man/%.xml.in
734         $(XSLTPROC_PROCESS_MAN)
735
736 man/%.3: man/%.xml
737         $(XSLTPROC_PROCESS_MAN)
738
739 man/%.3.in: man/%.xml.in
740         $(XSLTPROC_PROCESS_MAN)
741
742 man/%.5: man/%.xml
743         $(XSLTPROC_PROCESS_MAN)
744
745 man/%.5.in: man/%.xml.in
746         $(XSLTPROC_PROCESS_MAN)
747
748 man/%.7: man/%.xml
749         $(XSLTPROC_PROCESS_MAN)
750
751 man/%.7.in: man/%.xml.in
752         $(XSLTPROC_PROCESS_MAN_IN)
753
754 man/%.8: man/%.xml
755         $(XSLTPROC_PROCESS_MAN)
756
757 man/%.8.in: man/%.xml.in
758         $(XSLTPROC_PROCESS_MAN_IN)
759
760 man/%.html: man/%.xml
761         $(XSLTPROC_PROCESS_HTML)
762
763 man/%.html.in: man/%.xml.in
764         $(XSLTPROC_PROCESS_HTML_IN)
765
766 CLEANFILES += \
767         $(dist_man_MANS) \
768         ${nodist_man_MANS:=.in} \
769         ${XML_FILES:.xml=.html} \
770         ${XML_IN_FILES:.xml.in=.html.in}
771 endif
772
773 org.freedesktop.systemd1.%.xml: systemd
774         $(AM_V_GEN)SYSTEMD_SKIP_API_MOUNTS=1 ./systemd --introspect=${@:.xml=} > $@
775
776 CLEANFILES += \
777         $(dbusinterface_DATA)
778
779 install-data-hook:
780         $(MKDIR_P) -m 0755 \
781                 $(DESTDIR)$(systemunitdir) \
782                 $(DESTDIR)$(sessionunitdir) \
783                 $(DESTDIR)$(systemunitdir)/sockets.target.wants \
784                 $(DESTDIR)$(systemunitdir)/sysinit.target.wants \
785                 $(DESTDIR)$(systemunitdir)/shutdown.target.wants \
786                 $(DESTDIR)$(systemunitdir)/runlevel1.target.wants \
787                 $(DESTDIR)$(systemunitdir)/runlevel2.target.wants \
788                 $(DESTDIR)$(systemunitdir)/runlevel3.target.wants \
789                 $(DESTDIR)$(systemunitdir)/runlevel4.target.wants \
790                 $(DESTDIR)$(systemunitdir)/runlevel5.target.wants \
791                 $(DESTDIR)$(pkgsysconfdir)/system \
792                 $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
793                 $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
794                 $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
795                 $(DESTDIR)$(pkgsysconfdir)/session \
796                 $(DESTDIR)$(sysconfdir)/xdg/systemd
797         $(MKDIR_P) -m 0755 $(DESTDIR)/cgroup || \
798                 echo "Don't forget to create /cgroup! Couldn't create it for you, continuing anyway."
799         ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
800                 rm -f session && \
801                 $(LN_S) $(pkgsysconfdir)/session session )
802         ( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
803                 rm -f systemd-initctl.socket systemd-logger.socket systemd-shutdownd.socket && \
804                 $(LN_S) ../systemd-logger.socket systemd-logger.socket && \
805                 $(LN_S) ../systemd-initctl.socket systemd-initctl.socket && \
806                 $(LN_S) ../systemd-shutdownd.socket systemd-shutdownd.socket )
807         ( cd $(DESTDIR)$(systemunitdir)/runlevel1.target.wants && \
808                 rm -f systemd-update-utmp-runlevel.service && \
809                 $(LN_S) ../systemd-update-utmp-runlevel.service )
810         ( cd $(DESTDIR)$(systemunitdir)/runlevel2.target.wants && \
811                 rm -f systemd-update-utmp-runlevel.service && \
812                 $(LN_S) ../systemd-update-utmp-runlevel.service )
813         ( cd $(DESTDIR)$(systemunitdir)/runlevel3.target.wants && \
814                 rm -f systemd-update-utmp-runlevel.service && \
815                 $(LN_S) ../systemd-update-utmp-runlevel.service )
816         ( cd $(DESTDIR)$(systemunitdir)/runlevel4.target.wants && \
817                 rm -f systemd-update-utmp-runlevel.service && \
818                 $(LN_S) ../systemd-update-utmp-runlevel.service )
819         ( cd $(DESTDIR)$(systemunitdir)/runlevel5.target.wants && \
820                 rm -f systemd-update-utmp-runlevel.service && \
821                 $(LN_S) ../systemd-update-utmp-runlevel.service )
822         ( cd $(DESTDIR)$(systemunitdir)/shutdown.target.wants && \
823                 rm -f systemd-update-utmp-shutdown.service && \
824                 $(LN_S) ../systemd-update-utmp-shutdown.service )
825         ( cd $(DESTDIR)$(sessionunitdir) && \
826                 rm -f shutdown.target sockets.target local-fs.target swap.target bluetooth.target printer.target && \
827                 $(LN_S) $(systemunitdir)/shutdown.target shutdown.target && \
828                 $(LN_S) $(systemunitdir)/sockets.target sockets.target && \
829                 $(LN_S) $(systemunitdir)/local-fs.target local-fs.target && \
830                 $(LN_S) $(systemunitdir)/swap.target swap.target && \
831                 $(LN_S) $(systemunitdir)/bluetooth.target bluetooth.target && \
832                 $(LN_S) $(systemunitdir)/printer.target printer.target)
833         ( cd $(DESTDIR)$(systemunitdir) && \
834                 rm -f runlevel0.target runlevel1.target runlevel2.target runlevel3.target runlevel4.target runlevel5.target runlevel6.target && \
835                 $(LN_S) poweroff.target runlevel0.target && \
836                 $(LN_S) rescue.target runlevel1.target && \
837                 $(LN_S) multi-user.target runlevel2.target && \
838                 $(LN_S) multi-user.target runlevel3.target && \
839                 $(LN_S) multi-user.target runlevel4.target && \
840                 $(LN_S) graphical.target runlevel5.target && \
841                 $(LN_S) reboot.target runlevel6.target )
842         ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
843                 rm -f default.target ctrl-alt-del.target kbrequest.target && \
844                 $(LN_S) $(systemunitdir)/graphical.target default.target && \
845                 $(LN_S) $(systemunitdir)/reboot.target ctrl-alt-del.target && \
846                 $(LN_S) $(systemunitdir)/rescue.target kbrequest.target )
847         ( cd $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants && \
848                 rm -f getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service systemd-auto-console-getty.service && \
849                 $(LN_S) $(systemunitdir)/getty@.service getty@tty1.service && \
850                 $(LN_S) $(systemunitdir)/getty@.service getty@tty2.service && \
851                 $(LN_S) $(systemunitdir)/getty@.service getty@tty3.service && \
852                 $(LN_S) $(systemunitdir)/getty@.service getty@tty4.service && \
853                 $(LN_S) $(systemunitdir)/getty@.service getty@tty5.service && \
854                 $(LN_S) $(systemunitdir)/getty@.service getty@tty6.service && \
855                 $(LN_S) $(systemunitdir)/systemd-auto-console-getty.service systemd-auto-console-getty.service )
856         ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
857                 rm -f getty.target remote-fs.target && \
858                 $(LN_S) $(systemunitdir)/getty.target getty.target && \
859                 $(LN_S) $(systemunitdir)/remote-fs.target remote-fs.target )
860         ( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
861                 rm -f dev-hugepages.automount \
862                         dev-mqueue.automount \
863                         proc-sys-fs-binfmt_misc.automount \
864                         sys-kernel-debug.automount \
865                         sys-kernel-security.automount && \
866                 $(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
867                 $(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
868                 $(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
869                 $(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount && \
870                 $(LN_S) ../sys-kernel-security.automount sys-kernel-security.automount )
871         ( cd $(DESTDIR)$(dbussessionservicedir) && \
872                 rm -f org.freedesktop.systemd1.service && \
873                 $(LN_S) ../system-services/org.freedesktop.systemd1.service org.freedesktop.systemd1.service )
874 if TARGET_FEDORA
875         $(MKDIR_P) -m 0755 \
876                 $(DESTDIR)$(SYSTEM_SYSVINIT_PATH) \
877                 $(DESTDIR)$(systemunitdir)/reboot.target.wants \
878                 $(DESTDIR)$(systemunitdir)/poweroff.target.wants \
879                 $(DESTDIR)$(systemunitdir)/halt.target.wants \
880                 $(DESTDIR)$(systemunitdir)/rescue.target.wants \
881                 $(DESTDIR)$(systemunitdir)/multi-user.target.wants
882         ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
883                 rm -f display-manager.service && \
884                 $(LN_S) $(systemunitdir)/prefdm.service display-manager.service )
885         ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
886                 rm -f prefdm.service && \
887                 $(LN_S) $(systemunitdir)/prefdm.service prefdm.service )
888         ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
889                 rm -f rc-local.service && \
890                 $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
891         ( cd $(DESTDIR)$(systemunitdir)/rescue.target.wants && \
892                 rm -f single.service && \
893                 $(LN_S) $(systemunitdir)/single.service single.service )
894         ( cd $(DESTDIR)$(systemunitdir)/multi-user.target.wants && \
895                 rm -f plymouth-quit.service && \
896                 $(LN_S) ../plymouth-quit.service plymouth-quit.service )
897         ( cd $(DESTDIR)$(systemunitdir)/reboot.target.wants && \
898                 rm -f plymouth-reboot.service && \
899                 $(LN_S) ../plymouth-reboot.service plymouth-reboot.service )
900         ( cd $(DESTDIR)$(systemunitdir)/poweroff.target.wants && \
901                 rm -f plymouth-poweroff.service && \
902                 $(LN_S) ../plymouth-poweroff.service plymouth-poweroff.service )
903         ( cd $(DESTDIR)$(systemunitdir)/halt.target.wants && \
904                 rm -f plymouth-halt.service && \
905                 $(LN_S) ../plymouth-halt.service plymouth-halt.service )
906         ( cd $(DESTDIR)$(systemunitdir) && \
907                 rm -f local.service && \
908                 $(LN_S) rc-local.service local.service )
909         ( cd $(DESTDIR)$(SYSTEM_SYSVINIT_PATH) && \
910                 $(LN_S) halt reboot > /dev/null 2>&1 || true )
911 endif
912 if TARGET_GENTOO
913         ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
914                 rm -f display-manager.service && \
915                 $(LN_S) $(systemunitdir)/xdm.service display-manager.service )
916         ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
917                 rm -f xdm.service && \
918                 $(LN_S) $(systemunitdir)/xdm.service xdm.service )
919 endif
920 if !TARGET_SUSE
921         ( cd $(DESTDIR)$(systemunitdir) && \
922                 rm -f fsck.target && \
923                 $(LN_S) sysinit.target fsck.target )
924 endif
925
926 DISTCHECK_CONFIGURE_FLAGS = \
927         --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
928         --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
929         --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
930         --with-dbusinterfacedir=$$dc_install_base/$(dbusinterfacedir) \
931         --with-udevrulesdir=$$dc_install_base/$(udevrulesdir) \
932         --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
933         --with-rootdir=$$dc_install_base/$(rootdir)
934
935 upload: all distcheck
936         cp -v systemd-$(VERSION).tar.bz2 /home/lennart/cvs.fedora/systemd/devel/
937         scp systemd-$(VERSION).tar.bz2 fdo:/srv/www.freedesktop.org/www/software/systemd/
938         scp man/*.html tango:public/systemd-man/
939
940 git-tag:
941         git tag "v$(VERSION)" -m "systemd $(VERSION)"