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 \
314 man/systemd.special.7
317 man/systemd.unit.html \
318 man/systemd.service.html \
321 nodist_noinst_DATA = \
322 man/systemd.special.html
325 man/systemd.unit.xml \
326 man/systemd.service.xml \
327 man/systemd.special.xml.in \
328 man/systemd.special.7.in \
329 man/systemd.special.html.in \
344 test_engine_SOURCES = \
347 test_engine_CFLAGS = $(systemd_CFLAGS)
348 test_engine_LDADD = $(systemd_LDADD)
350 test_job_type_SOURCES = \
353 test_job_type_CFLAGS = $(systemd_CFLAGS)
354 test_job_type_LDADD = $(systemd_LDADD)
359 test_ns_CFLAGS = $(systemd_CFLAGS)
360 test_ns_LDADD = $(systemd_LDADD)
362 test_loopback_SOURCES = \
363 src/test-loopback.c \
366 test_loopback_LDADD = \
369 test_daemon_SOURCES = \
373 test_daemon_LDADD = \
376 test_cgroup_SOURCES = \
380 test_cgroup_CFLAGS = \
384 test_cgroup_LDADD = \
385 libsystemd-basic.la \
388 systemd_logger_SOURCES = \
393 systemd_logger_LDADD = \
394 libsystemd-basic.la \
397 systemd_initctl_SOURCES = \
401 systemd_initctl_CFLAGS = \
405 systemd_initctl_LDADD = \
406 libsystemd-basic.la \
409 systemd_cgroups_agent_SOURCES = \
412 systemd_cgroups_agent_CFLAGS = \
416 systemd_cgroups_agent_LDADD = \
417 libsystemd-basic.la \
420 systemctl_SOURCES = \
429 libsystemd-basic.la \
432 systemd_notify_SOURCES = \
436 systemd_notify_LDADD = \
439 systemd_install_SOURCES = \
443 systemd_install_LDADD = \
446 # We don't really link here against D-Bus, however we indirectly include D-Bus header files
447 systemd_install_CFLAGS = \
451 systemadm_SOURCES = \
453 src/systemd-interfaces.vala
459 -Wno-unused-variable \
460 -Wno-unused-function \
462 -Wno-format-nonliteral
464 systemadm_VALAFLAGS = \
474 pam_systemd_la_SOURCES = \
479 pam_systemd_la_CFLAGS = \
484 pam_systemd_la_LDFLAGS = \
489 -export-symbols-regex '^pam_sm_.*'
491 pam_systemd_la_LIBADD = \
492 libsystemd-basic.la \
497 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
498 $(SED) -e 's,@rootlibexecdir\@,$(rootlibexecdir),g' \
499 -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
500 -e 's,@SPECIAL_DBUS_SERVICE\@,$(SPECIAL_DBUS_SERVICE),g' \
501 -e 's,@SYSTEMCTL\@,$(rootbindir)/systemctl,g' \
502 -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
503 -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
504 -e 's,@systemunitdir\@,$(systemunitdir),g' \
505 -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
506 -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
507 -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' \
508 -e 's,@prefix\@,$(prefix),g' \
511 units/%: units/%.in Makefile
514 man/%: man/%.in Makefile
517 %.pc: %.pc.in Makefile
520 M4_PROCESS_SYSTEM = \
521 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
522 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@
524 M4_PROCESS_SESSION = \
525 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
526 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@
528 units/%: units/%.m4 Makefile
531 units/session/%: units/%.m4 Makefile
532 $(M4_PROCESS_SESSION)
535 units/systemd-initctl.service \
536 units/systemd-logger.service \
537 units/syslog.target \
538 units/sysinit.target \
539 units/getty@.service \
540 units/graphical.target \
541 units/multi-user.target \
542 units/remote-fs.target \
543 units/session/remote-fs.target \
544 units/session/exit.service \
545 man/systemd.special.7 \
546 man/systemd.special.html \
551 src/systemd-interfaces.c \
556 XSLTPROC_PROCESS_MAN = \
557 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
558 $(XSLTPROC) -o $@ --nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
560 XSLTPROC_PROCESS_MAN_IN = \
561 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
562 $(XSLTPROC) -o ${@:.in=} --nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
565 XSLTPROC_PROCESS_HTML = \
566 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
567 $(XSLTPROC) -o $@ --nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
569 XSLTPROC_PROCESS_HTML_IN = \
570 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
571 $(XSLTPROC) -o ${@:.in=} --nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $< && \
575 $(XSLTPROC_PROCESS_MAN)
577 man/%.5.in: man/%.xml.in
578 $(XSLTPROC_PROCESS_MAN)
581 $(XSLTPROC_PROCESS_MAN)
583 man/%.7.in: man/%.xml.in
584 $(XSLTPROC_PROCESS_MAN_IN)
586 man/%.html: man/%.xml
587 $(XSLTPROC_PROCESS_HTML)
589 man/%.html.in: man/%.xml.in
590 $(XSLTPROC_PROCESS_HTML_IN)
594 man/systemd.special.7.in \
595 man/systemd.unit.html \
596 man/systemd.service.html \
597 man/systemd.special.html.in
600 org.freedesktop.systemd1.%.xml: systemd
601 $(AM_V_GEN)./systemd --introspect=${@:.xml=} > $@
603 CLEANFILES += $(dbusinterface_DATA)
607 $(DESTDIR)$(systemunitdir) \
608 $(DESTDIR)$(sessionunitdir) \
609 $(DESTDIR)$(systemunitdir)/sockets.target.wants \
610 $(DESTDIR)$(systemunitdir)/sysinit.target.wants \
611 $(DESTDIR)$(pkgsysconfdir)/system \
612 $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
613 $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
614 $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
615 $(DESTDIR)$(pkgsysconfdir)/session \
616 $(DESTDIR)$(sysconfdir)/xdg/systemd
617 $(MKDIR_P) -m 0755 $(DESTDIR)/cgroup/systemd || \
618 echo "Don't forget to create /cgroup/systemd! Couldn't create it for you, continuing anyway."
619 ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
621 $(LN_S) $(pkgsysconfdir)/session session )
622 ( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
623 rm -f systemd-initctl.socket systemd-logger.socket && \
624 $(LN_S) ../systemd-logger.socket systemd-logger.socket && \
625 $(LN_S) ../systemd-initctl.socket systemd-initctl.socket )
626 ( cd $(DESTDIR)$(sessionunitdir) && \
627 rm -f shutdown.target sockets.target local-fs.target swap.target && \
628 $(LN_S) $(systemunitdir)/shutdown.target shutdown.target && \
629 $(LN_S) $(systemunitdir)/sockets.target sockets.target && \
630 $(LN_S) $(systemunitdir)/local-fs.target local-fs.target && \
631 $(LN_S) $(systemunitdir)/swap.target swap.target )
632 ( cd $(DESTDIR)$(systemunitdir) && \
633 rm -f runlevel0.target runlevel1.target runlevel6.target && \
634 $(LN_S) poweroff.target runlevel0.target && \
635 $(LN_S) rescue.target runlevel1.target && \
636 $(LN_S) reboot.target runlevel6.target )
637 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
638 rm -f default.target ctrl-alt-del.target kbrequest.target && \
639 $(LN_S) $(systemunitdir)/graphical.target default.target && \
640 $(LN_S) $(systemunitdir)/reboot.target ctrl-alt-del.target && \
641 $(LN_S) $(systemunitdir)/rescue.target kbrequest.target && \
642 rm -f runlevel2.target runlevel3.target runlevel4.target runlevel5.target && \
643 $(LN_S) $(systemunitdir)/multi-user.target runlevel2.target && \
644 $(LN_S) $(systemunitdir)/multi-user.target runlevel3.target && \
645 $(LN_S) $(systemunitdir)/multi-user.target runlevel4.target && \
646 $(LN_S) $(systemunitdir)/graphical.target runlevel5.target )
647 ( cd $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants && \
648 rm -f getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service && \
649 $(LN_S) $(systemunitdir)/getty@.service getty@tty1.service && \
650 $(LN_S) $(systemunitdir)/getty@.service getty@tty2.service && \
651 $(LN_S) $(systemunitdir)/getty@.service getty@tty3.service && \
652 $(LN_S) $(systemunitdir)/getty@.service getty@tty4.service && \
653 $(LN_S) $(systemunitdir)/getty@.service getty@tty5.service && \
654 $(LN_S) $(systemunitdir)/getty@.service getty@tty6.service )
655 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
656 rm -f getty.target remote-fs.target && \
657 $(LN_S) $(systemunitdir)/getty.target getty.target && \
658 $(LN_S) $(systemunitdir)/remote-fs.target remote-fs.target )
659 ( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
660 rm -f dev-hugepages.automount \
661 dev-mqueue.automount \
662 proc-sys-fs-binfmt_misc.automount \
663 sys-kernel-debug.automount \
664 sys-kernel-security.automount && \
665 $(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
666 $(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
667 $(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
668 $(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount && \
669 $(LN_S) ../sys-kernel-security.automount sys-kernel-security.automount )
670 ( cd $(DESTDIR)$(dbussessionservicedir) && \
671 rm -f org.freedesktop.systemd1.service && \
672 $(LN_S) ../system-services/org.freedesktop.systemd1.service org.freedesktop.systemd1.service )
674 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
675 rm -f display-manager.service && \
676 $(LN_S) $(systemunitdir)/prefdm.service display-manager.service )
677 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
678 rm -f display-manager.service && \
679 $(LN_S) ../display-manager.service display-manager.service )
680 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
681 rm -f rc-local.service && \
682 $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
683 ( cd $(DESTDIR)$(systemunitdir) && \
684 rm -f local.service && \
685 $(LN_S) rc-local.service local.service )
686 ( cd $(DESTDIR)/etc/init.d && \
687 $(LN_S) halt reboot > /dev/null 2>&1 || true )
690 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
691 rm -f display-manager.service && \
692 $(LN_S) $(systemunitdir)/xdm.service display-manager.service )
693 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
694 rm -f display-manager.service && \
695 $(LN_S) ../display-manager.service display-manager.service )
698 DISTCHECK_CONFIGURE_FLAGS = \
699 --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
700 --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
701 --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
702 --with-dbusinterfacedir=$$dc_install_base/$(dbusinterfacedir) \
703 --with-udevrulesdir=$$dc_install_base/$(udevrulesdir) \
704 --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
705 --with-rootdir=$$dc_install_base/$(rootdir)