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 \
248 ${COMMON_SOURCES:.c=.h} \
254 src/linux/auto_dev-ioctl.h \
260 man/systemd.service.5
263 man/systemd.special.7
266 man/systemd.unit.html \
267 man/systemd.service.html
269 nodist_noinst_DATA = \
270 man/systemd.special.html
273 man/systemd.unit.xml \
274 man/systemd.service.xml \
275 man/systemd.special.xml.in \
276 man/systemd.special.7.in \
277 man/systemd.special.html.in
295 test_engine_SOURCES = \
299 test_engine_CFLAGS = $(systemd_CFLAGS)
300 test_engine_LDADD = $(systemd_LDADD)
302 test_job_type_SOURCES = \
306 test_job_type_CFLAGS = $(systemd_CFLAGS)
307 test_job_type_LDADD = $(systemd_LDADD)
314 test_ns_CFLAGS = $(systemd_CFLAGS)
315 test_ns_LDADD = $(systemd_LDADD)
317 test_loopback_SOURCES = \
319 src/test-loopback.c \
322 test_daemon_SOURCES = \
327 systemd_logger_SOURCES = \
333 systemd_logger_LDADD = \
336 systemd_initctl_SOURCES = \
341 systemd_initctl_CFLAGS = \
345 systemd_initctl_LDADD = \
348 systemd_cgroups_agent_SOURCES = \
352 systemd_cgroups_agent_CFLAGS = \
356 systemd_cgroups_agent_LDADD = \
359 systemctl_SOURCES = \
363 systemctl_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
364 systemctl_LDADD = $(DBUS_LIBS)
366 systemd_install_SOURCES = \
371 # We don't really link here against D-Bus, however we indirectly include D-Bus header files
372 systemd_install_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
374 systemadm_SOURCES = \
376 src/systemd-interfaces.vala
382 -Wno-unused-variable \
383 -Wno-unused-function \
385 -Wno-format-nonliteral
387 systemadm_VALAFLAGS = \
393 systemadm_LDADD = $(DBUSGLIB_LIBS) $(GTK_LIBS)
396 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
397 $(SED) -e 's,@rootlibexecdir\@,$(rootlibexecdir),g' \
398 -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
399 -e 's,@SPECIAL_DBUS_SERVICE\@,$(SPECIAL_DBUS_SERVICE),g' \
400 -e 's,@SYSTEMCTL\@,$(rootbindir)/systemctl,g' \
403 units/%: units/%.in Makefile
406 man/%: man/%.in Makefile
409 M4_PROCESS_SYSTEM = \
410 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
411 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@
413 M4_PROCESS_SESSION = \
414 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
415 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@
417 units/%: units/%.m4 Makefile
420 units/session/%: units/%.m4 Makefile
421 $(M4_PROCESS_SESSION)
424 units/systemd-initctl.service \
425 units/systemd-logger.service \
426 units/syslog.target \
427 units/sysinit.target \
428 units/getty@.service \
429 units/graphical.target \
430 units/multi-user.target \
431 units/remote-fs.target \
432 units/session/remote-fs.target \
433 units/session/exit.service \
434 man/systemd.special.7 \
435 man/systemd.special.html
439 src/systemd-interfaces.c \
444 XSLTPROC_PROCESS_MAN = \
445 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
446 $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
448 XSLTPROC_PROCESS_MAN_IN = \
449 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
450 $(XSLTPROC) -o ${@:.in=} -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
453 XSLTPROC_PROCESS_HTML = \
454 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
455 $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
457 XSLTPROC_PROCESS_HTML_IN = \
458 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
459 $(XSLTPROC) -o ${@:.in=} -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $< && \
463 $(XSLTPROC_PROCESS_MAN)
465 man/%.5.in: man/%.xml.in
466 $(XSLTPROC_PROCESS_MAN)
469 $(XSLTPROC_PROCESS_MAN)
471 man/%.7.in: man/%.xml.in
472 $(XSLTPROC_PROCESS_MAN_IN)
474 man/%.html: man/%.xml
475 $(XSLTPROC_PROCESS_HTML)
477 man/%.html.in: man/%.xml.in
478 $(XSLTPROC_PROCESS_HTML_IN)
482 man/systemd.special.7.in \
483 man/systemd.unit.html \
484 man/systemd.service.html \
485 man/systemd.special.html.in
488 org.freedesktop.systemd1.%.xml: systemd
489 $(AM_V_GEN)./systemd --introspect=${@:.xml=} > $@
491 CLEANFILES += $(dbusinterface_DATA)
495 $(DESTDIR)$(systemunitdir) \
496 $(DESTDIR)$(sessionunitdir) \
497 $(DESTDIR)$(systemunitdir)/sockets.target.wants \
498 $(DESTDIR)$(systemunitdir)/sysinit.target.wants \
499 $(DESTDIR)$(pkgsysconfdir)/system \
500 $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
501 $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
502 $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
503 $(DESTDIR)$(pkgsysconfdir)/session \
504 $(DESTDIR)$(sysconfdir)/xdg/systemd
505 $(MKDIR_P) -m 0755 $(DESTDIR)/cgroup/systemd || \
506 echo "Don't forget to create /cgroup/systemd! Couldn't create it for you, continuing anyway."
507 ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
509 $(LN_S) $(pkgsysconfdir)/session session )
510 ( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
511 rm -f systemd-initctl.socket systemd-logger.socket && \
512 $(LN_S) ../systemd-logger.socket systemd-logger.socket && \
513 $(LN_S) ../systemd-initctl.socket systemd-initctl.socket )
514 ( cd $(DESTDIR)$(sessionunitdir) && \
515 rm -f shutdown.target sockets.target local-fs.target swap.target && \
516 $(LN_S) $(systemunitdir)/shutdown.target shutdown.target && \
517 $(LN_S) $(systemunitdir)/sockets.target sockets.target && \
518 $(LN_S) $(systemunitdir)/local-fs.target local-fs.target && \
519 $(LN_S) $(systemunitdir)/swap.target swap.target )
520 ( cd $(DESTDIR)$(systemunitdir) && \
521 rm -f runlevel0.target runlevel1.target runlevel6.target && \
522 $(LN_S) poweroff.target runlevel0.target && \
523 $(LN_S) rescue.target runlevel1.target && \
524 $(LN_S) reboot.target runlevel6.target )
525 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
526 rm -f default.target ctrl-alt-del.target kbrequest.target && \
527 $(LN_S) $(systemunitdir)/graphical.target default.target && \
528 $(LN_S) $(systemunitdir)/reboot.target ctrl-alt-del.target && \
529 $(LN_S) $(systemunitdir)/rescue.target kbrequest.target && \
530 rm -f runlevel2.target runlevel3.target runlevel4.target runlevel5.target && \
531 $(LN_S) $(systemunitdir)/multi-user.target runlevel2.target && \
532 $(LN_S) $(systemunitdir)/multi-user.target runlevel3.target && \
533 $(LN_S) $(systemunitdir)/multi-user.target runlevel4.target && \
534 $(LN_S) $(systemunitdir)/graphical.target runlevel5.target )
535 ( cd $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants && \
536 rm -f getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service && \
537 $(LN_S) $(systemunitdir)/getty@.service getty@tty1.service && \
538 $(LN_S) $(systemunitdir)/getty@.service getty@tty2.service && \
539 $(LN_S) $(systemunitdir)/getty@.service getty@tty3.service && \
540 $(LN_S) $(systemunitdir)/getty@.service getty@tty4.service && \
541 $(LN_S) $(systemunitdir)/getty@.service getty@tty5.service && \
542 $(LN_S) $(systemunitdir)/getty@.service getty@tty6.service )
543 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
544 rm -f getty.target remote-fs.target && \
545 $(LN_S) $(systemunitdir)/getty.target getty.target && \
546 $(LN_S) $(systemunitdir)/remote-fs.target remote-fs.target )
547 ( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
548 rm -f dev-hugepages.automount \
549 dev-mqueue.automount \
550 proc-sys-fs-binfmt_misc.automount \
551 sys-kernel-debug.automount \
552 sys-kernel-security.automount && \
553 $(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
554 $(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
555 $(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
556 $(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount && \
557 $(LN_S) ../sys-kernel-security.automount sys-kernel-security.automount )
558 ( cd $(DESTDIR)$(dbussessionservicedir) && \
559 rm -f org.freedesktop.systemd1.service && \
560 $(LN_S) ../system-services/org.freedesktop.systemd1.service org.freedesktop.systemd1.service )
562 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
563 rm -f display-manager.service && \
564 $(LN_S) $(systemunitdir)/prefdm.service display-manager.service )
565 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
566 rm -f display-manager.service && \
567 $(LN_S) ../display-manager.service display-manager.service )
568 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
569 rm -f rc-local.service && \
570 $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
571 ( cd $(DESTDIR)$(systemunitdir) && \
572 rm -f local.service && \
573 $(LN_S) rc-local.service local.service )
574 ( cd $(DESTDIR)/etc/init.d && \
575 $(LN_S) halt reboot > /dev/null 2>&1 || true )
578 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
579 rm -f display-manager.service && \
580 $(LN_S) $(systemunitdir)/xdm.service display-manager.service )
581 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
582 rm -f display-manager.service && \
583 $(LN_S) ../display-manager.service display-manager.service )
586 DISTCHECK_CONFIGURE_FLAGS = \
587 --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
588 --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
589 --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
590 --with-dbusinterfacedir=$$dc_install_base/$(dbusinterfacedir) \
591 --with-udevrulesdir=$$dc_install_base/$(udevrulesdir) \
592 --with-rootdir=$$dc_install_base/$(rootdir)