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