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