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