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\" \
61 rootlibexec_PROGRAMS = \
63 systemd-cgroups-agent \
73 dist_dbuspolicy_DATA = \
74 src/org.freedesktop.systemd1.conf
76 dist_dbussystemservice_DATA = \
77 src/org.freedesktop.systemd1.service
79 dist_udevrules_DATA = \
82 dbusinterface_DATA = \
83 org.freedesktop.systemd1.Manager.xml \
84 org.freedesktop.systemd1.Job.xml \
85 org.freedesktop.systemd1.Unit.xml \
86 org.freedesktop.systemd1.Service.xml \
87 org.freedesktop.systemd1.Socket.xml \
88 org.freedesktop.systemd1.Timer.xml \
89 org.freedesktop.systemd1.Target.xml \
90 org.freedesktop.systemd1.Device.xml \
91 org.freedesktop.systemd1.Mount.xml \
92 org.freedesktop.systemd1.Automount.xml \
93 org.freedesktop.systemd1.Snapshot.xml \
94 org.freedesktop.systemd1.Swap.xml \
95 org.freedesktop.systemd1.Path.xml
97 dist_systemunit_DATA = \
98 units/emergency.service \
102 units/local-fs.target \
103 units/network.target \
104 units/nss-lookup.target \
105 units/mail-transfer-agent.target \
106 units/poweroff.target \
107 units/reboot.target \
108 units/remote-fs.target \
109 units/rescue.target \
110 units/rpcbind.target \
111 units/rtc-set.target \
112 units/shutdown.target \
113 units/sigpwr.target \
114 units/sockets.target \
116 units/systemd-initctl.socket \
117 units/systemd-logger.socket \
118 units/dev-hugepages.automount \
119 units/dev-hugepages.mount \
120 units/dev-mqueue.automount \
121 units/dev-mqueue.mount \
122 units/proc-sys-fs-binfmt_misc.automount \
123 units/proc-sys-fs-binfmt_misc.mount \
124 units/sys-kernel-debug.automount \
125 units/sys-kernel-debug.mount \
126 units/sys-kernel-security.automount \
127 units/sys-kernel-security.mount \
128 units/var-lock.mount \
132 units/sysinit.target \
133 units/getty@.service \
134 units/graphical.target \
135 units/multi-user.target \
136 units/systemd-initctl.service \
137 units/systemd-logger.service \
140 dist_sessionunit_DATA = \
141 units/session/default.target
144 units/session/remote-fs.target \
145 units/session/exit.service
148 units/sysinit.target.m4 \
149 units/getty@.service.m4 \
150 units/graphical.target.m4 \
151 units/multi-user.target.m4 \
152 units/remote-fs.target.m4 \
153 units/systemd-initctl.service.in \
154 units/systemd-logger.service.in \
155 units/syslog.target.in \
156 units/session/exit.service.in \
162 dist_systemunit_DATA += \
163 units/fedora/halt.service \
164 units/fedora/killall.service \
165 units/fedora/poweroff.service \
166 units/fedora/prefdm.service \
167 units/fedora/rc-local.service \
168 units/fedora/reboot.service \
169 units/fedora/sysinit.service
173 dist_systemunit_DATA += \
174 units/suse/halt.service \
175 units/suse/poweroff.service \
176 units/suse/reboot.service
180 dist_systemunit_DATA += \
181 units/gentoo/halt.service \
182 units/gentoo/killall.service \
183 units/gentoo/poweroff.service \
184 units/gentoo/reboot.service \
185 units/gentoo/xdm.service
188 # This is needed because automake is buggy in how it generates the
189 # rules for C programs, but not Vala programs. We therefore can't
190 # list the .h files as dependencies if we want make dist to work.
207 src/load-fragment.c \
229 src/dbus-automount.c \
231 src/dbus-snapshot.c \
237 src/hostname-setup.c \
238 src/loopback-setup.c \
247 ${COMMON_SOURCES:.c=.h} \
253 src/linux/auto_dev-ioctl.h \
259 man/systemd.service.5
262 man/systemd.special.7
265 man/systemd.unit.html \
266 man/systemd.service.html
268 nodist_noinst_DATA = \
269 man/systemd.special.html
272 man/systemd.unit.xml \
273 man/systemd.service.xml \
274 man/systemd.special.xml.in \
275 man/systemd.special.7.in \
276 man/systemd.special.html.in
293 test_engine_SOURCES = \
297 test_engine_CFLAGS = $(systemd_CFLAGS)
298 test_engine_LDADD = $(systemd_LDADD)
300 test_job_type_SOURCES = \
304 test_job_type_CFLAGS = $(systemd_CFLAGS)
305 test_job_type_LDADD = $(systemd_LDADD)
312 test_ns_CFLAGS = $(systemd_CFLAGS)
313 test_ns_LDADD = $(systemd_LDADD)
315 test_loopback_SOURCES = \
317 src/test-loopback.c \
320 test_daemon_SOURCES = \
325 systemd_logger_SOURCES = \
330 systemd_initctl_SOURCES = \
335 systemd_initctl_CFLAGS = \
339 systemd_initctl_LDADD = \
342 systemd_cgroups_agent_SOURCES = \
346 systemd_cgroups_agent_CFLAGS = \
350 systemd_cgroups_agent_LDADD = \
353 systemctl_SOURCES = \
357 systemctl_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
358 systemctl_LDADD = $(DBUS_LIBS)
360 systemd_install_SOURCES = \
365 # We don't really link here against D-Bus, however we indirectly include D-Bus header files
366 systemd_install_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
368 systemadm_SOURCES = \
370 src/systemd-interfaces.vala
376 -Wno-unused-variable \
377 -Wno-unused-function \
379 -Wno-format-nonliteral
381 systemadm_VALAFLAGS = \
387 systemadm_LDADD = $(DBUSGLIB_LIBS) $(GTK_LIBS)
390 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
391 $(SED) -e 's,@rootlibexecdir\@,$(rootlibexecdir),g' \
392 -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
393 -e 's,@SPECIAL_DBUS_SERVICE\@,$(SPECIAL_DBUS_SERVICE),g' \
394 -e 's,@SYSTEMCTL\@,$(rootbindir)/systemctl,g' \
397 units/%: units/%.in Makefile
400 man/%: man/%.in Makefile
403 M4_PROCESS_SYSTEM = \
404 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
405 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@
407 M4_PROCESS_SESSION = \
408 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
409 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@
411 units/%: units/%.m4 Makefile
414 units/session/%: units/%.m4 Makefile
415 $(M4_PROCESS_SESSION)
418 units/systemd-initctl.service \
419 units/systemd-logger.service \
420 units/syslog.target \
421 units/sysinit.target \
422 units/getty@.service \
423 units/graphical.target \
424 units/multi-user.target \
425 units/remote-fs.target \
426 units/session/remote-fs.target \
427 units/session/exit.service \
428 man/systemd.special.7 \
429 man/systemd.special.html
433 src/systemd-interfaces.c \
438 XSLTPROC_PROCESS_MAN = \
439 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
440 $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
442 XSLTPROC_PROCESS_MAN_IN = \
443 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
444 $(XSLTPROC) -o ${@:.in=} -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
447 XSLTPROC_PROCESS_HTML = \
448 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
449 $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
451 XSLTPROC_PROCESS_HTML_IN = \
452 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
453 $(XSLTPROC) -o ${@:.in=} -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $< && \
457 $(XSLTPROC_PROCESS_MAN)
459 man/%.5.in: man/%.xml.in
460 $(XSLTPROC_PROCESS_MAN)
463 $(XSLTPROC_PROCESS_MAN)
465 man/%.7.in: man/%.xml.in
466 $(XSLTPROC_PROCESS_MAN_IN)
468 man/%.html: man/%.xml
469 $(XSLTPROC_PROCESS_HTML)
471 man/%.html.in: man/%.xml.in
472 $(XSLTPROC_PROCESS_HTML_IN)
476 man/systemd.special.7.in \
477 man/systemd.unit.html \
478 man/systemd.service.html \
479 man/systemd.special.html.in
482 org.freedesktop.systemd1.%.xml: systemd
483 $(AM_V_GEN)./systemd --introspect=${@:.xml=} > $@
485 CLEANFILES += $(dbusinterface_DATA)
489 $(DESTDIR)$(systemunitdir) \
490 $(DESTDIR)$(sessionunitdir) \
491 $(DESTDIR)$(systemunitdir)/sockets.target.wants \
492 $(DESTDIR)$(systemunitdir)/sysinit.target.wants \
493 $(DESTDIR)$(pkgsysconfdir)/system \
494 $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
495 $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
496 $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
497 $(DESTDIR)$(pkgsysconfdir)/session \
498 $(DESTDIR)$(sysconfdir)/xdg/systemd
499 $(MKDIR_P) -m 0755 $(DESTDIR)/cgroup/systemd || \
500 echo "Don't forget to create /cgroup/systemd! Couldn't create it for you, continuing anyway."
501 ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
503 $(LN_S) $(pkgsysconfdir)/session session )
504 ( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
505 rm -f systemd-initctl.socket systemd-logger.socket && \
506 $(LN_S) ../systemd-logger.socket systemd-logger.socket && \
507 $(LN_S) ../systemd-initctl.socket systemd-initctl.socket )
508 ( cd $(DESTDIR)$(sessionunitdir) && \
509 rm -f shutdown.target sockets.target local-fs.target swap.target && \
510 $(LN_S) $(systemunitdir)/shutdown.target shutdown.target && \
511 $(LN_S) $(systemunitdir)/sockets.target sockets.target && \
512 $(LN_S) $(systemunitdir)/local-fs.target local-fs.target && \
513 $(LN_S) $(systemunitdir)/swap.target swap.target )
514 ( cd $(DESTDIR)$(systemunitdir) && \
515 rm -f runlevel0.target runlevel1.target runlevel6.target && \
516 $(LN_S) poweroff.target runlevel0.target && \
517 $(LN_S) rescue.target runlevel1.target && \
518 $(LN_S) reboot.target runlevel6.target )
519 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
520 rm -f default.target ctrl-alt-del.target kbrequest.target && \
521 $(LN_S) $(systemunitdir)/graphical.target default.target && \
522 $(LN_S) $(systemunitdir)/reboot.target ctrl-alt-del.target && \
523 $(LN_S) $(systemunitdir)/rescue.target kbrequest.target && \
524 rm -f runlevel2.target runlevel3.target runlevel4.target runlevel5.target && \
525 $(LN_S) $(systemunitdir)/multi-user.target runlevel2.target && \
526 $(LN_S) $(systemunitdir)/multi-user.target runlevel3.target && \
527 $(LN_S) $(systemunitdir)/multi-user.target runlevel4.target && \
528 $(LN_S) $(systemunitdir)/graphical.target runlevel5.target )
529 ( cd $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants && \
530 rm -f getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service && \
531 $(LN_S) $(systemunitdir)/getty@.service getty@tty1.service && \
532 $(LN_S) $(systemunitdir)/getty@.service getty@tty2.service && \
533 $(LN_S) $(systemunitdir)/getty@.service getty@tty3.service && \
534 $(LN_S) $(systemunitdir)/getty@.service getty@tty4.service && \
535 $(LN_S) $(systemunitdir)/getty@.service getty@tty5.service && \
536 $(LN_S) $(systemunitdir)/getty@.service getty@tty6.service )
537 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
538 rm -f getty.target remote-fs.target && \
539 $(LN_S) $(systemunitdir)/getty.target getty.target && \
540 $(LN_S) $(systemunitdir)/remote-fs.target remote-fs.target )
541 ( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
542 rm -f dev-hugepages.automount \
543 dev-mqueue.automount \
544 proc-sys-fs-binfmt_misc.automount \
545 sys-kernel-debug.automount \
546 sys-kernel-security.automount && \
547 $(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
548 $(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
549 $(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
550 $(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount && \
551 $(LN_S) ../sys-kernel-security.automount sys-kernel-security.automount )
552 ( cd $(DESTDIR)$(dbussessionservicedir) && \
553 rm -f org.freedesktop.systemd1.service && \
554 $(LN_S) ../system-services/org.freedesktop.systemd1.service org.freedesktop.systemd1.service )
556 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
557 rm -f display-manager.service && \
558 $(LN_S) $(systemunitdir)/prefdm.service display-manager.service )
559 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
560 rm -f display-manager.service && \
561 $(LN_S) ../display-manager.service display-manager.service )
562 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
563 rm -f rc-local.service && \
564 $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
565 ( cd $(DESTDIR)$(systemunitdir) && \
566 rm -f local.service && \
567 $(LN_S) rc-local.service local.service )
568 ( cd $(DESTDIR)/etc/init.d && \
569 $(LN_S) halt reboot > /dev/null 2>&1 || true )
572 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
573 rm -f display-manager.service && \
574 $(LN_S) $(systemunitdir)/xdm.service display-manager.service )
575 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
576 rm -f display-manager.service && \
577 $(LN_S) ../display-manager.service display-manager.service )
580 DISTCHECK_CONFIGURE_FLAGS = \
581 --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
582 --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
583 --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
584 --with-dbusinterfacedir=$$dc_install_base/$(dbusinterfacedir) \
585 --with-udevrulesdir=$$dc_install_base/$(udevrulesdir) \
586 --with-rootdir=$$dc_install_base/$(rootdir)