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