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=$(sysconfdir)/dbus-1/system.d
22 udevrulesdir=@udevrulesdir@
23 interfacedir=$(datadir)/dbus-1/interfaces
25 # Our own, non-special dirs
26 pkgsysconfdir=$(sysconfdir)/systemd
27 sessionunitdir=$(pkgdatadir)/session
29 # And these are the special ones for /
31 rootsbindir=$(rootdir)/sbin
32 rootbindir=$(rootdir)/bin
33 rootlibexecdir=$(rootdir)/lib/systemd
34 systemunitdir=$(rootdir)/lib/systemd/system
37 -include $(top_builddir)/config.h \
38 -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
39 -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
40 -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
41 -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
42 -DSESSION_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/session\" \
43 -DSESSION_DATA_UNIT_PATH=\"$(sessionunitdir)\" \
44 -DCGROUP_AGENT_PATH=\"$(rootlibexecdir)/systemd-cgroups-agent\" \
45 -DSYSTEMD_BINARY_PATH=\"$(rootsbindir)/systemd\" \
59 rootlibexec_PROGRAMS = \
61 systemd-cgroups-agent \
70 dist_dbuspolicy_DATA = \
71 src/org.freedesktop.systemd1.conf
73 dist_udevrules_DATA = \
77 org.freedesktop.systemd1.Manager.xml \
78 org.freedesktop.systemd1.Job.xml \
79 org.freedesktop.systemd1.Unit.xml \
80 org.freedesktop.systemd1.Service.xml \
81 org.freedesktop.systemd1.Socket.xml \
82 org.freedesktop.systemd1.Timer.xml \
83 org.freedesktop.systemd1.Target.xml \
84 org.freedesktop.systemd1.Device.xml \
85 org.freedesktop.systemd1.Mount.xml \
86 org.freedesktop.systemd1.Automount.xml \
87 org.freedesktop.systemd1.Snapshot.xml \
88 org.freedesktop.systemd1.Swap.xml \
89 org.freedesktop.systemd1.Path.xml
91 dist_systemunit_DATA = \
92 units/emergency.service \
95 units/local-fs.target \
96 units/network.target \
97 units/nss-lookup.target \
98 units/mail-transfer-agent.target \
99 units/poweroff.target \
100 units/reboot.target \
101 units/remote-fs.target \
102 units/rescue.target \
103 units/rpcbind.target \
104 units/rtc-set.target \
105 units/shutdown.target \
106 units/sigpwr.target \
107 units/sockets.target \
109 units/systemd-initctl.socket \
110 units/systemd-logger.socket \
111 units/dev-hugepages.automount \
112 units/dev-hugepages.mount \
113 units/dev-mqueue.automount \
114 units/dev-mqueue.mount \
115 units/proc-sys-fs-binfmt_misc.automount \
116 units/proc-sys-fs-binfmt_misc.mount \
117 units/sys-kernel-debug.automount \
118 units/sys-kernel-debug.mount \
119 units/sys-kernel-security.automount \
120 units/sys-kernel-security.mount \
121 units/var-lock.mount \
126 units/getty@.service \
127 units/graphical.target \
128 units/multi-user.target \
129 units/systemd-initctl.service \
130 units/systemd-logger.service \
133 dist_sessionunit_DATA = \
134 units/session/default.target
137 units/session/remote-fs.target \
138 units/session/exit.service
141 units/basic.target.m4 \
142 units/getty@.service.m4 \
143 units/graphical.target.m4 \
144 units/multi-user.target.m4 \
145 units/remote-fs.target.m4 \
146 units/systemd-initctl.service.in \
147 units/systemd-logger.service.in \
148 units/syslog.target.in \
149 units/session/exit.service.in \
155 dist_systemunit_DATA += \
156 units/fedora/halt.service \
157 units/fedora/killall.service \
158 units/fedora/poweroff.service \
159 units/fedora/prefdm.service \
160 units/fedora/rc-local.service \
161 units/fedora/reboot.service \
162 units/fedora/sysinit.service
166 dist_systemunit_DATA += \
167 units/gentoo/halt.service \
168 units/gentoo/killall.service \
169 units/gentoo/poweroff.service \
170 units/gentoo/reboot.service \
171 units/gentoo/xdm.service
174 # This is needed because automake is buggy in how it generates the
175 # rules for C programs, but not Vala programs. We therefore can't
176 # list the .h files as dependencies if we want make dist to work.
192 src/load-fragment.c \
214 src/dbus-automount.c \
216 src/dbus-snapshot.c \
222 src/hostname-setup.c \
223 src/loopback-setup.c \
232 ${COMMON_SOURCES:.c=.h} \
238 src/linux/auto_dev-ioctl.h \
244 man/systemd.service.5
247 man/systemd.special.7
250 man/systemd.unit.html \
251 man/systemd.service.html
253 nodist_noinst_DATA = \
254 man/systemd.special.html
257 man/systemd.unit.xml \
258 man/systemd.service.xml \
259 man/systemd.special.xml.in \
260 man/systemd.special.7.in \
261 man/systemd.special.html.in
278 test_engine_SOURCES = \
282 test_engine_CPPFLAGS = $(systemd_CPPFLAGS)
283 test_engine_LDADD = $(systemd_LDADD)
285 test_job_type_SOURCES = \
289 test_job_type_CPPFLAGS = $(systemd_CPPFLAGS)
290 test_job_type_LDADD = $(systemd_LDADD)
297 test_ns_CPPFLAGS = $(systemd_CPPFLAGS)
298 test_ns_LDADD = $(systemd_LDADD)
300 test_loopback_SOURCES = \
302 src/test-loopback.c \
305 test_loopback_CPPFLAGS = $(systemd_CPPFLAGS)
306 test_loopback_LDADD = $(systemd_LDADD)
308 systemd_logger_SOURCES = \
313 systemd_initctl_SOURCES = \
318 systemd_initctl_CPPFLAGS = \
322 systemd_initctl_LDADD = \
325 systemd_cgroups_agent_SOURCES = \
329 systemd_cgroups_agent_CPPFLAGS = \
333 systemd_cgroups_agent_LDADD = \
348 -Wno-unused-variable \
351 systemctl_SOURCES = \
353 src/systemd-interfaces.vala
355 systemctl_CPPFLAGS = $(AM_CPPFLAGS) $(DBUSGLIB_CFLAGS) $(VALA_CFLAGS)
356 systemctl_LDADD = $(DBUSGLIB_LIBS)
358 systemadm_SOURCES = \
360 src/systemd-interfaces.vala
362 systemadm_CPPFLAGS = $(AM_CPPFLAGS) $(DBUSGLIB_CFLAGS) $(GTK_CFLAGS) $(VALA_CFLAGS)
363 systemadm_LDADD = $(DBUSGLIB_LIBS) $(GTK_LIBS)
366 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
367 $(SED) -e 's,@libexecdir\@,$(libexecdir),g' \
368 -e 's,@pkglibexecdir\@,$(pkglibexecdir),g' \
369 -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
370 -e 's,@SPECIAL_DBUS_SERVICE\@,$(SPECIAL_DBUS_SERVICE),g' \
371 -e 's,@SYSTEMCTL\@,$(bindir)/systemctl,g' \
374 units/%: units/%.in Makefile
377 man/%: man/%.in Makefile
380 M4_PROCESS_SYSTEM = \
381 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
382 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@
384 M4_PROCESS_SESSION = \
385 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
386 $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@
388 units/%: units/%.m4 Makefile
391 units/session/%: units/%.m4 Makefile
392 $(M4_PROCESS_SESSION)
395 units/systemd-initctl.service \
396 units/systemd-logger.service \
397 units/syslog.target \
399 units/getty@.service \
400 units/graphical.target \
401 units/multi-user.target \
402 units/remote-fs.target \
403 units/session/remote-fs.target \
404 units/session/exit.service \
405 man/systemd.special.7 \
406 man/systemd.special.html
410 src/systemd-interfaces.c \
416 XSLTPROC_PROCESS_MAN = \
417 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
418 $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
420 XSLTPROC_PROCESS_MAN_IN = \
421 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
422 $(XSLTPROC) -o ${@:.in=} -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
425 XSLTPROC_PROCESS_HTML = \
426 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
427 $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
429 XSLTPROC_PROCESS_HTML_IN = \
430 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
431 $(XSLTPROC) -o ${@:.in=} -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $< && \
435 $(XSLTPROC_PROCESS_MAN)
437 man/%.5.in: man/%.xml.in
438 $(XSLTPROC_PROCESS_MAN)
441 $(XSLTPROC_PROCESS_MAN)
443 man/%.7.in: man/%.xml.in
444 $(XSLTPROC_PROCESS_MAN_IN)
446 man/%.html: man/%.xml
447 $(XSLTPROC_PROCESS_HTML)
449 man/%.html.in: man/%.xml.in
450 $(XSLTPROC_PROCESS_HTML_IN)
454 man/systemd.special.7.in \
455 man/systemd.unit.html \
456 man/systemd.service.html \
457 man/systemd.special.html.in
460 org.freedesktop.systemd1.%.xml: systemd
461 $(AM_V_GEN)./systemd --introspect=${@:.xml=} > $@
463 CLEANFILES += $(interface_DATA)
467 $(DESTDIR)$(systemunitdir) \
468 $(DESTDIR)$(sessionunitdir) \
469 $(DESTDIR)$(systemunitdir)/sockets.target.wants \
470 $(DESTDIR)$(systemunitdir)/basic.target.wants \
471 $(DESTDIR)$(pkgsysconfdir)/system \
472 $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
473 $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
474 $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
475 $(DESTDIR)$(pkgsysconfdir)/session \
476 $(DESTDIR)$(sysconfdir)/xdg/systemd
477 $(MKDIR_P) -m 0755 $(DESTDIR)/cgroup/systemd || \
478 echo "Don't forget to create /cgroup/systemd! Couldn't create it for you, continuing anyway."
479 ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
481 $(LN_S) $(pkgsysconfdir)/session session )
482 ( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
483 rm -f systemd-initctl.socket systemd-logger.socket && \
484 $(LN_S) ../systemd-logger.socket systemd-logger.socket && \
485 $(LN_S) ../systemd-initctl.socket systemd-initctl.socket )
486 ( cd $(DESTDIR)$(sessionunitdir) && \
487 rm -f shutdown.target sockets.target local-fs.target swap.target && \
488 $(LN_S) $(systemunitdir)/shutdown.target shutdown.target && \
489 $(LN_S) $(systemunitdir)/sockets.target sockets.target && \
490 $(LN_S) $(systemunitdir)/local-fs.target local-fs.target && \
491 $(LN_S) $(systemunitdir)/swap.target swap.target )
492 ( cd $(DESTDIR)$(systemunitdir) && \
493 rm -f runlevel0.target runlevel1.target runlevel6.target && \
494 $(LN_S) poweroff.target runlevel0.target && \
495 $(LN_S) rescue.target runlevel1.target && \
496 $(LN_S) reboot.target runlevel6.target )
497 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
498 rm -f default.target ctrl-alt-del.target kbrequest.target && \
499 $(LN_S) $(systemunitdir)/graphical.target default.target && \
500 $(LN_S) $(systemunitdir)/reboot.target ctrl-alt-del.target && \
501 $(LN_S) $(systemunitdir)/rescue.target kbrequest.target && \
502 rm -f runlevel2.target runlevel3.target runlevel4.target runlevel5.target && \
503 $(LN_S) $(systemunitdir)/multi-user.target runlevel2.target && \
504 $(LN_S) $(systemunitdir)/multi-user.target runlevel3.target && \
505 $(LN_S) $(systemunitdir)/multi-user.target runlevel4.target && \
506 $(LN_S) $(systemunitdir)/graphical.target runlevel5.target )
507 ( cd $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants && \
508 rm -f getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service && \
509 $(LN_S) $(systemunitdir)/getty@.service getty@tty1.service && \
510 $(LN_S) $(systemunitdir)/getty@.service getty@tty2.service && \
511 $(LN_S) $(systemunitdir)/getty@.service getty@tty3.service && \
512 $(LN_S) $(systemunitdir)/getty@.service getty@tty4.service && \
513 $(LN_S) $(systemunitdir)/getty@.service getty@tty5.service && \
514 $(LN_S) $(systemunitdir)/getty@.service getty@tty6.service )
515 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
516 rm -f getty.target && \
517 $(LN_S) $(systemunitdir)/getty.target getty.target )
518 ( cd $(DESTDIR)$(systemunitdir)/basic.target.wants && \
519 rm -f dev-hugepages.automount \
520 dev-mqueue.automount \
521 proc-sys-fs-binfmt_misc.automount \
522 sys-kernel-debug.automount \
523 sys-kernel-security.automount && \
524 $(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
525 $(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
526 $(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
527 $(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount && \
528 $(LN_S) ../sys-kernel-security.automount sys-kernel-security.automount )
530 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
531 rm -f display-manager.service && \
532 $(LN_S) $(systemunitdir)/prefdm.service display-manager.service )
533 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
534 rm -f display-manager.service && \
535 $(LN_S) ../display-manager.service display-manager.service )
536 ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
537 rm -f rc-local.service && \
538 $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
539 ( cd $(DESTDIR)$(systemunitdir) && \
540 rm -f local.service && \
541 $(LN_S) rc-local.service local.service )
542 ( cd $(DESTDIR)/etc/init.d && \
543 $(LN_S) halt reboot > /dev/null 2>&1 || true )
546 ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
547 rm -f display-manager.service && \
548 $(LN_S) $(systemunitdir)/xdm.service display-manager.service )
549 ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
550 rm -f display-manager.service && \
551 $(LN_S) ../display-manager.service display-manager.service )
554 DISTCHECK_CONFIGURE_FLAGS = \
555 --with-udevrulesdir=$$dc_install_base/$(udevrulesdir) \
556 --with-rootdir=$$dc_install_base/$(rootdir)