1 # This file is part of systemd.
3 # Copyright 2010 Lennart Poettering
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.
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.
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/>.
18 ACLOCAL_AMFLAGS = -I m4
20 # Dirs of external packages
21 dbuspolicydir=@dbuspolicydir@
22 dbussessionservicedir=@dbussessionservicedir@
23 dbussystemservicedir=@dbussystemservicedir@
24 dbusinterfacedir=@dbusinterfacedir@
25 udevrulesdir=@udevrulesdir@
27 pkgconfigdatadir=$(datadir)/pkgconfig
29 # Our own, non-special dirs
30 pkgsysconfdir=$(sysconfdir)/systemd
31 sessionunitdir=$(pkgdatadir)/session
33 # And these are the special ones for /
35 rootbindir=$(rootdir)/bin
36 rootlibexecdir=$(rootdir)/lib/systemd
37 systemunitdir=$(rootdir)/lib/systemd/system
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\" \
66 rootlibexec_PROGRAMS = \
68 systemd-cgroups-agent \
80 pamlib_LTLIBRARIES = \
84 dist_dbuspolicy_DATA = \
85 src/org.freedesktop.systemd1.conf
87 dist_dbussystemservice_DATA = \
88 src/org.freedesktop.systemd1.service
90 dist_udevrules_DATA = \
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
108 dist_systemunit_DATA = \
109 units/emergency.service \
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/remote-fs.target \
120 units/rescue.target \
121 units/rpcbind.target \
122 units/rtc-set.target \
123 units/shutdown.target \
124 units/sigpwr.target \
125 units/sockets.target \
127 units/systemd-initctl.socket \
128 units/systemd-logger.socket \
129 units/dev-hugepages.automount \
130 units/dev-hugepages.mount \
131 units/dev-mqueue.automount \
132 units/dev-mqueue.mount \
133 units/proc-sys-fs-binfmt_misc.automount \
134 units/proc-sys-fs-binfmt_misc.mount \
135 units/sys-kernel-debug.automount \
136 units/sys-kernel-debug.mount \
137 units/sys-kernel-security.automount \
138 units/sys-kernel-security.mount \
139 units/var-lock.mount \
143 units/sysinit.target \
144 units/getty@.service \
145 units/graphical.target \
146 units/multi-user.target \
147 units/systemd-initctl.service \
148 units/systemd-logger.service \
151 dist_sessionunit_DATA = \
152 units/session/default.target
155 units/session/remote-fs.target \
156 units/session/exit.service
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 \
174 dist_systemunit_DATA += \
175 units/fedora/halt.service \
176 units/fedora/killall.service \
177 units/fedora/poweroff.service \
178 units/fedora/prefdm.service \
179 units/fedora/rc-local.service \
180 units/fedora/reboot.service \
181 units/fedora/sysinit.service
185 dist_systemunit_DATA += \
186 units/suse/halt.service \
187 units/suse/poweroff.service \
188 units/suse/reboot.service
192 dist_systemunit_DATA += \
193 units/gentoo/halt.service \
194 units/gentoo/killall.service \
195 units/gentoo/poweroff.service \
196 units/gentoo/reboot.service \
197 units/gentoo/xdm.service
201 dist_systemunit_DATA += \
202 units/arch/sysinit.service \
203 units/arch/rc-local.service \
204 units/arch/halt.service \
205 units/arch/poweroff.service \
206 units/arch/reboot.service
214 pkgconfigdata_DATA = \
217 noinst_LTLIBRARIES = \
218 libsystemd-basic.la \
221 # This is needed because automake is buggy in how it generates the
222 # rules for C programs, but not Vala programs. We therefore can't
223 # list the .h files as dependencies if we want make dist to work.
225 libsystemd_basic_la_SOURCES = \
235 libsystemd_core_la_SOURCES = \
240 src/load-fragment.c \
262 src/dbus-automount.c \
264 src/dbus-snapshot.c \
270 src/hostname-setup.c \
271 src/loopback-setup.c \
281 libsystemd_core_la_CFLAGS = \
287 libsystemd_core_la_LIBADD = \
288 libsystemd-basic.la \
296 ${libsystemd_basic_la_SOURCES:.c=.h} \
297 ${libsystemd_core_la_SOURCES:.c=.h} \
303 src/linux/auto_dev-ioctl.h \
310 man/systemd.service.5
313 man/systemd.special.7
316 man/systemd.unit.html \
317 man/systemd.service.html
319 nodist_noinst_DATA = \
320 man/systemd.special.html
323 man/systemd.unit.xml \
324 man/systemd.service.xml \
325 man/systemd.special.xml.in \
326 man/systemd.special.7.in \
327 man/systemd.special.html.in
341 test_engine_SOURCES = \
344 test_engine_CFLAGS = $(systemd_CFLAGS)
345 test_engine_LDADD = $(systemd_LDADD)
347 test_job_type_SOURCES = \
350 test_job_type_CFLAGS = $(systemd_CFLAGS)
351 test_job_type_LDADD = $(systemd_LDADD)
356 test_ns_CFLAGS = $(systemd_CFLAGS)
357 test_ns_LDADD = $(systemd_LDADD)
359 test_loopback_SOURCES = \
360 src/test-loopback.c \
363 test_loopback_LDADD = \
366 test_daemon_SOURCES = \
370 test_daemon_LDADD = \
373 test_cgroup_SOURCES = \
377 test_cgroup_CFLAGS = \
381 test_cgroup_LDADD = \
382 libsystemd-basic.la \
385 systemd_logger_SOURCES = \
390 systemd_logger_LDADD = \
391 libsystemd-basic.la \
394 systemd_initctl_SOURCES = \
398 systemd_initctl_CFLAGS = \
402 systemd_initctl_LDADD = \
403 libsystemd-basic.la \
406 systemd_cgroups_agent_SOURCES = \
409 systemd_cgroups_agent_CFLAGS = \
413 systemd_cgroups_agent_LDADD = \
414 libsystemd-basic.la \
417 systemctl_SOURCES = \
426 libsystemd-basic.la \
429 systemd_notify_SOURCES = \
433 systemd_notify_LDADD = \
436 systemd_install_SOURCES = \
440 systemd_install_LDADD = \
443 # We don't really link here against D-Bus, however we indirectly include D-Bus header files
444 systemd_install_CFLAGS = \
448 systemadm_SOURCES = \
450 src/systemd-interfaces.vala
456 -Wno-unused-variable \
457 -Wno-unused-function \
459 -Wno-format-nonliteral
461 systemadm_VALAFLAGS = \
471 pam_systemd_la_SOURCES = \
476 pam_systemd_la_CFLAGS = \
481 pam_systemd_la_LDFLAGS = \
486 -export-symbols-regex '^pam_sm_.*'
488 pam_systemd_la_LIBADD = \
489 libsystemd-basic.la \
494 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
495 $(SED) -e 's,@rootlibexecdir\@,$(rootlibexecdir),g' \
496 -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
497 -e 's,@SPECIAL_DBUS_SERVICE\@,$(SPECIAL_DBUS_SERVICE),g' \
498 -e 's,@SYSTEMCTL\@,$(rootbindir)/systemctl,g' \
499 -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
500 -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
501 -e 's,@systemunitdir\@,$(systemunitdir),g' \
502 -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
503 -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
504 -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' \
505 -e 's,@prefix\@,$(prefix),g' \
508 units/%: units/%.in Makefile
511 man/%: man/%.in Makefile
514 %.pc: %.pc.in Makefile
517 M4_PROCESS_SYSTEM = \
518 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
519 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@
521 M4_PROCESS_SESSION = \
522 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
523 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@
525 units/%: units/%.m4 Makefile
528 units/session/%: units/%.m4 Makefile
529 $(M4_PROCESS_SESSION)
532 units/systemd-initctl.service \
533 units/systemd-logger.service \
534 units/syslog.target \
535 units/sysinit.target \
536 units/getty@.service \
537 units/graphical.target \
538 units/multi-user.target \
539 units/remote-fs.target \
540 units/session/remote-fs.target \
541 units/session/exit.service \
542 man/systemd.special.7 \
543 man/systemd.special.html \
548 src/systemd-interfaces.c \
553 XSLTPROC_PROCESS_MAN = \
554 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
555 $(XSLTPROC) -o $@ --nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
557 XSLTPROC_PROCESS_MAN_IN = \
558 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
559 $(XSLTPROC) -o ${@:.in=} --nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
562 XSLTPROC_PROCESS_HTML = \
563 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
564 $(XSLTPROC) -o $@ --nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
566 XSLTPROC_PROCESS_HTML_IN = \
567 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
568 $(XSLTPROC) -o ${@:.in=} --nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $< && \
572 $(XSLTPROC_PROCESS_MAN)
574 man/%.5.in: man/%.xml.in
575 $(XSLTPROC_PROCESS_MAN)
578 $(XSLTPROC_PROCESS_MAN)
580 man/%.7.in: man/%.xml.in
581 $(XSLTPROC_PROCESS_MAN_IN)
583 man/%.html: man/%.xml
584 $(XSLTPROC_PROCESS_HTML)
586 man/%.html.in: man/%.xml.in
587 $(XSLTPROC_PROCESS_HTML_IN)
591 man/systemd.special.7.in \
592 man/systemd.unit.html \
593 man/systemd.service.html \
594 man/systemd.special.html.in
597 org.freedesktop.systemd1.%.xml: systemd
598 $(AM_V_GEN)./systemd --introspect=${@:.xml=} > $@
600 CLEANFILES += $(dbusinterface_DATA)
604 $(DESTDIR)$(systemunitdir) \
605 $(DESTDIR)$(sessionunitdir) \
606 $(DESTDIR)$(systemunitdir)/sockets.target.wants \
607 $(DESTDIR)$(systemunitdir)/sysinit.target.wants \
608 $(DESTDIR)$(pkgsysconfdir)/system \
609 $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
610 $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
611 $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
612 $(DESTDIR)$(pkgsysconfdir)/session \
613 $(DESTDIR)$(sysconfdir)/xdg/systemd
614 $(MKDIR_P) -m 0755 $(DESTDIR)/cgroup/systemd || \
615 echo "Don't forget to create /cgroup/systemd! Couldn't create it for you, continuing anyway."
616 ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
618 $(LN_S) $(pkgsysconfdir)/session session )
619 ( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
620 rm -f systemd-initctl.socket systemd-logger.socket && \
621 $(LN_S) ../systemd-logger.socket systemd-logger.socket && \
622 $(LN_S) ../systemd-initctl.socket systemd-initctl.socket )
623 ( cd $(DESTDIR)$(sessionunitdir) && \
624 rm -f shutdown.target sockets.target local-fs.target swap.target && \
625 $(LN_S) $(systemunitdir)/shutdown.target shutdown.target && \
626 $(LN_S) $(systemunitdir)/sockets.target sockets.target && \
627 $(LN_S) $(systemunitdir)/local-fs.target local-fs.target && \
628 $(LN_S) $(systemunitdir)/swap.target swap.target )
629 ( cd $(DESTDIR)$(systemunitdir) && \
630 rm -f runlevel0.target runlevel1.target runlevel6.target && \
631 $(LN_S) poweroff.target runlevel0.target && \
632 $(LN_S) rescue.target runlevel1.target && \
633 $(LN_S) reboot.target runlevel6.target )
634 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
635 rm -f default.target ctrl-alt-del.target kbrequest.target && \
636 $(LN_S) $(systemunitdir)/graphical.target default.target && \
637 $(LN_S) $(systemunitdir)/reboot.target ctrl-alt-del.target && \
638 $(LN_S) $(systemunitdir)/rescue.target kbrequest.target && \
639 rm -f runlevel2.target runlevel3.target runlevel4.target runlevel5.target && \
640 $(LN_S) $(systemunitdir)/multi-user.target runlevel2.target && \
641 $(LN_S) $(systemunitdir)/multi-user.target runlevel3.target && \
642 $(LN_S) $(systemunitdir)/multi-user.target runlevel4.target && \
643 $(LN_S) $(systemunitdir)/graphical.target runlevel5.target )
644 ( cd $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants && \
645 rm -f getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service && \
646 $(LN_S) $(systemunitdir)/getty@.service getty@tty1.service && \
647 $(LN_S) $(systemunitdir)/getty@.service getty@tty2.service && \
648 $(LN_S) $(systemunitdir)/getty@.service getty@tty3.service && \
649 $(LN_S) $(systemunitdir)/getty@.service getty@tty4.service && \
650 $(LN_S) $(systemunitdir)/getty@.service getty@tty5.service && \
651 $(LN_S) $(systemunitdir)/getty@.service getty@tty6.service )
652 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
653 rm -f getty.target remote-fs.target && \
654 $(LN_S) $(systemunitdir)/getty.target getty.target && \
655 $(LN_S) $(systemunitdir)/remote-fs.target remote-fs.target )
656 ( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
657 rm -f dev-hugepages.automount \
658 dev-mqueue.automount \
659 proc-sys-fs-binfmt_misc.automount \
660 sys-kernel-debug.automount \
661 sys-kernel-security.automount && \
662 $(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
663 $(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
664 $(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
665 $(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount && \
666 $(LN_S) ../sys-kernel-security.automount sys-kernel-security.automount )
667 ( cd $(DESTDIR)$(dbussessionservicedir) && \
668 rm -f org.freedesktop.systemd1.service && \
669 $(LN_S) ../system-services/org.freedesktop.systemd1.service org.freedesktop.systemd1.service )
671 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
672 rm -f display-manager.service && \
673 $(LN_S) $(systemunitdir)/prefdm.service display-manager.service )
674 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
675 rm -f display-manager.service && \
676 $(LN_S) ../display-manager.service display-manager.service )
677 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
678 rm -f rc-local.service && \
679 $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
680 ( cd $(DESTDIR)$(systemunitdir) && \
681 rm -f local.service && \
682 $(LN_S) rc-local.service local.service )
683 ( cd $(DESTDIR)/etc/init.d && \
684 $(LN_S) halt reboot > /dev/null 2>&1 || true )
687 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
688 rm -f display-manager.service && \
689 $(LN_S) $(systemunitdir)/xdm.service display-manager.service )
690 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
691 rm -f display-manager.service && \
692 $(LN_S) ../display-manager.service display-manager.service )
695 DISTCHECK_CONFIGURE_FLAGS = \
696 --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
697 --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
698 --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
699 --with-dbusinterfacedir=$$dc_install_base/$(dbusinterfacedir) \
700 --with-udevrulesdir=$$dc_install_base/$(udevrulesdir) \
701 --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
702 --with-rootdir=$$dc_install_base/$(rootdir)