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