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