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