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 # Our own, non-special dirs
28 pkgsysconfdir=$(sysconfdir)/systemd
29 sessionunitdir=$(pkgdatadir)/session
31 # And these are the special ones for /
33 rootbindir=$(rootdir)/bin
34 rootlibexecdir=$(rootdir)/lib/systemd
35 systemunitdir=$(rootdir)/lib/systemd/system
38 -include $(top_builddir)/config.h \
39 -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
40 -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
41 -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
42 -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
43 -DSESSION_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/session\" \
44 -DSESSION_DATA_UNIT_PATH=\"$(sessionunitdir)\" \
45 -DCGROUP_AGENT_PATH=\"$(rootlibexecdir)/systemd-cgroups-agent\" \
46 -DSYSTEMD_BINARY_PATH=\"$(rootbindir)/systemd\" \
47 -DSYSTEMCTL_BINARY_PATH=\"$(rootbindir)/systemctl\" \
63 rootlibexec_PROGRAMS = \
65 systemd-cgroups-agent \
75 dist_dbuspolicy_DATA = \
76 src/org.freedesktop.systemd1.conf
78 dist_dbussystemservice_DATA = \
79 src/org.freedesktop.systemd1.service
81 dist_udevrules_DATA = \
84 dbusinterface_DATA = \
85 org.freedesktop.systemd1.Manager.xml \
86 org.freedesktop.systemd1.Job.xml \
87 org.freedesktop.systemd1.Unit.xml \
88 org.freedesktop.systemd1.Service.xml \
89 org.freedesktop.systemd1.Socket.xml \
90 org.freedesktop.systemd1.Timer.xml \
91 org.freedesktop.systemd1.Target.xml \
92 org.freedesktop.systemd1.Device.xml \
93 org.freedesktop.systemd1.Mount.xml \
94 org.freedesktop.systemd1.Automount.xml \
95 org.freedesktop.systemd1.Snapshot.xml \
96 org.freedesktop.systemd1.Swap.xml \
97 org.freedesktop.systemd1.Path.xml
99 dist_systemunit_DATA = \
100 units/emergency.service \
104 units/local-fs.target \
105 units/network.target \
106 units/nss-lookup.target \
107 units/mail-transfer-agent.target \
108 units/poweroff.target \
109 units/reboot.target \
110 units/remote-fs.target \
111 units/rescue.target \
112 units/rpcbind.target \
113 units/rtc-set.target \
114 units/shutdown.target \
115 units/sigpwr.target \
116 units/sockets.target \
118 units/systemd-initctl.socket \
119 units/systemd-logger.socket \
120 units/dev-hugepages.automount \
121 units/dev-hugepages.mount \
122 units/dev-mqueue.automount \
123 units/dev-mqueue.mount \
124 units/proc-sys-fs-binfmt_misc.automount \
125 units/proc-sys-fs-binfmt_misc.mount \
126 units/sys-kernel-debug.automount \
127 units/sys-kernel-debug.mount \
128 units/sys-kernel-security.automount \
129 units/sys-kernel-security.mount \
130 units/var-lock.mount \
134 units/sysinit.target \
135 units/getty@.service \
136 units/graphical.target \
137 units/multi-user.target \
138 units/systemd-initctl.service \
139 units/systemd-logger.service \
142 dist_sessionunit_DATA = \
143 units/session/default.target
146 units/session/remote-fs.target \
147 units/session/exit.service
150 units/sysinit.target.m4 \
151 units/getty@.service.m4 \
152 units/graphical.target.m4 \
153 units/multi-user.target.m4 \
154 units/remote-fs.target.m4 \
155 units/systemd-initctl.service.in \
156 units/systemd-logger.service.in \
157 units/syslog.target.in \
158 units/session/exit.service.in \
164 dist_systemunit_DATA += \
165 units/fedora/halt.service \
166 units/fedora/killall.service \
167 units/fedora/poweroff.service \
168 units/fedora/prefdm.service \
169 units/fedora/rc-local.service \
170 units/fedora/reboot.service \
171 units/fedora/sysinit.service
175 dist_systemunit_DATA += \
176 units/suse/halt.service \
177 units/suse/poweroff.service \
178 units/suse/reboot.service
182 dist_systemunit_DATA += \
183 units/gentoo/halt.service \
184 units/gentoo/killall.service \
185 units/gentoo/poweroff.service \
186 units/gentoo/reboot.service \
187 units/gentoo/xdm.service
191 dist_systemunit_DATA += \
192 units/arch/sysinit.service \
193 units/arch/rc-local.service \
194 units/arch/halt.service \
195 units/arch/poweroff.service \
196 units/arch/reboot.service
204 noinst_LTLIBRARIES = \
205 libsystemd-basic.la \
208 # This is needed because automake is buggy in how it generates the
209 # rules for C programs, but not Vala programs. We therefore can't
210 # list the .h files as dependencies if we want make dist to work.
212 libsystemd_basic_la_SOURCES = \
222 libsystemd_core_la_SOURCES = \
227 src/load-fragment.c \
249 src/dbus-automount.c \
251 src/dbus-snapshot.c \
257 src/hostname-setup.c \
258 src/loopback-setup.c \
267 libsystemd_core_la_CFLAGS = \
273 libsystemd_core_la_LIBADD = \
274 libsystemd-basic.la \
282 ${libsystemd_basic_la_SOURCES:.c=.h} \
283 ${libsystemd_core_la_SOURCES:.c=.h} \
289 src/linux/auto_dev-ioctl.h \
296 man/systemd.service.5
299 man/systemd.special.7
302 man/systemd.unit.html \
303 man/systemd.service.html
305 nodist_noinst_DATA = \
306 man/systemd.special.html
309 man/systemd.unit.xml \
310 man/systemd.service.xml \
311 man/systemd.special.xml.in \
312 man/systemd.special.7.in \
313 man/systemd.special.html.in
327 test_engine_SOURCES = \
330 test_engine_CFLAGS = $(systemd_CFLAGS)
331 test_engine_LDADD = $(systemd_LDADD)
333 test_job_type_SOURCES = \
336 test_job_type_CFLAGS = $(systemd_CFLAGS)
337 test_job_type_LDADD = $(systemd_LDADD)
342 test_ns_CFLAGS = $(systemd_CFLAGS)
343 test_ns_LDADD = $(systemd_LDADD)
345 test_loopback_SOURCES = \
346 src/test-loopback.c \
349 test_loopback_LDADD = \
352 test_daemon_SOURCES = \
356 test_daemon_LDADD = \
359 systemd_logger_SOURCES = \
364 systemd_logger_LDADD = \
365 libsystemd-basic.la \
368 systemd_initctl_SOURCES = \
372 systemd_initctl_CFLAGS = \
376 systemd_initctl_LDADD = \
377 libsystemd-basic.la \
380 systemd_cgroups_agent_SOURCES = \
383 systemd_cgroups_agent_CFLAGS = \
387 systemd_cgroups_agent_LDADD = \
388 libsystemd-basic.la \
391 systemctl_SOURCES = \
400 libsystemd-basic.la \
403 systemd_notify_SOURCES = \
407 systemd_notify_LDADD = \
410 systemd_install_SOURCES = \
414 systemd_install_LDADD = \
417 # We don't really link here against D-Bus, however we indirectly include D-Bus header files
418 systemd_install_CFLAGS = \
422 systemadm_SOURCES = \
424 src/systemd-interfaces.vala
430 -Wno-unused-variable \
431 -Wno-unused-function \
433 -Wno-format-nonliteral
435 systemadm_VALAFLAGS = \
446 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
447 $(SED) -e 's,@rootlibexecdir\@,$(rootlibexecdir),g' \
448 -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
449 -e 's,@SPECIAL_DBUS_SERVICE\@,$(SPECIAL_DBUS_SERVICE),g' \
450 -e 's,@SYSTEMCTL\@,$(rootbindir)/systemctl,g' \
453 units/%: units/%.in Makefile
456 man/%: man/%.in Makefile
459 M4_PROCESS_SYSTEM = \
460 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
461 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@
463 M4_PROCESS_SESSION = \
464 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
465 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@
467 units/%: units/%.m4 Makefile
470 units/session/%: units/%.m4 Makefile
471 $(M4_PROCESS_SESSION)
474 units/systemd-initctl.service \
475 units/systemd-logger.service \
476 units/syslog.target \
477 units/sysinit.target \
478 units/getty@.service \
479 units/graphical.target \
480 units/multi-user.target \
481 units/remote-fs.target \
482 units/session/remote-fs.target \
483 units/session/exit.service \
484 man/systemd.special.7 \
485 man/systemd.special.html
489 src/systemd-interfaces.c \
494 XSLTPROC_PROCESS_MAN = \
495 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
496 $(XSLTPROC) -o $@ --nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
498 XSLTPROC_PROCESS_MAN_IN = \
499 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
500 $(XSLTPROC) -o ${@:.in=} --nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
503 XSLTPROC_PROCESS_HTML = \
504 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
505 $(XSLTPROC) -o $@ --nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
507 XSLTPROC_PROCESS_HTML_IN = \
508 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
509 $(XSLTPROC) -o ${@:.in=} --nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $< && \
513 $(XSLTPROC_PROCESS_MAN)
515 man/%.5.in: man/%.xml.in
516 $(XSLTPROC_PROCESS_MAN)
519 $(XSLTPROC_PROCESS_MAN)
521 man/%.7.in: man/%.xml.in
522 $(XSLTPROC_PROCESS_MAN_IN)
524 man/%.html: man/%.xml
525 $(XSLTPROC_PROCESS_HTML)
527 man/%.html.in: man/%.xml.in
528 $(XSLTPROC_PROCESS_HTML_IN)
532 man/systemd.special.7.in \
533 man/systemd.unit.html \
534 man/systemd.service.html \
535 man/systemd.special.html.in
538 org.freedesktop.systemd1.%.xml: systemd
539 $(AM_V_GEN)./systemd --introspect=${@:.xml=} > $@
541 CLEANFILES += $(dbusinterface_DATA)
545 $(DESTDIR)$(systemunitdir) \
546 $(DESTDIR)$(sessionunitdir) \
547 $(DESTDIR)$(systemunitdir)/sockets.target.wants \
548 $(DESTDIR)$(systemunitdir)/sysinit.target.wants \
549 $(DESTDIR)$(pkgsysconfdir)/system \
550 $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
551 $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
552 $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
553 $(DESTDIR)$(pkgsysconfdir)/session \
554 $(DESTDIR)$(sysconfdir)/xdg/systemd
555 $(MKDIR_P) -m 0755 $(DESTDIR)/cgroup/systemd || \
556 echo "Don't forget to create /cgroup/systemd! Couldn't create it for you, continuing anyway."
557 ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
559 $(LN_S) $(pkgsysconfdir)/session session )
560 ( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
561 rm -f systemd-initctl.socket systemd-logger.socket && \
562 $(LN_S) ../systemd-logger.socket systemd-logger.socket && \
563 $(LN_S) ../systemd-initctl.socket systemd-initctl.socket )
564 ( cd $(DESTDIR)$(sessionunitdir) && \
565 rm -f shutdown.target sockets.target local-fs.target swap.target && \
566 $(LN_S) $(systemunitdir)/shutdown.target shutdown.target && \
567 $(LN_S) $(systemunitdir)/sockets.target sockets.target && \
568 $(LN_S) $(systemunitdir)/local-fs.target local-fs.target && \
569 $(LN_S) $(systemunitdir)/swap.target swap.target )
570 ( cd $(DESTDIR)$(systemunitdir) && \
571 rm -f runlevel0.target runlevel1.target runlevel6.target && \
572 $(LN_S) poweroff.target runlevel0.target && \
573 $(LN_S) rescue.target runlevel1.target && \
574 $(LN_S) reboot.target runlevel6.target )
575 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
576 rm -f default.target ctrl-alt-del.target kbrequest.target && \
577 $(LN_S) $(systemunitdir)/graphical.target default.target && \
578 $(LN_S) $(systemunitdir)/reboot.target ctrl-alt-del.target && \
579 $(LN_S) $(systemunitdir)/rescue.target kbrequest.target && \
580 rm -f runlevel2.target runlevel3.target runlevel4.target runlevel5.target && \
581 $(LN_S) $(systemunitdir)/multi-user.target runlevel2.target && \
582 $(LN_S) $(systemunitdir)/multi-user.target runlevel3.target && \
583 $(LN_S) $(systemunitdir)/multi-user.target runlevel4.target && \
584 $(LN_S) $(systemunitdir)/graphical.target runlevel5.target )
585 ( cd $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants && \
586 rm -f getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service && \
587 $(LN_S) $(systemunitdir)/getty@.service getty@tty1.service && \
588 $(LN_S) $(systemunitdir)/getty@.service getty@tty2.service && \
589 $(LN_S) $(systemunitdir)/getty@.service getty@tty3.service && \
590 $(LN_S) $(systemunitdir)/getty@.service getty@tty4.service && \
591 $(LN_S) $(systemunitdir)/getty@.service getty@tty5.service && \
592 $(LN_S) $(systemunitdir)/getty@.service getty@tty6.service )
593 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
594 rm -f getty.target remote-fs.target && \
595 $(LN_S) $(systemunitdir)/getty.target getty.target && \
596 $(LN_S) $(systemunitdir)/remote-fs.target remote-fs.target )
597 ( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
598 rm -f dev-hugepages.automount \
599 dev-mqueue.automount \
600 proc-sys-fs-binfmt_misc.automount \
601 sys-kernel-debug.automount \
602 sys-kernel-security.automount && \
603 $(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
604 $(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
605 $(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
606 $(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount && \
607 $(LN_S) ../sys-kernel-security.automount sys-kernel-security.automount )
608 ( cd $(DESTDIR)$(dbussessionservicedir) && \
609 rm -f org.freedesktop.systemd1.service && \
610 $(LN_S) ../system-services/org.freedesktop.systemd1.service org.freedesktop.systemd1.service )
612 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
613 rm -f display-manager.service && \
614 $(LN_S) $(systemunitdir)/prefdm.service display-manager.service )
615 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
616 rm -f display-manager.service && \
617 $(LN_S) ../display-manager.service display-manager.service )
618 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
619 rm -f rc-local.service && \
620 $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
621 ( cd $(DESTDIR)$(systemunitdir) && \
622 rm -f local.service && \
623 $(LN_S) rc-local.service local.service )
624 ( cd $(DESTDIR)/etc/init.d && \
625 $(LN_S) halt reboot > /dev/null 2>&1 || true )
628 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
629 rm -f display-manager.service && \
630 $(LN_S) $(systemunitdir)/xdm.service display-manager.service )
631 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
632 rm -f display-manager.service && \
633 $(LN_S) ../display-manager.service display-manager.service )
636 DISTCHECK_CONFIGURE_FLAGS = \
637 --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
638 --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
639 --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
640 --with-dbusinterfacedir=$$dc_install_base/$(dbusinterfacedir) \
641 --with-udevrulesdir=$$dc_install_base/$(udevrulesdir) \
642 --with-rootdir=$$dc_install_base/$(rootdir)