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 \
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
182 dist_systemunit_DATA += \
183 units/suse/halt.service \
184 units/suse/poweroff.service \
185 units/suse/reboot.service
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
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
213 pkgconfigdata_DATA = \
216 noinst_LTLIBRARIES = \
217 libsystemd-basic.la \
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.
224 libsystemd_basic_la_SOURCES = \
234 libsystemd_core_la_SOURCES = \
239 src/load-fragment.c \
261 src/dbus-automount.c \
263 src/dbus-snapshot.c \
269 src/hostname-setup.c \
270 src/loopback-setup.c \
280 libsystemd_core_la_CFLAGS = \
286 libsystemd_core_la_LIBADD = \
287 libsystemd-basic.la \
295 ${libsystemd_basic_la_SOURCES:.c=.h} \
296 ${libsystemd_core_la_SOURCES:.c=.h} \
302 src/linux/auto_dev-ioctl.h \
309 man/systemd.service.5 \
314 man/sd_listen_fds.3 \
318 man/systemd-install.1
321 man/systemd.special.7
324 man/systemd.unit.html \
325 man/systemd.service.html \
330 man/sd_listen_fds.html \
331 man/sd_is_fifo.html \
334 man/systemd-install.html
336 nodist_noinst_DATA = \
337 man/systemd.special.html
340 man/systemd.unit.xml \
341 man/systemd.service.xml \
342 man/systemd.special.xml.in \
343 man/systemd.special.7.in \
344 man/systemd.special.html.in \
349 man/sd_listen_fds.xml \
353 man/systemd-install.xml
367 test_engine_SOURCES = \
370 test_engine_CFLAGS = $(systemd_CFLAGS)
371 test_engine_LDADD = $(systemd_LDADD)
373 test_job_type_SOURCES = \
376 test_job_type_CFLAGS = $(systemd_CFLAGS)
377 test_job_type_LDADD = $(systemd_LDADD)
382 test_ns_CFLAGS = $(systemd_CFLAGS)
383 test_ns_LDADD = $(systemd_LDADD)
385 test_loopback_SOURCES = \
386 src/test-loopback.c \
389 test_loopback_LDADD = \
392 test_daemon_SOURCES = \
396 test_daemon_LDADD = \
399 test_cgroup_SOURCES = \
403 test_cgroup_CFLAGS = \
407 test_cgroup_LDADD = \
408 libsystemd-basic.la \
411 systemd_logger_SOURCES = \
416 systemd_logger_LDADD = \
417 libsystemd-basic.la \
420 systemd_initctl_SOURCES = \
424 systemd_initctl_CFLAGS = \
428 systemd_initctl_LDADD = \
429 libsystemd-basic.la \
432 systemd_cgroups_agent_SOURCES = \
435 systemd_cgroups_agent_CFLAGS = \
439 systemd_cgroups_agent_LDADD = \
440 libsystemd-basic.la \
443 systemctl_SOURCES = \
452 libsystemd-basic.la \
455 systemd_notify_SOURCES = \
459 systemd_notify_LDADD = \
462 systemd_install_SOURCES = \
466 systemd_install_LDADD = \
469 # We don't really link here against D-Bus, however we indirectly include D-Bus header files
470 systemd_install_CFLAGS = \
474 systemadm_SOURCES = \
476 src/systemd-interfaces.vala
482 -Wno-unused-variable \
483 -Wno-unused-function \
485 -Wno-format-nonliteral
487 systemadm_VALAFLAGS = \
497 pam_systemd_la_SOURCES = \
502 pam_systemd_la_CFLAGS = \
507 pam_systemd_la_LDFLAGS = \
512 -export-symbols-regex '^pam_sm_.*'
514 pam_systemd_la_LIBADD = \
515 libsystemd-basic.la \
520 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
521 $(SED) -e 's,@rootlibexecdir\@,$(rootlibexecdir),g' \
522 -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
523 -e 's,@SPECIAL_DBUS_SERVICE\@,$(SPECIAL_DBUS_SERVICE),g' \
524 -e 's,@SYSTEMCTL\@,$(rootbindir)/systemctl,g' \
525 -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
526 -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
527 -e 's,@systemunitdir\@,$(systemunitdir),g' \
528 -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
529 -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
530 -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' \
531 -e 's,@prefix\@,$(prefix),g' \
534 units/%: units/%.in Makefile
537 man/%: man/%.in Makefile
540 %.pc: %.pc.in Makefile
543 M4_PROCESS_SYSTEM = \
544 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
545 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@
547 M4_PROCESS_SESSION = \
548 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
549 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@
551 units/%: units/%.m4 Makefile
554 units/session/%: units/%.m4 Makefile
555 $(M4_PROCESS_SESSION)
558 units/systemd-initctl.service \
559 units/systemd-logger.service \
560 units/syslog.target \
561 units/sysinit.target \
562 units/getty@.service \
563 units/graphical.target \
564 units/multi-user.target \
565 units/remote-fs.target \
566 units/session/remote-fs.target \
567 units/session/exit.service \
568 man/systemd.special.7 \
569 man/systemd.special.html \
574 src/systemd-interfaces.c \
579 XSLTPROC_PROCESS_MAN = \
580 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
581 $(XSLTPROC) -o $@ --nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
583 XSLTPROC_PROCESS_MAN_IN = \
584 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
585 $(XSLTPROC) -o ${@:.in=} --nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
588 XSLTPROC_PROCESS_HTML = \
589 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
590 $(XSLTPROC) -o $@ --nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
592 XSLTPROC_PROCESS_HTML_IN = \
593 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
594 $(XSLTPROC) -o ${@:.in=} --nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $< && \
598 $(XSLTPROC_PROCESS_MAN)
600 man/%.3.in: man/%.xml.in
601 $(XSLTPROC_PROCESS_MAN)
604 $(XSLTPROC_PROCESS_MAN)
606 man/%.1.in: man/%.xml.in
607 $(XSLTPROC_PROCESS_MAN)
610 $(XSLTPROC_PROCESS_MAN)
612 man/%.5.in: man/%.xml.in
613 $(XSLTPROC_PROCESS_MAN)
616 $(XSLTPROC_PROCESS_MAN)
618 man/%.7.in: man/%.xml.in
619 $(XSLTPROC_PROCESS_MAN_IN)
622 $(XSLTPROC_PROCESS_MAN)
624 man/%.8.in: man/%.xml.in
625 $(XSLTPROC_PROCESS_MAN_IN)
627 man/%.html: man/%.xml
628 $(XSLTPROC_PROCESS_HTML)
630 man/%.html.in: man/%.xml.in
631 $(XSLTPROC_PROCESS_HTML_IN)
635 man/systemd.special.7.in \
636 man/systemd.unit.html \
637 man/systemd.service.html \
638 man/systemd.special.html.in
641 org.freedesktop.systemd1.%.xml: systemd
642 $(AM_V_GEN)./systemd --introspect=${@:.xml=} > $@
644 CLEANFILES += $(dbusinterface_DATA)
648 $(DESTDIR)$(systemunitdir) \
649 $(DESTDIR)$(sessionunitdir) \
650 $(DESTDIR)$(systemunitdir)/sockets.target.wants \
651 $(DESTDIR)$(systemunitdir)/sysinit.target.wants \
652 $(DESTDIR)$(pkgsysconfdir)/system \
653 $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
654 $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
655 $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
656 $(DESTDIR)$(pkgsysconfdir)/session \
657 $(DESTDIR)$(sysconfdir)/xdg/systemd
658 $(MKDIR_P) -m 0755 $(DESTDIR)/cgroup || \
659 echo "Don't forget to create /cgroup! Couldn't create it for you, continuing anyway."
660 ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
662 $(LN_S) $(pkgsysconfdir)/session session )
663 ( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
664 rm -f systemd-initctl.socket systemd-logger.socket && \
665 $(LN_S) ../systemd-logger.socket systemd-logger.socket && \
666 $(LN_S) ../systemd-initctl.socket systemd-initctl.socket )
667 ( cd $(DESTDIR)$(sessionunitdir) && \
668 rm -f shutdown.target sockets.target local-fs.target swap.target && \
669 $(LN_S) $(systemunitdir)/shutdown.target shutdown.target && \
670 $(LN_S) $(systemunitdir)/sockets.target sockets.target && \
671 $(LN_S) $(systemunitdir)/local-fs.target local-fs.target && \
672 $(LN_S) $(systemunitdir)/swap.target swap.target )
673 ( cd $(DESTDIR)$(systemunitdir) && \
674 rm -f runlevel0.target runlevel1.target runlevel6.target && \
675 $(LN_S) poweroff.target runlevel0.target && \
676 $(LN_S) rescue.target runlevel1.target && \
677 $(LN_S) reboot.target runlevel6.target )
678 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
679 rm -f default.target ctrl-alt-del.target kbrequest.target && \
680 $(LN_S) $(systemunitdir)/graphical.target default.target && \
681 $(LN_S) $(systemunitdir)/reboot.target ctrl-alt-del.target && \
682 $(LN_S) $(systemunitdir)/rescue.target kbrequest.target && \
683 rm -f runlevel2.target runlevel3.target runlevel4.target runlevel5.target && \
684 $(LN_S) $(systemunitdir)/multi-user.target runlevel2.target && \
685 $(LN_S) $(systemunitdir)/multi-user.target runlevel3.target && \
686 $(LN_S) $(systemunitdir)/multi-user.target runlevel4.target && \
687 $(LN_S) $(systemunitdir)/graphical.target runlevel5.target )
688 ( cd $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants && \
689 rm -f getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service && \
690 $(LN_S) $(systemunitdir)/getty@.service getty@tty1.service && \
691 $(LN_S) $(systemunitdir)/getty@.service getty@tty2.service && \
692 $(LN_S) $(systemunitdir)/getty@.service getty@tty3.service && \
693 $(LN_S) $(systemunitdir)/getty@.service getty@tty4.service && \
694 $(LN_S) $(systemunitdir)/getty@.service getty@tty5.service && \
695 $(LN_S) $(systemunitdir)/getty@.service getty@tty6.service )
696 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
697 rm -f getty.target remote-fs.target && \
698 $(LN_S) $(systemunitdir)/getty.target getty.target && \
699 $(LN_S) $(systemunitdir)/remote-fs.target remote-fs.target )
700 ( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
701 rm -f dev-hugepages.automount \
702 dev-mqueue.automount \
703 proc-sys-fs-binfmt_misc.automount \
704 sys-kernel-debug.automount \
705 sys-kernel-security.automount && \
706 $(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
707 $(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
708 $(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
709 $(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount && \
710 $(LN_S) ../sys-kernel-security.automount sys-kernel-security.automount )
711 ( cd $(DESTDIR)$(dbussessionservicedir) && \
712 rm -f org.freedesktop.systemd1.service && \
713 $(LN_S) ../system-services/org.freedesktop.systemd1.service org.freedesktop.systemd1.service )
716 $(DESTDIR)$(SYSTEM_SYSVINIT_PATH)
717 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
718 rm -f display-manager.service && \
719 $(LN_S) $(systemunitdir)/prefdm.service display-manager.service )
720 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
721 rm -f display-manager.service && \
722 $(LN_S) ../display-manager.service display-manager.service )
723 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
724 rm -f rc-local.service && \
725 $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
726 ( cd $(DESTDIR)$(systemunitdir) && \
727 rm -f local.service && \
728 $(LN_S) rc-local.service local.service )
729 ( cd $(DESTDIR)$(SYSTEM_SYSVINIT_PATH) && \
730 $(LN_S) halt reboot > /dev/null 2>&1 || true )
733 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
734 rm -f display-manager.service && \
735 $(LN_S) $(systemunitdir)/xdm.service display-manager.service )
736 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
737 rm -f display-manager.service && \
738 $(LN_S) ../display-manager.service display-manager.service )
741 DISTCHECK_CONFIGURE_FLAGS = \
742 --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
743 --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
744 --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
745 --with-dbusinterfacedir=$$dc_install_base/$(dbusinterfacedir) \
746 --with-udevrulesdir=$$dc_install_base/$(udevrulesdir) \
747 --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
748 --with-rootdir=$$dc_install_base/$(rootdir)