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\" \
58 rootlibexec_PROGRAMS = \
60 systemd-cgroups-agent \
69 dist_dbuspolicy_DATA = \
70 src/org.freedesktop.systemd1.conf
72 dist_dbussystemservice_DATA = \
73 src/org.freedesktop.systemd1.service
75 dist_udevrules_DATA = \
78 dbusinterface_DATA = \
79 org.freedesktop.systemd1.Manager.xml \
80 org.freedesktop.systemd1.Job.xml \
81 org.freedesktop.systemd1.Unit.xml \
82 org.freedesktop.systemd1.Service.xml \
83 org.freedesktop.systemd1.Socket.xml \
84 org.freedesktop.systemd1.Timer.xml \
85 org.freedesktop.systemd1.Target.xml \
86 org.freedesktop.systemd1.Device.xml \
87 org.freedesktop.systemd1.Mount.xml \
88 org.freedesktop.systemd1.Automount.xml \
89 org.freedesktop.systemd1.Snapshot.xml \
90 org.freedesktop.systemd1.Swap.xml \
91 org.freedesktop.systemd1.Path.xml
93 dist_systemunit_DATA = \
94 units/emergency.service \
98 units/local-fs.target \
99 units/network.target \
100 units/nss-lookup.target \
101 units/mail-transfer-agent.target \
102 units/poweroff.target \
103 units/reboot.target \
104 units/remote-fs.target \
105 units/rescue.target \
106 units/rpcbind.target \
107 units/rtc-set.target \
108 units/shutdown.target \
109 units/sigpwr.target \
110 units/sockets.target \
112 units/systemd-initctl.socket \
113 units/systemd-logger.socket \
114 units/dev-hugepages.automount \
115 units/dev-hugepages.mount \
116 units/dev-mqueue.automount \
117 units/dev-mqueue.mount \
118 units/proc-sys-fs-binfmt_misc.automount \
119 units/proc-sys-fs-binfmt_misc.mount \
120 units/sys-kernel-debug.automount \
121 units/sys-kernel-debug.mount \
122 units/sys-kernel-security.automount \
123 units/sys-kernel-security.mount \
124 units/var-lock.mount \
128 units/sysinit.target \
129 units/getty@.service \
130 units/graphical.target \
131 units/multi-user.target \
132 units/systemd-initctl.service \
133 units/systemd-logger.service \
136 dist_sessionunit_DATA = \
137 units/session/default.target
140 units/session/remote-fs.target \
141 units/session/exit.service
144 units/sysinit.target.m4 \
145 units/getty@.service.m4 \
146 units/graphical.target.m4 \
147 units/multi-user.target.m4 \
148 units/remote-fs.target.m4 \
149 units/systemd-initctl.service.in \
150 units/systemd-logger.service.in \
151 units/syslog.target.in \
152 units/session/exit.service.in \
158 dist_systemunit_DATA += \
159 units/fedora/halt.service \
160 units/fedora/killall.service \
161 units/fedora/poweroff.service \
162 units/fedora/prefdm.service \
163 units/fedora/rc-local.service \
164 units/fedora/reboot.service \
165 units/fedora/sysinit.service
169 dist_systemunit_DATA += \
170 units/suse/halt.service \
171 units/suse/poweroff.service \
172 units/suse/reboot.service
176 dist_systemunit_DATA += \
177 units/gentoo/halt.service \
178 units/gentoo/killall.service \
179 units/gentoo/poweroff.service \
180 units/gentoo/reboot.service \
181 units/gentoo/xdm.service
184 # This is needed because automake is buggy in how it generates the
185 # rules for C programs, but not Vala programs. We therefore can't
186 # list the .h files as dependencies if we want make dist to work.
202 src/load-fragment.c \
224 src/dbus-automount.c \
226 src/dbus-snapshot.c \
232 src/hostname-setup.c \
233 src/loopback-setup.c \
242 ${COMMON_SOURCES:.c=.h} \
248 src/linux/auto_dev-ioctl.h \
254 man/systemd.service.5
257 man/systemd.special.7
260 man/systemd.unit.html \
261 man/systemd.service.html
263 nodist_noinst_DATA = \
264 man/systemd.special.html
267 man/systemd.unit.xml \
268 man/systemd.service.xml \
269 man/systemd.special.xml.in \
270 man/systemd.special.7.in \
271 man/systemd.special.html.in
288 test_engine_SOURCES = \
292 test_engine_CPPFLAGS = $(systemd_CPPFLAGS)
293 test_engine_LDADD = $(systemd_LDADD)
295 test_job_type_SOURCES = \
299 test_job_type_CPPFLAGS = $(systemd_CPPFLAGS)
300 test_job_type_LDADD = $(systemd_LDADD)
307 test_ns_CPPFLAGS = $(systemd_CPPFLAGS)
308 test_ns_LDADD = $(systemd_LDADD)
310 test_loopback_SOURCES = \
312 src/test-loopback.c \
315 test_loopback_CPPFLAGS = $(systemd_CPPFLAGS)
316 test_loopback_LDADD = $(systemd_LDADD)
318 systemd_logger_SOURCES = \
323 systemd_initctl_SOURCES = \
328 systemd_initctl_CPPFLAGS = \
332 systemd_initctl_LDADD = \
335 systemd_cgroups_agent_SOURCES = \
339 systemd_cgroups_agent_CPPFLAGS = \
343 systemd_cgroups_agent_LDADD = \
358 -Wno-unused-variable \
361 systemctl_SOURCES = \
363 src/systemd-interfaces.vala
365 systemctl_CPPFLAGS = $(AM_CPPFLAGS) $(DBUSGLIB_CFLAGS) $(VALA_CFLAGS)
366 systemctl_LDADD = $(DBUSGLIB_LIBS)
368 systemadm_SOURCES = \
370 src/systemd-interfaces.vala
372 systemadm_CPPFLAGS = $(AM_CPPFLAGS) $(DBUSGLIB_CFLAGS) $(GTK_CFLAGS) $(VALA_CFLAGS)
373 systemadm_LDADD = $(DBUSGLIB_LIBS) $(GTK_LIBS)
376 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
377 $(SED) -e 's,@rootlibexecdir\@,$(rootlibexecdir),g' \
378 -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
379 -e 's,@SPECIAL_DBUS_SERVICE\@,$(SPECIAL_DBUS_SERVICE),g' \
380 -e 's,@SYSTEMCTL\@,$(rootbindir)/systemctl,g' \
383 units/%: units/%.in Makefile
386 man/%: man/%.in Makefile
389 M4_PROCESS_SYSTEM = \
390 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
391 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@
393 M4_PROCESS_SESSION = \
394 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
395 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@
397 units/%: units/%.m4 Makefile
400 units/session/%: units/%.m4 Makefile
401 $(M4_PROCESS_SESSION)
404 units/systemd-initctl.service \
405 units/systemd-logger.service \
406 units/syslog.target \
407 units/sysinit.target \
408 units/getty@.service \
409 units/graphical.target \
410 units/multi-user.target \
411 units/remote-fs.target \
412 units/session/remote-fs.target \
413 units/session/exit.service \
414 man/systemd.special.7 \
415 man/systemd.special.html
419 src/systemd-interfaces.c \
425 XSLTPROC_PROCESS_MAN = \
426 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
427 $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
429 XSLTPROC_PROCESS_MAN_IN = \
430 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
431 $(XSLTPROC) -o ${@:.in=} -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
434 XSLTPROC_PROCESS_HTML = \
435 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
436 $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
438 XSLTPROC_PROCESS_HTML_IN = \
439 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
440 $(XSLTPROC) -o ${@:.in=} -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $< && \
444 $(XSLTPROC_PROCESS_MAN)
446 man/%.5.in: man/%.xml.in
447 $(XSLTPROC_PROCESS_MAN)
450 $(XSLTPROC_PROCESS_MAN)
452 man/%.7.in: man/%.xml.in
453 $(XSLTPROC_PROCESS_MAN_IN)
455 man/%.html: man/%.xml
456 $(XSLTPROC_PROCESS_HTML)
458 man/%.html.in: man/%.xml.in
459 $(XSLTPROC_PROCESS_HTML_IN)
463 man/systemd.special.7.in \
464 man/systemd.unit.html \
465 man/systemd.service.html \
466 man/systemd.special.html.in
469 org.freedesktop.systemd1.%.xml: systemd
470 $(AM_V_GEN)./systemd --introspect=${@:.xml=} > $@
472 CLEANFILES += $(dbusinterface_DATA)
476 $(DESTDIR)$(systemunitdir) \
477 $(DESTDIR)$(sessionunitdir) \
478 $(DESTDIR)$(systemunitdir)/sockets.target.wants \
479 $(DESTDIR)$(systemunitdir)/sysinit.target.wants \
480 $(DESTDIR)$(pkgsysconfdir)/system \
481 $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
482 $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
483 $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
484 $(DESTDIR)$(pkgsysconfdir)/session \
485 $(DESTDIR)$(sysconfdir)/xdg/systemd
486 $(MKDIR_P) -m 0755 $(DESTDIR)/cgroup/systemd || \
487 echo "Don't forget to create /cgroup/systemd! Couldn't create it for you, continuing anyway."
488 ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
490 $(LN_S) $(pkgsysconfdir)/session session )
491 ( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
492 rm -f systemd-initctl.socket systemd-logger.socket && \
493 $(LN_S) ../systemd-logger.socket systemd-logger.socket && \
494 $(LN_S) ../systemd-initctl.socket systemd-initctl.socket )
495 ( cd $(DESTDIR)$(sessionunitdir) && \
496 rm -f shutdown.target sockets.target local-fs.target swap.target && \
497 $(LN_S) $(systemunitdir)/shutdown.target shutdown.target && \
498 $(LN_S) $(systemunitdir)/sockets.target sockets.target && \
499 $(LN_S) $(systemunitdir)/local-fs.target local-fs.target && \
500 $(LN_S) $(systemunitdir)/swap.target swap.target )
501 ( cd $(DESTDIR)$(systemunitdir) && \
502 rm -f runlevel0.target runlevel1.target runlevel6.target && \
503 $(LN_S) poweroff.target runlevel0.target && \
504 $(LN_S) rescue.target runlevel1.target && \
505 $(LN_S) reboot.target runlevel6.target )
506 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
507 rm -f default.target ctrl-alt-del.target kbrequest.target && \
508 $(LN_S) $(systemunitdir)/graphical.target default.target && \
509 $(LN_S) $(systemunitdir)/reboot.target ctrl-alt-del.target && \
510 $(LN_S) $(systemunitdir)/rescue.target kbrequest.target && \
511 rm -f runlevel2.target runlevel3.target runlevel4.target runlevel5.target && \
512 $(LN_S) $(systemunitdir)/multi-user.target runlevel2.target && \
513 $(LN_S) $(systemunitdir)/multi-user.target runlevel3.target && \
514 $(LN_S) $(systemunitdir)/multi-user.target runlevel4.target && \
515 $(LN_S) $(systemunitdir)/graphical.target runlevel5.target )
516 ( cd $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants && \
517 rm -f getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service && \
518 $(LN_S) $(systemunitdir)/getty@.service getty@tty1.service && \
519 $(LN_S) $(systemunitdir)/getty@.service getty@tty2.service && \
520 $(LN_S) $(systemunitdir)/getty@.service getty@tty3.service && \
521 $(LN_S) $(systemunitdir)/getty@.service getty@tty4.service && \
522 $(LN_S) $(systemunitdir)/getty@.service getty@tty5.service && \
523 $(LN_S) $(systemunitdir)/getty@.service getty@tty6.service )
524 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
525 rm -f getty.target remote-fs.target && \
526 $(LN_S) $(systemunitdir)/getty.target getty.target && \
527 $(LN_S) $(systemunitdir)/remote-fs.target remote-fs.target )
528 ( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
529 rm -f dev-hugepages.automount \
530 dev-mqueue.automount \
531 proc-sys-fs-binfmt_misc.automount \
532 sys-kernel-debug.automount \
533 sys-kernel-security.automount && \
534 $(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
535 $(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
536 $(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
537 $(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount && \
538 $(LN_S) ../sys-kernel-security.automount sys-kernel-security.automount )
539 ( cd $(DESTDIR)$(dbussessionservicedir) && \
540 rm -f org.freedesktop.systemd1.service && \
541 $(LN_S) ../system-services/org.freedesktop.systemd1.service org.freedesktop.systemd1.service )
543 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
544 rm -f display-manager.service && \
545 $(LN_S) $(systemunitdir)/prefdm.service display-manager.service )
546 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
547 rm -f display-manager.service && \
548 $(LN_S) ../display-manager.service display-manager.service )
549 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
550 rm -f rc-local.service && \
551 $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
552 ( cd $(DESTDIR)$(systemunitdir) && \
553 rm -f local.service && \
554 $(LN_S) rc-local.service local.service )
555 ( cd $(DESTDIR)/etc/init.d && \
556 $(LN_S) halt reboot > /dev/null 2>&1 || true )
559 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
560 rm -f display-manager.service && \
561 $(LN_S) $(systemunitdir)/xdm.service display-manager.service )
562 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
563 rm -f display-manager.service && \
564 $(LN_S) ../display-manager.service display-manager.service )
567 DISTCHECK_CONFIGURE_FLAGS = \
568 --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
569 --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
570 --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
571 --with-dbusinterfacedir=$$dc_install_base/$(dbusinterfacedir) \
572 --with-udevrulesdir=$$dc_install_base/$(udevrulesdir) \
573 --with-rootdir=$$dc_install_base/$(rootdir)