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