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