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