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\" \
62 rootlibexec_PROGRAMS = \
64 systemd-cgroups-agent \
74 dist_dbuspolicy_DATA = \
75 src/org.freedesktop.systemd1.conf
77 dist_dbussystemservice_DATA = \
78 src/org.freedesktop.systemd1.service
80 dist_udevrules_DATA = \
83 dbusinterface_DATA = \
84 org.freedesktop.systemd1.Manager.xml \
85 org.freedesktop.systemd1.Job.xml \
86 org.freedesktop.systemd1.Unit.xml \
87 org.freedesktop.systemd1.Service.xml \
88 org.freedesktop.systemd1.Socket.xml \
89 org.freedesktop.systemd1.Timer.xml \
90 org.freedesktop.systemd1.Target.xml \
91 org.freedesktop.systemd1.Device.xml \
92 org.freedesktop.systemd1.Mount.xml \
93 org.freedesktop.systemd1.Automount.xml \
94 org.freedesktop.systemd1.Snapshot.xml \
95 org.freedesktop.systemd1.Swap.xml \
96 org.freedesktop.systemd1.Path.xml
98 dist_systemunit_DATA = \
99 units/emergency.service \
103 units/local-fs.target \
104 units/network.target \
105 units/nss-lookup.target \
106 units/mail-transfer-agent.target \
107 units/poweroff.target \
108 units/reboot.target \
109 units/remote-fs.target \
110 units/rescue.target \
111 units/rpcbind.target \
112 units/rtc-set.target \
113 units/shutdown.target \
114 units/sigpwr.target \
115 units/sockets.target \
117 units/systemd-initctl.socket \
118 units/systemd-logger.socket \
119 units/dev-hugepages.automount \
120 units/dev-hugepages.mount \
121 units/dev-mqueue.automount \
122 units/dev-mqueue.mount \
123 units/proc-sys-fs-binfmt_misc.automount \
124 units/proc-sys-fs-binfmt_misc.mount \
125 units/sys-kernel-debug.automount \
126 units/sys-kernel-debug.mount \
127 units/sys-kernel-security.automount \
128 units/sys-kernel-security.mount \
129 units/var-lock.mount \
133 units/sysinit.target \
134 units/getty@.service \
135 units/graphical.target \
136 units/multi-user.target \
137 units/systemd-initctl.service \
138 units/systemd-logger.service \
141 dist_sessionunit_DATA = \
142 units/session/default.target
145 units/session/remote-fs.target \
146 units/session/exit.service
149 units/sysinit.target.m4 \
150 units/getty@.service.m4 \
151 units/graphical.target.m4 \
152 units/multi-user.target.m4 \
153 units/remote-fs.target.m4 \
154 units/systemd-initctl.service.in \
155 units/systemd-logger.service.in \
156 units/syslog.target.in \
157 units/session/exit.service.in \
163 dist_systemunit_DATA += \
164 units/fedora/halt.service \
165 units/fedora/killall.service \
166 units/fedora/poweroff.service \
167 units/fedora/prefdm.service \
168 units/fedora/rc-local.service \
169 units/fedora/reboot.service \
170 units/fedora/sysinit.service
174 dist_systemunit_DATA += \
175 units/suse/halt.service \
176 units/suse/poweroff.service \
177 units/suse/reboot.service
181 dist_systemunit_DATA += \
182 units/gentoo/halt.service \
183 units/gentoo/killall.service \
184 units/gentoo/poweroff.service \
185 units/gentoo/reboot.service \
186 units/gentoo/xdm.service
190 dist_systemunit_DATA += \
191 units/arch/sysinit.service \
192 units/arch/rc-local.service \
193 units/arch/halt.service \
194 units/arch/poweroff.service \
195 units/arch/reboot.service
203 # This is needed because automake is buggy in how it generates the
204 # rules for C programs, but not Vala programs. We therefore can't
205 # list the .h files as dependencies if we want make dist to work.
222 src/load-fragment.c \
244 src/dbus-automount.c \
246 src/dbus-snapshot.c \
252 src/hostname-setup.c \
253 src/loopback-setup.c \
263 ${COMMON_SOURCES:.c=.h} \
269 src/linux/auto_dev-ioctl.h \
275 man/systemd.service.5
278 man/systemd.special.7
281 man/systemd.unit.html \
282 man/systemd.service.html
284 nodist_noinst_DATA = \
285 man/systemd.special.html
288 man/systemd.unit.xml \
289 man/systemd.service.xml \
290 man/systemd.special.xml.in \
291 man/systemd.special.7.in \
292 man/systemd.special.html.in
311 test_engine_SOURCES = \
315 test_engine_CFLAGS = $(systemd_CFLAGS)
316 test_engine_LDADD = $(systemd_LDADD)
318 test_job_type_SOURCES = \
322 test_job_type_CFLAGS = $(systemd_CFLAGS)
323 test_job_type_LDADD = $(systemd_LDADD)
330 test_ns_CFLAGS = $(systemd_CFLAGS)
331 test_ns_LDADD = $(systemd_LDADD)
333 test_loopback_SOURCES = \
335 src/test-loopback.c \
338 test_daemon_SOURCES = \
343 systemd_logger_SOURCES = \
349 systemd_logger_LDADD = \
352 systemd_initctl_SOURCES = \
357 systemd_initctl_CFLAGS = \
361 systemd_initctl_LDADD = \
364 systemd_cgroups_agent_SOURCES = \
368 systemd_cgroups_agent_CFLAGS = \
372 systemd_cgroups_agent_LDADD = \
375 systemctl_SOURCES = \
380 systemctl_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
381 systemctl_LDADD = $(DBUS_LIBS)
383 systemd_notify_SOURCES = \
388 systemd_install_SOURCES = \
393 # We don't really link here against D-Bus, however we indirectly include D-Bus header files
394 systemd_install_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
396 systemadm_SOURCES = \
398 src/systemd-interfaces.vala
404 -Wno-unused-variable \
405 -Wno-unused-function \
407 -Wno-format-nonliteral
409 systemadm_VALAFLAGS = \
415 systemadm_LDADD = $(DBUSGLIB_LIBS) $(GTK_LIBS)
418 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
419 $(SED) -e 's,@rootlibexecdir\@,$(rootlibexecdir),g' \
420 -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
421 -e 's,@SPECIAL_DBUS_SERVICE\@,$(SPECIAL_DBUS_SERVICE),g' \
422 -e 's,@SYSTEMCTL\@,$(rootbindir)/systemctl,g' \
425 units/%: units/%.in Makefile
428 man/%: man/%.in Makefile
431 M4_PROCESS_SYSTEM = \
432 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
433 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@
435 M4_PROCESS_SESSION = \
436 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
437 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@
439 units/%: units/%.m4 Makefile
442 units/session/%: units/%.m4 Makefile
443 $(M4_PROCESS_SESSION)
446 units/systemd-initctl.service \
447 units/systemd-logger.service \
448 units/syslog.target \
449 units/sysinit.target \
450 units/getty@.service \
451 units/graphical.target \
452 units/multi-user.target \
453 units/remote-fs.target \
454 units/session/remote-fs.target \
455 units/session/exit.service \
456 man/systemd.special.7 \
457 man/systemd.special.html
461 src/systemd-interfaces.c \
466 XSLTPROC_PROCESS_MAN = \
467 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
468 $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
470 XSLTPROC_PROCESS_MAN_IN = \
471 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
472 $(XSLTPROC) -o ${@:.in=} -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
475 XSLTPROC_PROCESS_HTML = \
476 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
477 $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
479 XSLTPROC_PROCESS_HTML_IN = \
480 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
481 $(XSLTPROC) -o ${@:.in=} -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $< && \
485 $(XSLTPROC_PROCESS_MAN)
487 man/%.5.in: man/%.xml.in
488 $(XSLTPROC_PROCESS_MAN)
491 $(XSLTPROC_PROCESS_MAN)
493 man/%.7.in: man/%.xml.in
494 $(XSLTPROC_PROCESS_MAN_IN)
496 man/%.html: man/%.xml
497 $(XSLTPROC_PROCESS_HTML)
499 man/%.html.in: man/%.xml.in
500 $(XSLTPROC_PROCESS_HTML_IN)
504 man/systemd.special.7.in \
505 man/systemd.unit.html \
506 man/systemd.service.html \
507 man/systemd.special.html.in
510 org.freedesktop.systemd1.%.xml: systemd
511 $(AM_V_GEN)./systemd --introspect=${@:.xml=} > $@
513 CLEANFILES += $(dbusinterface_DATA)
517 $(DESTDIR)$(systemunitdir) \
518 $(DESTDIR)$(sessionunitdir) \
519 $(DESTDIR)$(systemunitdir)/sockets.target.wants \
520 $(DESTDIR)$(systemunitdir)/sysinit.target.wants \
521 $(DESTDIR)$(pkgsysconfdir)/system \
522 $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
523 $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
524 $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
525 $(DESTDIR)$(pkgsysconfdir)/session \
526 $(DESTDIR)$(sysconfdir)/xdg/systemd
527 $(MKDIR_P) -m 0755 $(DESTDIR)/cgroup/systemd || \
528 echo "Don't forget to create /cgroup/systemd! Couldn't create it for you, continuing anyway."
529 ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
531 $(LN_S) $(pkgsysconfdir)/session session )
532 ( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
533 rm -f systemd-initctl.socket systemd-logger.socket && \
534 $(LN_S) ../systemd-logger.socket systemd-logger.socket && \
535 $(LN_S) ../systemd-initctl.socket systemd-initctl.socket )
536 ( cd $(DESTDIR)$(sessionunitdir) && \
537 rm -f shutdown.target sockets.target local-fs.target swap.target && \
538 $(LN_S) $(systemunitdir)/shutdown.target shutdown.target && \
539 $(LN_S) $(systemunitdir)/sockets.target sockets.target && \
540 $(LN_S) $(systemunitdir)/local-fs.target local-fs.target && \
541 $(LN_S) $(systemunitdir)/swap.target swap.target )
542 ( cd $(DESTDIR)$(systemunitdir) && \
543 rm -f runlevel0.target runlevel1.target runlevel6.target && \
544 $(LN_S) poweroff.target runlevel0.target && \
545 $(LN_S) rescue.target runlevel1.target && \
546 $(LN_S) reboot.target runlevel6.target )
547 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
548 rm -f default.target ctrl-alt-del.target kbrequest.target && \
549 $(LN_S) $(systemunitdir)/graphical.target default.target && \
550 $(LN_S) $(systemunitdir)/reboot.target ctrl-alt-del.target && \
551 $(LN_S) $(systemunitdir)/rescue.target kbrequest.target && \
552 rm -f runlevel2.target runlevel3.target runlevel4.target runlevel5.target && \
553 $(LN_S) $(systemunitdir)/multi-user.target runlevel2.target && \
554 $(LN_S) $(systemunitdir)/multi-user.target runlevel3.target && \
555 $(LN_S) $(systemunitdir)/multi-user.target runlevel4.target && \
556 $(LN_S) $(systemunitdir)/graphical.target runlevel5.target )
557 ( cd $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants && \
558 rm -f getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service && \
559 $(LN_S) $(systemunitdir)/getty@.service getty@tty1.service && \
560 $(LN_S) $(systemunitdir)/getty@.service getty@tty2.service && \
561 $(LN_S) $(systemunitdir)/getty@.service getty@tty3.service && \
562 $(LN_S) $(systemunitdir)/getty@.service getty@tty4.service && \
563 $(LN_S) $(systemunitdir)/getty@.service getty@tty5.service && \
564 $(LN_S) $(systemunitdir)/getty@.service getty@tty6.service )
565 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
566 rm -f getty.target remote-fs.target && \
567 $(LN_S) $(systemunitdir)/getty.target getty.target && \
568 $(LN_S) $(systemunitdir)/remote-fs.target remote-fs.target )
569 ( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
570 rm -f dev-hugepages.automount \
571 dev-mqueue.automount \
572 proc-sys-fs-binfmt_misc.automount \
573 sys-kernel-debug.automount \
574 sys-kernel-security.automount && \
575 $(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
576 $(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
577 $(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
578 $(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount && \
579 $(LN_S) ../sys-kernel-security.automount sys-kernel-security.automount )
580 ( cd $(DESTDIR)$(dbussessionservicedir) && \
581 rm -f org.freedesktop.systemd1.service && \
582 $(LN_S) ../system-services/org.freedesktop.systemd1.service org.freedesktop.systemd1.service )
584 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
585 rm -f display-manager.service && \
586 $(LN_S) $(systemunitdir)/prefdm.service display-manager.service )
587 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
588 rm -f display-manager.service && \
589 $(LN_S) ../display-manager.service display-manager.service )
590 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
591 rm -f rc-local.service && \
592 $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
593 ( cd $(DESTDIR)$(systemunitdir) && \
594 rm -f local.service && \
595 $(LN_S) rc-local.service local.service )
596 ( cd $(DESTDIR)/etc/init.d && \
597 $(LN_S) halt reboot > /dev/null 2>&1 || true )
600 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
601 rm -f display-manager.service && \
602 $(LN_S) $(systemunitdir)/xdm.service display-manager.service )
603 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
604 rm -f display-manager.service && \
605 $(LN_S) ../display-manager.service display-manager.service )
608 DISTCHECK_CONFIGURE_FLAGS = \
609 --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
610 --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
611 --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
612 --with-dbusinterfacedir=$$dc_install_base/$(dbusinterfacedir) \
613 --with-udevrulesdir=$$dc_install_base/$(udevrulesdir) \
614 --with-rootdir=$$dc_install_base/$(rootdir)