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