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