chiark / gitweb /
execute: only reset those signals to the default we really need to reset to the default
[elogind.git] / Makefile.am
1 #  This file is part of systemd.
2 #
3 #  Copyright 2010 Lennart Poettering
4 #
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.
9 #
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.
14 #
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/>.
17
18 ACLOCAL_AMFLAGS = -I m4
19
20 dbuspolicydir=$(sysconfdir)/dbus-1/system.d
21 udevrulesdir=@udevrulesdir@
22
23 pkgsysconfdir=$(sysconfdir)/systemd
24 systemunitdir=$(pkgdatadir)/system
25 sessionunitdir=$(pkgdatadir)/session
26
27 AM_CPPFLAGS = \
28         -include $(top_builddir)/config.h \
29         -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
30         -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
31         -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
32         -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
33         -DSESSION_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/session\" \
34         -DSESSION_DATA_UNIT_PATH=\"$(sessionunitdir)\" \
35         -DCGROUP_AGENT_PATH=\"$(pkglibexecdir)/systemd-cgroups-agent\" \
36         -DSYSTEMD_BINARY_PATH=\"$(sbindir)/systemd\" \
37         -I $(top_srcdir)/src
38
39 sbin_PROGRAMS = \
40         systemd
41
42 bin_PROGRAMS = \
43         systemctl
44
45 if HAVE_GTK
46 bin_PROGRAMS += \
47         systemadm
48 endif
49
50 pkglibexec_PROGRAMS = \
51         systemd-logger \
52         systemd-cgroups-agent \
53         systemd-initctl
54
55 noinst_PROGRAMS = \
56         test-engine \
57         test-job-type \
58         test-ns \
59         test-loopback
60
61 dist_dbuspolicy_DATA = \
62         src/org.freedesktop.systemd1.conf
63
64 dist_udevrules_DATA = \
65         src/99-systemd.rules
66
67 dist_systemunit_DATA = \
68         units/emergency.service \
69         units/getty.target \
70         units/halt.target \
71         units/local-fs.target \
72         units/network.target \
73         units/nss-lookup.target \
74         units/poweroff.target \
75         units/reboot.target \
76         units/remote-fs.target \
77         units/rescue.target \
78         units/rpcbind.target \
79         units/rtc-set.target \
80         units/shutdown.target \
81         units/sigpwr.target \
82         units/sockets.target \
83         units/swap.target \
84         units/systemd-initctl.socket \
85         units/systemd-logger.socket \
86         units/dev-hugepages.automount \
87         units/dev-hugepages.mount \
88         units/dev-mqueue.automount \
89         units/dev-mqueue.mount \
90         units/proc-sys-fs-binfmt_misc.automount \
91         units/proc-sys-fs-binfmt_misc.mount \
92         units/sys-kernel-debug.automount \
93         units/sys-kernel-debug.mount \
94         units/var-run.mount
95
96 systemunit_DATA = \
97         units/basic.target \
98         units/getty@.service \
99         units/graphical.target \
100         units/multi-user.target \
101         units/systemd-initctl.service \
102         units/systemd-logger.service \
103         units/syslog.target
104
105 dist_sessionunit_DATA = \
106         units/session/default.target
107
108 sessionunit_DATA = \
109         units/session/remote-fs.target
110
111 EXTRA_DIST = \
112         units/basic.target.m4 \
113         units/getty@.service.m4 \
114         units/graphical.target.m4 \
115         units/multi-user.target.m4 \
116         units/remote-fs.target.m4 \
117         units/systemd-initctl.service.in \
118         units/systemd-logger.service.in \
119         units/syslog.target.in \
120         LICENSE \
121         README \
122         DISTRO_PORTING
123
124 if TARGET_FEDORA
125 dist_systemunit_DATA += \
126         units/fedora/halt.service \
127         units/fedora/killall.service \
128         units/fedora/poweroff.service \
129         units/fedora/prefdm.service \
130         units/fedora/rc-local.service \
131         units/fedora/reboot.service \
132         units/fedora/sysinit.service
133 endif
134
135 if TARGET_GENTOO
136 dist_systemunit_DATA += \
137         units/gentoo/halt.service \
138         units/gentoo/killall.service \
139         units/gentoo/poweroff.service \
140         units/gentoo/reboot.service \
141         units/gentoo/xdm.service
142 endif
143
144 # This is needed because automake is buggy in how it generates the
145 # rules for C programs, but not Vala programs.  We therefore can't
146 # list the .h files as dependencies if we want make dist to work.
147 BASIC_SOURCES = \
148         src/util.c \
149         src/hashmap.c \
150         src/set.c \
151         src/strv.c \
152         src/conf-parser.c \
153         src/socket-util.c \
154         src/log.c \
155         src/ratelimit.c
156
157 COMMON_SOURCES = \
158         $(BASIC_SOURCES) \
159         src/unit.c \
160         src/job.c \
161         src/manager.c \
162         src/load-fragment.c \
163         src/service.c \
164         src/automount.c \
165         src/mount.c \
166         src/swap.c \
167         src/device.c \
168         src/target.c \
169         src/snapshot.c \
170         src/socket.c \
171         src/timer.c \
172         src/load-dropin.c \
173         src/execute.c \
174         src/dbus.c \
175         src/dbus-manager.c \
176         src/dbus-unit.c \
177         src/dbus-job.c \
178         src/dbus-service.c \
179         src/dbus-socket.c \
180         src/dbus-target.c \
181         src/dbus-mount.c \
182         src/dbus-automount.c \
183         src/dbus-swap.c \
184         src/dbus-snapshot.c \
185         src/dbus-device.c \
186         src/dbus-execute.c \
187         src/cgroup.c \
188         src/mount-setup.c \
189         src/hostname-setup.c \
190         src/loopback-setup.c \
191         src/kmod-setup.c \
192         src/utmp-wtmp.c \
193         src/specifier.c \
194         src/unit-name.c \
195         src/fdset.c \
196         src/namespace.c
197
198 EXTRA_DIST += \
199         ${COMMON_SOURCES:.c=.h} \
200         src/macro.h \
201         src/ioprio.h \
202         src/missing.h \
203         src/list.h \
204         src/securebits.h \
205         src/linux/auto_dev-ioctl.h \
206         src/initreq.h \
207         src/sd-daemon.h
208
209 dist_man_MANS = \
210         man/systemd.unit.5 \
211         man/systemd.service.5
212
213 nodist_man_MANS = \
214         man/systemd.special.7
215
216 dist_noinst_DATA = \
217         man/systemd.unit.html \
218         man/systemd.service.html
219
220 nodist_noinst_DATA = \
221         man/systemd.special.html
222
223 EXTRA_DIST += \
224         man/systemd.unit.xml \
225         man/systemd.service.xml \
226         man/systemd.special.xml.in \
227         man/systemd.special.7.in \
228         man/systemd.special.html.in
229
230 systemd_SOURCES = \
231         $(COMMON_SOURCES) \
232         src/main.c
233
234 systemd_CPPFLAGS = \
235         $(AM_CPPFLAGS) \
236         $(DBUS_CFLAGS) \
237         $(UDEV_CFLAGS) \
238         $(CGROUP_CFLAGS)
239
240 systemd_LDADD = \
241         $(DBUS_LIBS) \
242         $(UDEV_LIBS) \
243         $(CGROUP_LIBS)
244
245 test_engine_SOURCES = \
246         $(COMMON_SOURCES) \
247         src/test-engine.c
248
249 test_engine_CPPFLAGS = $(systemd_CPPFLAGS)
250 test_engine_LDADD = $(systemd_LDADD)
251
252 test_job_type_SOURCES = \
253         $(COMMON_SOURCES) \
254         src/test-engine.c
255
256 test_job_type_CPPFLAGS = $(systemd_CPPFLAGS)
257 test_job_type_LDADD = $(systemd_LDADD)
258
259 test_ns_SOURCES = \
260         $(BASIC_SOURCES) \
261         src/test-ns.c \
262         src/namespace.c
263
264 test_ns_CPPFLAGS = $(systemd_CPPFLAGS)
265 test_ns_LDADD = $(systemd_LDADD)
266
267 test_loopback_SOURCES = \
268         $(BASIC_SOURCES) \
269         src/test-loopback.c \
270         src/loopback-setup.c
271
272 test_loopback_CPPFLAGS = $(systemd_CPPFLAGS)
273 test_loopback_LDADD = $(systemd_LDADD)
274
275 systemd_logger_SOURCES = \
276         $(BASIC_SOURCES) \
277         src/logger.c \
278         src/sd-daemon.c
279
280 systemd_initctl_SOURCES = \
281         $(BASIC_SOURCES) \
282         src/initctl.c \
283         src/sd-daemon.c
284
285 systemd_initctl_CPPFLAGS = \
286         $(AM_CPPFLAGS) \
287         $(DBUS_CFLAGS)
288
289 systemd_initctl_LDADD = \
290         $(DBUS_LIBS)
291
292 systemd_cgroups_agent_SOURCES = \
293         $(BASIC_SOURCES) \
294         src/cgroups-agent.c
295
296 systemd_cgroups_agent_CPPFLAGS = \
297         $(AM_CPPFLAGS) \
298         $(DBUS_CFLAGS)
299
300 systemd_cgroups_agent_LDADD = \
301         $(DBUS_LIBS)
302
303 VALAFLAGS = \
304         -g \
305         --save-temps \
306         --pkg=dbus-glib-1 \
307         --pkg=posix
308
309 if HAVE_GTK
310 VALAFLAGS += \
311         --pkg=gtk+-2.0
312 endif
313
314 VALA_CFLAGS = \
315         -Wno-unused-variable \
316         -Wno-unused-function
317
318 systemctl_SOURCES = \
319         src/systemctl.vala \
320         src/systemd-interfaces.vala
321
322 systemctl_CPPFLAGS = $(AM_CPPFLAGS) $(DBUSGLIB_CFLAGS) $(VALA_CFLAGS)
323 systemctl_LDADD = $(DBUSGLIB_LIBS)
324
325 systemadm_SOURCES = \
326         src/systemadm.vala \
327         src/systemd-interfaces.vala
328
329 systemadm_CPPFLAGS = $(AM_CPPFLAGS) $(DBUSGLIB_CFLAGS) $(GTK_CFLAGS) $(VALA_CFLAGS)
330 systemadm_LDADD = $(DBUSGLIB_LIBS) $(GTK_LIBS)
331
332 SED_PROCESS = \
333         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
334         $(SED)  -e 's,@libexecdir\@,$(libexecdir),g' \
335                 -e 's,@pkglibexecdir\@,$(pkglibexecdir),g' \
336                 -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
337                 < $< > $@
338
339 units/%: units/%.in Makefile
340         $(SED_PROCESS)
341
342 man/%: man/%.in Makefile
343         $(SED_PROCESS)
344
345 M4_PROCESS_SYSTEM = \
346         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
347         $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@
348
349 M4_PROCESS_SESSION = \
350         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
351         $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@
352
353 units/%: units/%.m4 Makefile
354         $(M4_PROCESS_SYSTEM)
355
356 units/session/%: units/%.m4 Makefile
357         $(M4_PROCESS_SESSION)
358
359 CLEANFILES = \
360         units/systemd-initctl.service \
361         units/systemd-logger.service \
362         units/syslog.target \
363         units/basic.target \
364         units/getty@.service \
365         units/graphical.target \
366         units/multi-user.target \
367         units/remote-fs.target \
368         units/session/remote-fs.target \
369         man/systemd.special.7 \
370         man/systemd.special.html
371
372 if HAVE_VALAC
373 CLEANFILES += \
374         src/systemd-interfaces.c \
375         src/systemctl.c \
376         src/systemadm.c
377 endif
378
379 if HAVE_XSLTPROC
380 XSLTPROC_PROCESS_MAN = \
381         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
382         $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
383
384 XSLTPROC_PROCESS_MAN_IN = \
385         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
386         $(XSLTPROC) -o ${@:.in=} -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
387         mv ${@:.in=} $@
388
389 XSLTPROC_PROCESS_HTML = \
390         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
391         $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
392
393 XSLTPROC_PROCESS_HTML_IN = \
394         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
395         $(XSLTPROC) -o ${@:.in=} -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $< && \
396         mv ${@:.in=} $@
397
398 man/%.5: man/%.xml
399         $(XSLTPROC_PROCESS_MAN)
400
401 man/%.5.in: man/%.xml.in
402         $(XSLTPROC_PROCESS_MAN)
403
404 man/%.7: man/%.xml
405         $(XSLTPROC_PROCESS_MAN)
406
407 man/%.7.in: man/%.xml.in
408         $(XSLTPROC_PROCESS_MAN_IN)
409
410 man/%.html: man/%.xml
411         $(XSLTPROC_PROCESS_HTML)
412
413 man/%.html.in: man/%.xml.in
414         $(XSLTPROC_PROCESS_HTML_IN)
415
416 CLEANFILES += \
417         $(dist_man_MANS) \
418         man/systemd.special.7.in \
419         man/systemd.unit.html \
420         man/systemd.service.html \
421         man/systemd.special.html.in
422 endif
423
424 install-data-hook:
425         $(MKDIR_P) -m 0755 \
426                 $(DESTDIR)$(systemunitdir) \
427                 $(DESTDIR)$(sessionunitdir) \
428                 $(DESTDIR)$(systemunitdir)/sockets.target.wants \
429                 $(DESTDIR)$(systemunitdir)/basic.target.wants \
430                 $(DESTDIR)$(pkgsysconfdir)/system \
431                 $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
432                 $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
433                 $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
434                 $(DESTDIR)$(pkgsysconfdir)/session \
435                 $(DESTDIR)$(sysconfdir)/xdg/systemd
436         $(MKDIR_P) -m 0755 $(DESTDIR)/cgroup/systemd || \
437                 echo "Don't forget to create /cgroup/systemd! Couldn't create it for you, continuing anyway."
438         ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
439                 rm -f session && \
440                 $(LN_S) $(pkgsysconfdir)/session session )
441         ( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
442                 rm -f systemd-initctl.socket systemd-logger.socket && \
443                 $(LN_S) ../systemd-logger.socket systemd-logger.socket && \
444                 $(LN_S) ../systemd-initctl.socket systemd-initctl.socket )
445         ( cd $(DESTDIR)$(sessionunitdir) && \
446                 rm -f shutdown.target sockets.target local-fs.target swap.target && \
447                 $(LN_S) ../system/shutdown.target shutdown.target && \
448                 $(LN_S) ../system/sockets.target sockets.target && \
449                 $(LN_S) ../system/local-fs.target local-fs.target && \
450                 $(LN_S) ../system/swap.target swap.target )
451         ( cd $(DESTDIR)$(systemunitdir) && \
452                 rm -f runlevel0.target runlevel1.target runlevel6.target && \
453                 $(LN_S) poweroff.target runlevel0.target && \
454                 $(LN_S) rescue.target runlevel1.target && \
455                 $(LN_S) reboot.target runlevel6.target )
456         ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
457                 rm -f default.target ctrl-alt-del.target kbrequest.target && \
458                 $(LN_S) $(systemunitdir)/graphical.target default.target && \
459                 $(LN_S) $(systemunitdir)/reboot.target ctrl-alt-del.target && \
460                 $(LN_S) $(systemunitdir)/rescue.target kbrequest.target && \
461                 rm -f runlevel2.target runlevel3.target runlevel4.target runlevel5.target && \
462                 $(LN_S) $(systemunitdir)/multi-user.target runlevel2.target && \
463                 $(LN_S) $(systemunitdir)/multi-user.target runlevel3.target && \
464                 $(LN_S) $(systemunitdir)/multi-user.target runlevel4.target && \
465                 $(LN_S) $(systemunitdir)/graphical.target runlevel5.target )
466         ( cd $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants && \
467                 rm -f getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service && \
468                 $(LN_S) $(systemunitdir)/getty@.service getty@tty1.service && \
469                 $(LN_S) $(systemunitdir)/getty@.service getty@tty2.service && \
470                 $(LN_S) $(systemunitdir)/getty@.service getty@tty3.service && \
471                 $(LN_S) $(systemunitdir)/getty@.service getty@tty4.service && \
472                 $(LN_S) $(systemunitdir)/getty@.service getty@tty5.service && \
473                 $(LN_S) $(systemunitdir)/getty@.service getty@tty6.service )
474         ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
475                 rm -f getty.target && \
476                 $(LN_S) $(systemunitdir)/getty.target getty.target )
477         ( cd $(DESTDIR)$(systemunitdir)/basic.target.wants && \
478                 rm -f dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount && \
479                 $(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
480                 $(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
481                 $(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
482                 $(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount )
483 if TARGET_FEDORA
484         ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
485                 rm -f prefdm.service && \
486                 $(LN_S) $(systemunitdir)/prefdm.service prefdm.service )
487         ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
488                 rm -f rc-local.service && \
489                 $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
490         ( cd $(DESTDIR)$(systemunitdir) && \
491                 rm -f local.service && \
492                 $(LN_S) rc-local.service local.service )
493         ( cd $(DESTDIR)/etc/init.d && \
494                 $(LN_S) halt reboot > /dev/null 2>&1 || true )
495 endif
496
497 DISTCHECK_CONFIGURE_FLAGS = \
498         --with-udevrulesdir=$$dc_install_base/$(udevrulesdir)