chiark / gitweb /
manager: optionally print status updates to console on boot
[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_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
42         -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
43         -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
44         -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
45         -DSESSION_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/session\" \
46         -DSESSION_DATA_UNIT_PATH=\"$(sessionunitdir)\" \
47         -DCGROUP_AGENT_PATH=\"$(rootlibexecdir)/systemd-cgroups-agent\" \
48         -DSYSTEMD_BINARY_PATH=\"$(rootbindir)/systemd\" \
49         -DSYSTEMCTL_BINARY_PATH=\"$(rootbindir)/systemctl\" \
50         -DRUNTIME_DIR=\"$(localstatedir)/run\" \
51         -I $(top_srcdir)/src
52
53 rootbin_PROGRAMS = \
54         systemd \
55         systemctl \
56         systemd-notify
57
58 bin_PROGRAMS = \
59         systemd-install
60
61 if HAVE_GTK
62 bin_PROGRAMS += \
63         systemadm
64 endif
65
66 rootlibexec_PROGRAMS = \
67         systemd-logger \
68         systemd-cgroups-agent \
69         systemd-initctl
70
71 noinst_PROGRAMS = \
72         test-engine \
73         test-job-type \
74         test-ns \
75         test-loopback \
76         test-daemon \
77         test-cgroup
78
79 if HAVE_PAM
80 pamlib_LTLIBRARIES = \
81         pam_systemd.la
82 endif
83
84 dist_dbuspolicy_DATA = \
85         src/org.freedesktop.systemd1.conf
86
87 dist_dbussystemservice_DATA = \
88         src/org.freedesktop.systemd1.service
89
90 dist_udevrules_DATA = \
91         src/99-systemd.rules
92
93 dbusinterface_DATA = \
94         org.freedesktop.systemd1.Manager.xml \
95         org.freedesktop.systemd1.Job.xml \
96         org.freedesktop.systemd1.Unit.xml \
97         org.freedesktop.systemd1.Service.xml \
98         org.freedesktop.systemd1.Socket.xml \
99         org.freedesktop.systemd1.Timer.xml \
100         org.freedesktop.systemd1.Target.xml \
101         org.freedesktop.systemd1.Device.xml \
102         org.freedesktop.systemd1.Mount.xml \
103         org.freedesktop.systemd1.Automount.xml \
104         org.freedesktop.systemd1.Snapshot.xml \
105         org.freedesktop.systemd1.Swap.xml \
106         org.freedesktop.systemd1.Path.xml
107
108 dist_systemunit_DATA = \
109         units/emergency.service \
110         units/basic.target \
111         units/getty.target \
112         units/halt.target \
113         units/local-fs.target \
114         units/network.target \
115         units/nss-lookup.target \
116         units/mail-transfer-agent.target \
117         units/poweroff.target \
118         units/reboot.target \
119         units/rescue.target \
120         units/rpcbind.target \
121         units/rtc-set.target \
122         units/shutdown.target \
123         units/sigpwr.target \
124         units/sockets.target \
125         units/swap.target \
126         units/systemd-initctl.socket \
127         units/systemd-logger.socket \
128         units/dev-hugepages.automount \
129         units/dev-hugepages.mount \
130         units/dev-mqueue.automount \
131         units/dev-mqueue.mount \
132         units/proc-sys-fs-binfmt_misc.automount \
133         units/proc-sys-fs-binfmt_misc.mount \
134         units/sys-kernel-debug.automount \
135         units/sys-kernel-debug.mount \
136         units/sys-kernel-security.automount \
137         units/sys-kernel-security.mount \
138         units/var-lock.mount \
139         units/var-run.mount
140
141 nodist_systemunit_DATA = \
142         units/sysinit.target \
143         units/getty@.service \
144         units/graphical.target \
145         units/remote-fs.target \
146         units/multi-user.target \
147         units/systemd-initctl.service \
148         units/systemd-logger.service \
149         units/syslog.target \
150         units/dbus.target
151
152 dist_sessionunit_DATA = \
153         units/session/default.target
154
155 nodist_sessionunit_DATA = \
156         units/session/remote-fs.target \
157         units/session/exit.service
158
159 EXTRA_DIST = \
160         units/sysinit.target.m4 \
161         units/getty@.service.m4 \
162         units/graphical.target.m4 \
163         units/multi-user.target.m4 \
164         units/remote-fs.target.m4 \
165         units/systemd-initctl.service.in \
166         units/systemd-logger.service.in \
167         units/syslog.target.in \
168         units/dbus.target.in \
169         units/session/exit.service.in \
170         systemd.pc.in
171
172 if TARGET_FEDORA
173 dist_systemunit_DATA += \
174         units/fedora/halt.service \
175         units/fedora/killall.service \
176         units/fedora/poweroff.service \
177         units/fedora/prefdm.service \
178         units/fedora/rc-local.service \
179         units/fedora/reboot.service \
180         units/fedora/sysinit.service
181 endif
182
183 if TARGET_SUSE
184 dist_systemunit_DATA += \
185         units/suse/halt.service \
186         units/suse/poweroff.service \
187         units/suse/reboot.service
188 endif
189
190 if TARGET_GENTOO
191 dist_systemunit_DATA += \
192         units/gentoo/halt.service \
193         units/gentoo/killall.service \
194         units/gentoo/poweroff.service \
195         units/gentoo/reboot.service \
196         units/gentoo/xdm.service
197 endif
198
199 if TARGET_ARCH
200 dist_systemunit_DATA += \
201         units/arch/sysinit.service \
202         units/arch/rc-local.service \
203         units/arch/halt.service \
204         units/arch/poweroff.service \
205         units/arch/reboot.service
206 endif
207
208 dist_doc_DATA = \
209         README \
210         LICENSE \
211         DISTRO_PORTING \
212         src/sd-daemon.h \
213         src/sd-daemon.c
214
215 pkgconfigdata_DATA = \
216         systemd.pc
217
218 noinst_LTLIBRARIES = \
219         libsystemd-basic.la \
220         libsystemd-core.la
221
222 libsystemd_basic_la_SOURCES = \
223         src/util.c \
224         src/hashmap.c \
225         src/set.c \
226         src/strv.c \
227         src/conf-parser.c \
228         src/socket-util.c \
229         src/log.c \
230         src/ratelimit.c
231
232 libsystemd_core_la_SOURCES = \
233         src/unit.c \
234         src/job.c \
235         src/manager.c \
236         src/path-lookup.c \
237         src/load-fragment.c \
238         src/service.c \
239         src/automount.c \
240         src/mount.c \
241         src/swap.c \
242         src/device.c \
243         src/target.c \
244         src/snapshot.c \
245         src/socket.c \
246         src/timer.c \
247         src/path.c \
248         src/load-dropin.c \
249         src/execute.c \
250         src/dbus.c \
251         src/dbus-manager.c \
252         src/dbus-unit.c \
253         src/dbus-job.c \
254         src/dbus-service.c \
255         src/dbus-socket.c \
256         src/dbus-timer.c \
257         src/dbus-target.c \
258         src/dbus-mount.c \
259         src/dbus-automount.c \
260         src/dbus-swap.c \
261         src/dbus-snapshot.c \
262         src/dbus-device.c \
263         src/dbus-execute.c \
264         src/dbus-path.c \
265         src/cgroup.c \
266         src/mount-setup.c \
267         src/hostname-setup.c \
268         src/loopback-setup.c \
269         src/kmod-setup.c \
270         src/modprobe-setup.c \
271         src/utmp-wtmp.c \
272         src/specifier.c \
273         src/unit-name.c \
274         src/fdset.c \
275         src/namespace.c \
276         src/tcpwrap.c \
277         src/cgroup-util.c
278
279 libsystemd_core_la_CFLAGS = \
280         $(AM_CFLAGS) \
281         $(DBUS_CFLAGS) \
282         $(UDEV_CFLAGS) \
283         $(CGROUP_CFLAGS)
284
285 libsystemd_core_la_LIBADD = \
286         libsystemd-basic.la \
287         $(DBUS_LIBS) \
288         $(UDEV_LIBS) \
289         $(CGROUP_LIBS) \
290         $(LIBWRAP_LIBS) \
291         $(PAM_LIBS)
292
293 # This is needed because automake is buggy in how it generates the
294 # rules for C programs, but not Vala programs.  We therefore can't
295 # list the .h files as dependencies if we want make dist to work.
296
297 EXTRA_DIST += \
298         ${libsystemd_basic_la_SOURCES:.c=.h} \
299         ${libsystemd_core_la_SOURCES:.c=.h} \
300         src/macro.h \
301         src/ioprio.h \
302         src/missing.h \
303         src/list.h \
304         src/securebits.h \
305         src/linux/auto_dev-ioctl.h \
306         src/initreq.h \
307         src/sd-daemon.h \
308         src/special.h \
309         src/dbus-common.h
310
311 MANPAGES = \
312         man/systemd.1 \
313         man/systemctl.1 \
314         man/systemadm.1 \
315         man/systemd-install.1 \
316         man/systemd-notify.1 \
317         man/sd_notify.3 \
318         man/sd_booted.3 \
319         man/sd_listen_fds.3 \
320         man/sd_is_fifo.3 \
321         man/systemd.unit.5 \
322         man/systemd.service.5 \
323         man/systemd.socket.5 \
324         man/systemd.mount.5 \
325         man/systemd.automount.5 \
326         man/systemd.swap.5 \
327         man/systemd.timer.5 \
328         man/systemd.path.5 \
329         man/systemd.target.5 \
330         man/systemd.device.5 \
331         man/systemd.snapshot.5 \
332         man/systemd.exec.5 \
333         man/daemon.7 \
334         man/sd-daemon.7 \
335         man/runlevel.8 \
336         man/telinit.8 \
337         man/halt.8 \
338         man/shutdown.8 \
339         man/pam_systemd.8
340
341 MANPAGES_ALIAS = \
342         man/reboot.8 \
343         man/poweroff.8 \
344         man/sd_is_socket.3 \
345         man/sd_is_socket_unix.3 \
346         man/sd_is_socket_inet.3 \
347         man/sd_notifyf.3 \
348         man/init.1
349
350 man/reboot.8: man/halt.8
351 man/poweroff.8: man/halt.8
352 man/sd_is_socket.3: man/sd_is_fifo.3
353 man/sd_is_socket_unix.3: man/sd_is_fifo.3
354 man/sd_is_socket_inet.3: man/sd_is_fifo.3
355 man/sd_notifyf.3: man/sd_notify.3
356 man/init.1: man/systemd.1
357
358 dist_man_MANS = \
359         $(MANPAGES) \
360         $(MANPAGES_ALIAS)
361
362 nodist_man_MANS = \
363         man/systemd.special.7
364
365 XML_FILES = \
366         ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
367
368 XML_IN_FILES = \
369         ${patsubst %.1,%.xml.in,${patsubst %.3,%.xml.in,${patsubst %.5,%.xml.in,${patsubst %.7,%.xml.in,${patsubst %.8,%.xml.in,$(nodist_man_MANS)}}}}}
370
371 dist_noinst_DATA = \
372         ${XML_FILES:.xml=.html}
373
374 nodist_noinst_DATA = \
375         ${XML_IN_FILES:.xml.in=.html}
376
377 EXTRA_DIST += \
378         $(XML_FILES) \
379         $(XML_IN_FILES) \
380         ${nodist_man_MANS:=.in} \
381         ${XML_IN_FILES:.xml.in=.html.in}
382
383 systemd_SOURCES = \
384         src/main.c
385
386 systemd_CFLAGS = \
387         $(AM_CFLAGS) \
388         $(DBUS_CFLAGS) \
389         $(UDEV_CFLAGS) \
390         $(CGROUP_CFLAGS)
391
392 systemd_LDADD = \
393         libsystemd-core.la
394
395 test_engine_SOURCES = \
396         src/test-engine.c
397
398 test_engine_CFLAGS = $(systemd_CFLAGS)
399 test_engine_LDADD = $(systemd_LDADD)
400
401 test_job_type_SOURCES = \
402         src/test-job-type.c
403
404 test_job_type_CFLAGS = $(systemd_CFLAGS)
405 test_job_type_LDADD = $(systemd_LDADD)
406
407 test_ns_SOURCES = \
408         src/test-ns.c
409
410 test_ns_CFLAGS = $(systemd_CFLAGS)
411 test_ns_LDADD = $(systemd_LDADD)
412
413 test_loopback_SOURCES = \
414         src/test-loopback.c \
415         src/loopback-setup.c
416
417 test_loopback_LDADD = \
418         libsystemd-basic.la
419
420 test_daemon_SOURCES = \
421         src/test-daemon.c \
422         src/sd-daemon.c
423
424 test_daemon_LDADD = \
425         libsystemd-basic.la
426
427 test_cgroup_SOURCES = \
428         src/test-cgroup.c \
429         src/cgroup-util.c
430
431 test_cgroup_CFLAGS = \
432         $(AM_CFLAGS) \
433         $(CGROUP_CFLAGS)
434
435 test_cgroup_LDADD = \
436         libsystemd-basic.la \
437         $(CGROUP_LIBS)
438
439 systemd_logger_SOURCES = \
440         src/logger.c \
441         src/sd-daemon.c \
442         src/tcpwrap.c
443
444 systemd_logger_LDADD = \
445         libsystemd-basic.la \
446         $(LIBWRAP_LIBS)
447
448 systemd_initctl_SOURCES = \
449         src/initctl.c \
450         src/sd-daemon.c
451
452 systemd_initctl_CFLAGS = \
453         $(AM_CFLAGS) \
454         $(DBUS_CFLAGS)
455
456 systemd_initctl_LDADD = \
457         libsystemd-basic.la \
458         $(DBUS_LIBS)
459
460 systemd_cgroups_agent_SOURCES = \
461         src/cgroups-agent.c
462
463 systemd_cgroups_agent_CFLAGS = \
464         $(AM_CFLAGS) \
465         $(DBUS_CFLAGS)
466
467 systemd_cgroups_agent_LDADD = \
468         libsystemd-basic.la \
469         $(DBUS_LIBS)
470
471 systemctl_SOURCES = \
472         src/systemctl.c \
473         src/utmp-wtmp.c \
474         src/dbus-common.c
475
476 systemctl_CFLAGS = \
477         $(AM_CFLAGS) \
478         $(DBUS_CFLAGS)
479
480 systemctl_LDADD = \
481         libsystemd-basic.la \
482         $(DBUS_LIBS)
483
484 systemd_notify_SOURCES = \
485         src/notify.c \
486         src/sd-daemon.c
487
488 systemd_notify_LDADD = \
489         libsystemd-basic.la
490
491 systemd_install_SOURCES = \
492         src/install.c \
493         src/path-lookup.c \
494         src/dbus-common.c
495
496 systemd_install_LDADD = \
497         libsystemd-basic.la \
498         $(DBUS_LIBS)
499
500 systemd_install_CFLAGS = \
501         $(AM_CFLAGS) \
502         $(DBUS_CFLAGS)
503
504 systemadm_SOURCES = \
505         src/systemadm.vala \
506         src/systemd-interfaces.vala
507
508 systemadm_CFLAGS = \
509         $(AM_CFLAGS) \
510         $(DBUSGLIB_CFLAGS) \
511         $(GTK_CFLAGS) \
512         -Wno-unused-variable \
513         -Wno-unused-function \
514         -Wno-shadow \
515         -Wno-format-nonliteral
516
517 systemadm_VALAFLAGS = \
518         --pkg=dbus-glib-1 \
519         --pkg=posix \
520         --pkg=gtk+-2.0 \
521         -g
522
523 systemadm_LDADD = \
524         $(DBUSGLIB_LIBS) \
525         $(GTK_LIBS)
526
527 pam_systemd_la_SOURCES = \
528         src/pam-module.c \
529         src/cgroup-util.c \
530         src/sd-daemon.c
531
532 pam_systemd_la_CFLAGS = \
533         $(AM_CFLAGS) \
534         $(CGROUP_CFLAGS) \
535         -fvisibility=hidden
536
537 pam_systemd_la_LDFLAGS = \
538         -module \
539         -export-dynamic \
540         -avoid-version \
541         -shared \
542         -export-symbols-regex '^pam_sm_.*'
543
544 pam_systemd_la_LIBADD = \
545         libsystemd-basic.la \
546         $(PAM_LIBS) \
547         $(CGROUP_LIBS)
548
549 SED_PROCESS = \
550         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
551         $(SED)  -e 's,@rootlibexecdir\@,$(rootlibexecdir),g' \
552                 -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
553                 -e 's,@SPECIAL_DBUS_SERVICE\@,$(SPECIAL_DBUS_SERVICE),g' \
554                 -e 's,@SYSTEMCTL\@,$(rootbindir)/systemctl,g' \
555                 -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
556                 -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
557                 -e 's,@systemunitdir\@,$(systemunitdir),g' \
558                 -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
559                 -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
560                 -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' \
561                 -e 's,@prefix\@,$(prefix),g' \
562                 < $< > $@
563
564 units/%: units/%.in Makefile
565         $(SED_PROCESS)
566
567 man/%: man/%.in Makefile
568         $(SED_PROCESS)
569
570 %.pc: %.pc.in Makefile
571         $(SED_PROCESS)
572
573 M4_PROCESS_SYSTEM = \
574         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
575         $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@
576
577 M4_PROCESS_SESSION = \
578         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
579         $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@
580
581 units/%: units/%.m4 Makefile
582         $(M4_PROCESS_SYSTEM)
583
584 units/session/%: units/%.m4 Makefile
585         $(M4_PROCESS_SESSION)
586
587 CLEANFILES = \
588         $(nodist_systemunit_DATA) \
589         $(nodist_sessionunit_DATA) \
590         $(nodist_man_MANS) \
591         ${XML_IN_FILES:.xml.in=.html} \
592         $(pkgconfigdata_DATA)
593
594 if HAVE_VALAC
595 CLEANFILES += \
596         ${systemadm_SOURCES:.vala=.c}
597 endif
598
599 if HAVE_XSLTPROC
600 XSLTPROC_FLAGS = \
601         --nonet \
602         --param funcsynopsis.style "'ansi'"
603
604 XSLTPROC_PROCESS_MAN = \
605         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
606         $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
607
608 XSLTPROC_PROCESS_MAN_IN = \
609         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
610         $(XSLTPROC) -o ${@:.in=} $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
611         mv ${@:.in=} $@
612
613 XSLTPROC_PROCESS_HTML = \
614         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
615         $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
616
617 XSLTPROC_PROCESS_HTML_IN = \
618         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
619         $(XSLTPROC) -o ${@:.in=} $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $< && \
620         mv ${@:.in=} $@
621
622 man/%.1: man/%.xml
623         $(XSLTPROC_PROCESS_MAN)
624
625 man/%.1.in: man/%.xml.in
626         $(XSLTPROC_PROCESS_MAN)
627
628 man/%.3: man/%.xml
629         $(XSLTPROC_PROCESS_MAN)
630
631 man/%.3.in: man/%.xml.in
632         $(XSLTPROC_PROCESS_MAN)
633
634 man/%.5: man/%.xml
635         $(XSLTPROC_PROCESS_MAN)
636
637 man/%.5.in: man/%.xml.in
638         $(XSLTPROC_PROCESS_MAN)
639
640 man/%.7: man/%.xml
641         $(XSLTPROC_PROCESS_MAN)
642
643 man/%.7.in: man/%.xml.in
644         $(XSLTPROC_PROCESS_MAN_IN)
645
646 man/%.8: man/%.xml
647         $(XSLTPROC_PROCESS_MAN)
648
649 man/%.8.in: man/%.xml.in
650         $(XSLTPROC_PROCESS_MAN_IN)
651
652 man/%.html: man/%.xml
653         $(XSLTPROC_PROCESS_HTML)
654
655 man/%.html.in: man/%.xml.in
656         $(XSLTPROC_PROCESS_HTML_IN)
657
658 CLEANFILES += \
659         $(dist_man_MANS) \
660         ${nodist_man_MANS:=.in} \
661         ${XML_FILES:.xml=.html} \
662         ${XML_IN_FILES:.xml.in=.html.in}
663 endif
664
665 org.freedesktop.systemd1.%.xml: systemd
666         $(AM_V_GEN)./systemd --introspect=${@:.xml=} > $@
667
668 CLEANFILES += \
669         $(dbusinterface_DATA)
670
671 install-data-hook:
672         $(MKDIR_P) -m 0755 \
673                 $(DESTDIR)$(systemunitdir) \
674                 $(DESTDIR)$(sessionunitdir) \
675                 $(DESTDIR)$(systemunitdir)/sockets.target.wants \
676                 $(DESTDIR)$(systemunitdir)/sysinit.target.wants \
677                 $(DESTDIR)$(pkgsysconfdir)/system \
678                 $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
679                 $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
680                 $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
681                 $(DESTDIR)$(pkgsysconfdir)/session \
682                 $(DESTDIR)$(sysconfdir)/xdg/systemd
683         $(MKDIR_P) -m 0755 $(DESTDIR)/cgroup || \
684                 echo "Don't forget to create /cgroup! Couldn't create it for you, continuing anyway."
685         ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
686                 rm -f session && \
687                 $(LN_S) $(pkgsysconfdir)/session session )
688         ( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
689                 rm -f systemd-initctl.socket systemd-logger.socket && \
690                 $(LN_S) ../systemd-logger.socket systemd-logger.socket && \
691                 $(LN_S) ../systemd-initctl.socket systemd-initctl.socket )
692         ( cd $(DESTDIR)$(sessionunitdir) && \
693                 rm -f shutdown.target sockets.target local-fs.target swap.target && \
694                 $(LN_S) $(systemunitdir)/shutdown.target shutdown.target && \
695                 $(LN_S) $(systemunitdir)/sockets.target sockets.target && \
696                 $(LN_S) $(systemunitdir)/local-fs.target local-fs.target && \
697                 $(LN_S) $(systemunitdir)/swap.target swap.target )
698         ( cd $(DESTDIR)$(systemunitdir) && \
699                 rm -f runlevel0.target runlevel1.target runlevel6.target && \
700                 $(LN_S) poweroff.target runlevel0.target && \
701                 $(LN_S) rescue.target runlevel1.target && \
702                 $(LN_S) reboot.target runlevel6.target )
703         ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
704                 rm -f default.target ctrl-alt-del.target kbrequest.target && \
705                 $(LN_S) $(systemunitdir)/graphical.target default.target && \
706                 $(LN_S) $(systemunitdir)/reboot.target ctrl-alt-del.target && \
707                 $(LN_S) $(systemunitdir)/rescue.target kbrequest.target && \
708                 rm -f runlevel2.target runlevel3.target runlevel4.target runlevel5.target && \
709                 $(LN_S) $(systemunitdir)/multi-user.target runlevel2.target && \
710                 $(LN_S) $(systemunitdir)/multi-user.target runlevel3.target && \
711                 $(LN_S) $(systemunitdir)/multi-user.target runlevel4.target && \
712                 $(LN_S) $(systemunitdir)/graphical.target runlevel5.target )
713         ( cd $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants && \
714                 rm -f getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service && \
715                 $(LN_S) $(systemunitdir)/getty@.service getty@tty1.service && \
716                 $(LN_S) $(systemunitdir)/getty@.service getty@tty2.service && \
717                 $(LN_S) $(systemunitdir)/getty@.service getty@tty3.service && \
718                 $(LN_S) $(systemunitdir)/getty@.service getty@tty4.service && \
719                 $(LN_S) $(systemunitdir)/getty@.service getty@tty5.service && \
720                 $(LN_S) $(systemunitdir)/getty@.service getty@tty6.service )
721         ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
722                 rm -f getty.target remote-fs.target && \
723                 $(LN_S) $(systemunitdir)/getty.target getty.target && \
724                 $(LN_S) $(systemunitdir)/remote-fs.target remote-fs.target )
725         ( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
726                 rm -f dev-hugepages.automount \
727                         dev-mqueue.automount \
728                         proc-sys-fs-binfmt_misc.automount \
729                         sys-kernel-debug.automount \
730                         sys-kernel-security.automount && \
731                 $(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
732                 $(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
733                 $(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
734                 $(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount && \
735                 $(LN_S) ../sys-kernel-security.automount sys-kernel-security.automount )
736         ( cd $(DESTDIR)$(dbussessionservicedir) && \
737                 rm -f org.freedesktop.systemd1.service && \
738                 $(LN_S) ../system-services/org.freedesktop.systemd1.service org.freedesktop.systemd1.service )
739 if TARGET_FEDORA
740         $(MKDIR_P) -m 0755 \
741                 $(DESTDIR)$(SYSTEM_SYSVINIT_PATH)
742         ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
743                 rm -f display-manager.service && \
744                 $(LN_S) $(systemunitdir)/prefdm.service display-manager.service )
745         ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
746                 rm -f prefdm.service && \
747                 $(LN_S) ../prefdm.service prefdm.service )
748         ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
749                 rm -f rc-local.service && \
750                 $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
751         ( cd $(DESTDIR)$(systemunitdir) && \
752                 rm -f local.service && \
753                 $(LN_S) rc-local.service local.service )
754         ( cd $(DESTDIR)$(SYSTEM_SYSVINIT_PATH) && \
755                 $(LN_S) halt reboot > /dev/null 2>&1 || true )
756 endif
757 if TARGET_GENTOO
758         ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
759                 rm -f display-manager.service && \
760                 $(LN_S) $(systemunitdir)/xdm.service display-manager.service )
761         ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
762                 rm -f prefdm.service && \
763                 $(LN_S) ../prefdm.service prefdm.service )
764 endif
765
766 DISTCHECK_CONFIGURE_FLAGS = \
767         --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
768         --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
769         --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
770         --with-dbusinterfacedir=$$dc_install_base/$(dbusinterfacedir) \
771         --with-udevrulesdir=$$dc_install_base/$(udevrulesdir) \
772         --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
773         --with-rootdir=$$dc_install_base/$(rootdir)