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 \
72 dist_dbuspolicy_DATA = \
73 src/org.freedesktop.systemd1.conf
75 dist_dbussystemservice_DATA = \
76 src/org.freedesktop.systemd1.service
78 dist_udevrules_DATA = \
81 dbusinterface_DATA = \
82 org.freedesktop.systemd1.Manager.xml \
83 org.freedesktop.systemd1.Job.xml \
84 org.freedesktop.systemd1.Unit.xml \
85 org.freedesktop.systemd1.Service.xml \
86 org.freedesktop.systemd1.Socket.xml \
87 org.freedesktop.systemd1.Timer.xml \
88 org.freedesktop.systemd1.Target.xml \
89 org.freedesktop.systemd1.Device.xml \
90 org.freedesktop.systemd1.Mount.xml \
91 org.freedesktop.systemd1.Automount.xml \
92 org.freedesktop.systemd1.Snapshot.xml \
93 org.freedesktop.systemd1.Swap.xml \
94 org.freedesktop.systemd1.Path.xml
96 dist_systemunit_DATA = \
97 units/emergency.service \
101 units/local-fs.target \
102 units/network.target \
103 units/nss-lookup.target \
104 units/mail-transfer-agent.target \
105 units/poweroff.target \
106 units/reboot.target \
107 units/remote-fs.target \
108 units/rescue.target \
109 units/rpcbind.target \
110 units/rtc-set.target \
111 units/shutdown.target \
112 units/sigpwr.target \
113 units/sockets.target \
115 units/systemd-initctl.socket \
116 units/systemd-logger.socket \
117 units/dev-hugepages.automount \
118 units/dev-hugepages.mount \
119 units/dev-mqueue.automount \
120 units/dev-mqueue.mount \
121 units/proc-sys-fs-binfmt_misc.automount \
122 units/proc-sys-fs-binfmt_misc.mount \
123 units/sys-kernel-debug.automount \
124 units/sys-kernel-debug.mount \
125 units/sys-kernel-security.automount \
126 units/sys-kernel-security.mount \
127 units/var-lock.mount \
131 units/sysinit.target \
132 units/getty@.service \
133 units/graphical.target \
134 units/multi-user.target \
135 units/systemd-initctl.service \
136 units/systemd-logger.service \
139 dist_sessionunit_DATA = \
140 units/session/default.target
143 units/session/remote-fs.target \
144 units/session/exit.service
147 units/sysinit.target.m4 \
148 units/getty@.service.m4 \
149 units/graphical.target.m4 \
150 units/multi-user.target.m4 \
151 units/remote-fs.target.m4 \
152 units/systemd-initctl.service.in \
153 units/systemd-logger.service.in \
154 units/syslog.target.in \
155 units/session/exit.service.in \
161 dist_systemunit_DATA += \
162 units/fedora/halt.service \
163 units/fedora/killall.service \
164 units/fedora/poweroff.service \
165 units/fedora/prefdm.service \
166 units/fedora/rc-local.service \
167 units/fedora/reboot.service \
168 units/fedora/sysinit.service
172 dist_systemunit_DATA += \
173 units/suse/halt.service \
174 units/suse/poweroff.service \
175 units/suse/reboot.service
179 dist_systemunit_DATA += \
180 units/gentoo/halt.service \
181 units/gentoo/killall.service \
182 units/gentoo/poweroff.service \
183 units/gentoo/reboot.service \
184 units/gentoo/xdm.service
187 # This is needed because automake is buggy in how it generates the
188 # rules for C programs, but not Vala programs. We therefore can't
189 # list the .h files as dependencies if we want make dist to work.
206 src/load-fragment.c \
228 src/dbus-automount.c \
230 src/dbus-snapshot.c \
236 src/hostname-setup.c \
237 src/loopback-setup.c \
246 ${COMMON_SOURCES:.c=.h} \
252 src/linux/auto_dev-ioctl.h \
258 man/systemd.service.5
261 man/systemd.special.7
264 man/systemd.unit.html \
265 man/systemd.service.html
267 nodist_noinst_DATA = \
268 man/systemd.special.html
271 man/systemd.unit.xml \
272 man/systemd.service.xml \
273 man/systemd.special.xml.in \
274 man/systemd.special.7.in \
275 man/systemd.special.html.in
292 test_engine_SOURCES = \
296 test_engine_CFLAGS = $(systemd_CFLAGS)
297 test_engine_LDADD = $(systemd_LDADD)
299 test_job_type_SOURCES = \
303 test_job_type_CFLAGS = $(systemd_CFLAGS)
304 test_job_type_LDADD = $(systemd_LDADD)
311 test_ns_CFLAGS = $(systemd_CFLAGS)
312 test_ns_LDADD = $(systemd_LDADD)
314 test_loopback_SOURCES = \
316 src/test-loopback.c \
319 test_loopback_CFLAGS = $(systemd_CFLAGS)
320 test_loopback_LDADD = $(systemd_LDADD)
322 systemd_logger_SOURCES = \
327 systemd_initctl_SOURCES = \
332 systemd_initctl_CFLAGS = \
336 systemd_initctl_LDADD = \
339 systemd_cgroups_agent_SOURCES = \
343 systemd_cgroups_agent_CFLAGS = \
347 systemd_cgroups_agent_LDADD = \
350 systemctl_SOURCES = \
354 systemctl_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
355 systemctl_LDADD = $(DBUS_LIBS)
357 systemd_install_SOURCES = \
362 # We don't really link here against D-Bus, however we indirectly include D-Bus header files
363 systemd_install_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
365 systemadm_SOURCES = \
367 src/systemd-interfaces.vala
373 -Wno-unused-variable \
374 -Wno-unused-function \
376 -Wno-format-nonliteral
378 systemadm_VALAFLAGS = \
384 systemadm_LDADD = $(DBUSGLIB_LIBS) $(GTK_LIBS)
387 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
388 $(SED) -e 's,@rootlibexecdir\@,$(rootlibexecdir),g' \
389 -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
390 -e 's,@SPECIAL_DBUS_SERVICE\@,$(SPECIAL_DBUS_SERVICE),g' \
391 -e 's,@SYSTEMCTL\@,$(rootbindir)/systemctl,g' \
394 units/%: units/%.in Makefile
397 man/%: man/%.in Makefile
400 M4_PROCESS_SYSTEM = \
401 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
402 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@
404 M4_PROCESS_SESSION = \
405 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
406 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@
408 units/%: units/%.m4 Makefile
411 units/session/%: units/%.m4 Makefile
412 $(M4_PROCESS_SESSION)
415 units/systemd-initctl.service \
416 units/systemd-logger.service \
417 units/syslog.target \
418 units/sysinit.target \
419 units/getty@.service \
420 units/graphical.target \
421 units/multi-user.target \
422 units/remote-fs.target \
423 units/session/remote-fs.target \
424 units/session/exit.service \
425 man/systemd.special.7 \
426 man/systemd.special.html
430 src/systemd-interfaces.c \
435 XSLTPROC_PROCESS_MAN = \
436 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
437 $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
439 XSLTPROC_PROCESS_MAN_IN = \
440 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
441 $(XSLTPROC) -o ${@:.in=} -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
444 XSLTPROC_PROCESS_HTML = \
445 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
446 $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
448 XSLTPROC_PROCESS_HTML_IN = \
449 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
450 $(XSLTPROC) -o ${@:.in=} -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $< && \
454 $(XSLTPROC_PROCESS_MAN)
456 man/%.5.in: man/%.xml.in
457 $(XSLTPROC_PROCESS_MAN)
460 $(XSLTPROC_PROCESS_MAN)
462 man/%.7.in: man/%.xml.in
463 $(XSLTPROC_PROCESS_MAN_IN)
465 man/%.html: man/%.xml
466 $(XSLTPROC_PROCESS_HTML)
468 man/%.html.in: man/%.xml.in
469 $(XSLTPROC_PROCESS_HTML_IN)
473 man/systemd.special.7.in \
474 man/systemd.unit.html \
475 man/systemd.service.html \
476 man/systemd.special.html.in
479 org.freedesktop.systemd1.%.xml: systemd
480 $(AM_V_GEN)./systemd --introspect=${@:.xml=} > $@
482 CLEANFILES += $(dbusinterface_DATA)
486 $(DESTDIR)$(systemunitdir) \
487 $(DESTDIR)$(sessionunitdir) \
488 $(DESTDIR)$(systemunitdir)/sockets.target.wants \
489 $(DESTDIR)$(systemunitdir)/sysinit.target.wants \
490 $(DESTDIR)$(pkgsysconfdir)/system \
491 $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
492 $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
493 $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
494 $(DESTDIR)$(pkgsysconfdir)/session \
495 $(DESTDIR)$(sysconfdir)/xdg/systemd
496 $(MKDIR_P) -m 0755 $(DESTDIR)/cgroup/systemd || \
497 echo "Don't forget to create /cgroup/systemd! Couldn't create it for you, continuing anyway."
498 ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
500 $(LN_S) $(pkgsysconfdir)/session session )
501 ( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
502 rm -f systemd-initctl.socket systemd-logger.socket && \
503 $(LN_S) ../systemd-logger.socket systemd-logger.socket && \
504 $(LN_S) ../systemd-initctl.socket systemd-initctl.socket )
505 ( cd $(DESTDIR)$(sessionunitdir) && \
506 rm -f shutdown.target sockets.target local-fs.target swap.target && \
507 $(LN_S) $(systemunitdir)/shutdown.target shutdown.target && \
508 $(LN_S) $(systemunitdir)/sockets.target sockets.target && \
509 $(LN_S) $(systemunitdir)/local-fs.target local-fs.target && \
510 $(LN_S) $(systemunitdir)/swap.target swap.target )
511 ( cd $(DESTDIR)$(systemunitdir) && \
512 rm -f runlevel0.target runlevel1.target runlevel6.target && \
513 $(LN_S) poweroff.target runlevel0.target && \
514 $(LN_S) rescue.target runlevel1.target && \
515 $(LN_S) reboot.target runlevel6.target )
516 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
517 rm -f default.target ctrl-alt-del.target kbrequest.target && \
518 $(LN_S) $(systemunitdir)/graphical.target default.target && \
519 $(LN_S) $(systemunitdir)/reboot.target ctrl-alt-del.target && \
520 $(LN_S) $(systemunitdir)/rescue.target kbrequest.target && \
521 rm -f runlevel2.target runlevel3.target runlevel4.target runlevel5.target && \
522 $(LN_S) $(systemunitdir)/multi-user.target runlevel2.target && \
523 $(LN_S) $(systemunitdir)/multi-user.target runlevel3.target && \
524 $(LN_S) $(systemunitdir)/multi-user.target runlevel4.target && \
525 $(LN_S) $(systemunitdir)/graphical.target runlevel5.target )
526 ( cd $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants && \
527 rm -f getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service && \
528 $(LN_S) $(systemunitdir)/getty@.service getty@tty1.service && \
529 $(LN_S) $(systemunitdir)/getty@.service getty@tty2.service && \
530 $(LN_S) $(systemunitdir)/getty@.service getty@tty3.service && \
531 $(LN_S) $(systemunitdir)/getty@.service getty@tty4.service && \
532 $(LN_S) $(systemunitdir)/getty@.service getty@tty5.service && \
533 $(LN_S) $(systemunitdir)/getty@.service getty@tty6.service )
534 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
535 rm -f getty.target remote-fs.target && \
536 $(LN_S) $(systemunitdir)/getty.target getty.target && \
537 $(LN_S) $(systemunitdir)/remote-fs.target remote-fs.target )
538 ( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
539 rm -f dev-hugepages.automount \
540 dev-mqueue.automount \
541 proc-sys-fs-binfmt_misc.automount \
542 sys-kernel-debug.automount \
543 sys-kernel-security.automount && \
544 $(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
545 $(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
546 $(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
547 $(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount && \
548 $(LN_S) ../sys-kernel-security.automount sys-kernel-security.automount )
549 ( cd $(DESTDIR)$(dbussessionservicedir) && \
550 rm -f org.freedesktop.systemd1.service && \
551 $(LN_S) ../system-services/org.freedesktop.systemd1.service org.freedesktop.systemd1.service )
553 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
554 rm -f display-manager.service && \
555 $(LN_S) $(systemunitdir)/prefdm.service display-manager.service )
556 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
557 rm -f display-manager.service && \
558 $(LN_S) ../display-manager.service display-manager.service )
559 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
560 rm -f rc-local.service && \
561 $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
562 ( cd $(DESTDIR)$(systemunitdir) && \
563 rm -f local.service && \
564 $(LN_S) rc-local.service local.service )
565 ( cd $(DESTDIR)/etc/init.d && \
566 $(LN_S) halt reboot > /dev/null 2>&1 || true )
569 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
570 rm -f display-manager.service && \
571 $(LN_S) $(systemunitdir)/xdm.service display-manager.service )
572 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
573 rm -f display-manager.service && \
574 $(LN_S) ../display-manager.service display-manager.service )
577 DISTCHECK_CONFIGURE_FLAGS = \
578 --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
579 --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
580 --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
581 --with-dbusinterfacedir=$$dc_install_base/$(dbusinterfacedir) \
582 --with-udevrulesdir=$$dc_install_base/$(udevrulesdir) \
583 --with-rootdir=$$dc_install_base/$(rootdir)