chiark / gitweb /
shorten copyright header of configuration files
[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 sessionunit_DATA = \
106         units/session/remote-fs.target
107
108 EXTRA_DIST = \
109         units/basic.target.m4 \
110         units/getty@.service.m4 \
111         units/graphical.target.m4 \
112         units/multi-user.target.m4 \
113         units/remote-fs.target.m4 \
114         units/systemd-initctl.service.in \
115         units/systemd-logger.service.in \
116         units/syslog.target.in \
117         LICENSE \
118         README \
119         DISTRO_PORTING
120
121 if TARGET_FEDORA
122 dist_systemunit_DATA += \
123         units/fedora/halt.service \
124         units/fedora/killall.service \
125         units/fedora/poweroff.service \
126         units/fedora/prefdm.service \
127         units/fedora/rc-local.service \
128         units/fedora/reboot.service \
129         units/fedora/sysinit.service
130 endif
131
132 # This is needed because automake is buggy in how it generates the
133 # rules for C programs, but not Vala programs.  We therefore can't
134 # list the .h files as dependencies if we want make dist to work.
135 BASIC_SOURCES = \
136         src/util.c \
137         src/hashmap.c \
138         src/set.c \
139         src/strv.c \
140         src/conf-parser.c \
141         src/socket-util.c \
142         src/log.c \
143         src/ratelimit.c
144
145 COMMON_SOURCES = \
146         $(BASIC_SOURCES) \
147         src/unit.c \
148         src/job.c \
149         src/manager.c \
150         src/load-fragment.c \
151         src/service.c \
152         src/automount.c \
153         src/mount.c \
154         src/swap.c \
155         src/device.c \
156         src/target.c \
157         src/snapshot.c \
158         src/socket.c \
159         src/timer.c \
160         src/load-dropin.c \
161         src/execute.c \
162         src/dbus.c \
163         src/dbus-manager.c \
164         src/dbus-unit.c \
165         src/dbus-job.c \
166         src/dbus-service.c \
167         src/dbus-socket.c \
168         src/dbus-target.c \
169         src/dbus-mount.c \
170         src/dbus-automount.c \
171         src/dbus-swap.c \
172         src/dbus-snapshot.c \
173         src/dbus-device.c \
174         src/dbus-execute.c \
175         src/cgroup.c \
176         src/mount-setup.c \
177         src/hostname-setup.c \
178         src/loopback-setup.c \
179         src/utmp-wtmp.c \
180         src/specifier.c \
181         src/unit-name.c \
182         src/fdset.c \
183         src/namespace.c
184
185 EXTRA_DIST += \
186         ${COMMON_SOURCES:.c=.h} \
187         src/macro.h \
188         src/ioprio.h \
189         src/missing.h \
190         src/list.h \
191         src/securebits.h \
192         src/linux/auto_dev-ioctl.h \
193         src/initreq.h \
194         src/sd-daemon.h
195
196 dist_man_MANS = \
197         man/systemd.unit.5 \
198         man/systemd.service.5
199
200 nodist_man_MANS = \
201         man/systemd.special.7
202
203 dist_noinst_DATA = \
204         man/systemd.unit.html \
205         man/systemd.service.html
206
207 nodist_noinst_DATA = \
208         man/systemd.special.html
209
210 EXTRA_DIST += \
211         man/systemd.unit.xml \
212         man/systemd.service.xml \
213         man/systemd.special.xml.in \
214         man/systemd.special.7.in \
215         man/systemd.special.html.in
216
217 systemd_SOURCES = \
218         $(COMMON_SOURCES) \
219         src/main.c
220
221 systemd_CPPFLAGS = \
222         $(AM_CPPFLAGS) \
223         $(DBUS_CFLAGS) \
224         $(UDEV_CFLAGS) \
225         $(CGROUP_CFLAGS)
226
227 systemd_LDADD = \
228         $(DBUS_LIBS) \
229         $(UDEV_LIBS) \
230         $(CGROUP_LIBS)
231
232 test_engine_SOURCES = \
233         $(COMMON_SOURCES) \
234         src/test-engine.c
235
236 test_engine_CPPFLAGS = $(systemd_CPPFLAGS)
237 test_engine_LDADD = $(systemd_LDADD)
238
239 test_job_type_SOURCES = \
240         $(COMMON_SOURCES) \
241         src/test-engine.c
242
243 test_job_type_CPPFLAGS = $(systemd_CPPFLAGS)
244 test_job_type_LDADD = $(systemd_LDADD)
245
246 test_ns_SOURCES = \
247         $(BASIC_SOURCES) \
248         src/test-ns.c \
249         src/namespace.c
250
251 test_ns_CPPFLAGS = $(systemd_CPPFLAGS)
252 test_ns_LDADD = $(systemd_LDADD)
253
254 test_loopback_SOURCES = \
255         $(BASIC_SOURCES) \
256         src/test-loopback.c \
257         src/loopback-setup.c
258
259 test_loopback_CPPFLAGS = $(systemd_CPPFLAGS)
260 test_loopback_LDADD = $(systemd_LDADD)
261
262 systemd_logger_SOURCES = \
263         $(BASIC_SOURCES) \
264         src/logger.c \
265         src/sd-daemon.c
266
267 systemd_initctl_SOURCES = \
268         $(BASIC_SOURCES) \
269         src/initctl.c \
270         src/sd-daemon.c
271
272 systemd_initctl_CPPFLAGS = \
273         $(AM_CPPFLAGS) \
274         $(DBUS_CFLAGS)
275
276 systemd_initctl_LDADD = \
277         $(DBUS_LIBS)
278
279 systemd_cgroups_agent_SOURCES = \
280         $(BASIC_SOURCES) \
281         src/cgroups-agent.c
282
283 systemd_cgroups_agent_CPPFLAGS = \
284         $(AM_CPPFLAGS) \
285         $(DBUS_CFLAGS)
286
287 systemd_cgroups_agent_LDADD = \
288         $(DBUS_LIBS)
289
290 VALAFLAGS = \
291         -g \
292         --save-temps \
293         --pkg=dbus-glib-1 \
294         --pkg=posix
295
296 if HAVE_GTK
297 VALAFLAGS += \
298         --pkg=gtk+-2.0
299 endif
300
301 VALA_CFLAGS = \
302         -Wno-unused-variable \
303         -Wno-unused-function
304
305 systemctl_SOURCES = \
306         src/systemctl.vala \
307         src/systemd-interfaces.vala
308
309 systemctl_CPPFLAGS = $(AM_CPPFLAGS) $(DBUSGLIB_CFLAGS) $(VALA_CFLAGS)
310 systemctl_LDADD = $(DBUSGLIB_LIBS)
311
312 systemadm_SOURCES = \
313         src/systemadm.vala \
314         src/systemd-interfaces.vala
315
316 systemadm_CPPFLAGS = $(AM_CPPFLAGS) $(DBUSGLIB_CFLAGS) $(GTK_CFLAGS) $(VALA_CFLAGS)
317 systemadm_LDADD = $(DBUSGLIB_LIBS) $(GTK_LIBS)
318
319 SED_PROCESS = \
320         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
321         $(SED)  -e 's,@libexecdir\@,$(libexecdir),g' \
322                 -e 's,@pkglibexecdir\@,$(pkglibexecdir),g' \
323                 -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
324                 < $< > $@
325
326 units/%: units/%.in Makefile
327         $(SED_PROCESS)
328
329 man/%: man/%.in Makefile
330         $(SED_PROCESS)
331
332 M4_PROCESS_SYSTEM = \
333         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
334         $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@
335
336 M4_PROCESS_SESSION = \
337         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
338         $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SESSION=1 < $< > $@
339
340 units/%: units/%.m4 Makefile
341         $(M4_PROCESS_SYSTEM)
342
343 units/session/%: units/%.m4 Makefile
344         $(M4_PROCESS_SESSION)
345
346 CLEANFILES = \
347         units/systemd-initctl.service \
348         units/systemd-logger.service \
349         units/syslog.target \
350         units/basic.target \
351         units/getty@.service \
352         units/graphical.target \
353         units/multi-user.target \
354         units/remote-fs.target \
355         units/session/remote-fs.target \
356         man/systemd.special.7 \
357         man/systemd.special.html
358
359 if HAVE_VALAC
360 CLEANFILES += \
361         src/systemd-interfaces.c \
362         src/systemctl.c \
363         src/systemadm.c
364 endif
365
366 if HAVE_XSLTPROC
367 XSLTPROC_PROCESS_MAN = \
368         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
369         $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
370
371 XSLTPROC_PROCESS_MAN_IN = \
372         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
373         $(XSLTPROC) -o ${@:.in=} -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
374         mv ${@:.in=} $@
375
376 XSLTPROC_PROCESS_HTML = \
377         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
378         $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
379
380 XSLTPROC_PROCESS_HTML_IN = \
381         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
382         $(XSLTPROC) -o ${@:.in=} -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $< && \
383         mv ${@:.in=} $@
384
385 man/%.5: man/%.xml
386         $(XSLTPROC_PROCESS_MAN)
387
388 man/%.5.in: man/%.xml.in
389         $(XSLTPROC_PROCESS_MAN)
390
391 man/%.7: man/%.xml
392         $(XSLTPROC_PROCESS_MAN)
393
394 man/%.7.in: man/%.xml.in
395         $(XSLTPROC_PROCESS_MAN_IN)
396
397 man/%.html: man/%.xml
398         $(XSLTPROC_PROCESS_HTML)
399
400 man/%.html.in: man/%.xml.in
401         $(XSLTPROC_PROCESS_HTML_IN)
402
403 CLEANFILES += \
404         $(dist_man_MANS) \
405         man/systemd.special.7.in \
406         man/systemd.unit.html \
407         man/systemd.service.html \
408         man/systemd.special.html.in
409 endif
410
411 install-data-hook:
412         $(MKDIR_P) -m 0755 \
413                 $(DESTDIR)$(systemunitdir) \
414                 $(DESTDIR)$(sessionunitdir) \
415                 $(DESTDIR)$(systemunitdir)/sockets.target.wants \
416                 $(DESTDIR)$(systemunitdir)/basic.target.wants \
417                 $(DESTDIR)$(pkgsysconfdir)/system \
418                 $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
419                 $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
420                 $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
421                 $(DESTDIR)$(pkgsysconfdir)/session \
422                 $(DESTDIR)$(sysconfdir)/xdg/systemd
423         $(MKDIR_P) -m 0755 $(DESTDIR)/cgroup/systemd || \
424                 echo "Don't forget to create /cgroup/systemd! Couldn't create it for you, continuing anyway."
425         ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
426                 rm -f session && \
427                 $(LN_S) $(pkgsysconfdir)/session session )
428         ( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
429                 rm -f systemd-initctl.socket systemd-logger.socket && \
430                 $(LN_S) ../systemd-logger.socket systemd-logger.socket && \
431                 $(LN_S) ../systemd-initctl.socket systemd-initctl.socket )
432         ( cd $(DESTDIR)$(sessionunitdir) && \
433                 rm -f shutdown.target sockets.target local-fs.target swap.target && \
434                 $(LN_S) ../system/shutdown.target shutdown.target && \
435                 $(LN_S) ../system/sockets.target sockets.target && \
436                 $(LN_S) ../system/local-fs.target local-fs.target && \
437                 $(LN_S) ../system/swap.target swap.target )
438         ( cd $(DESTDIR)$(systemunitdir) && \
439                 rm -f runlevel0.target runlevel1.target runlevel6.target && \
440                 $(LN_S) poweroff.target runlevel0.target && \
441                 $(LN_S) rescue.target runlevel1.target && \
442                 $(LN_S) reboot.target runlevel6.target )
443         ( cd $(DESTDIR)$(pkgsysconfdir)/system && \
444                 rm -f default.target ctrl-alt-del.target kbrequest.target && \
445                 $(LN_S) $(systemunitdir)/graphical.target default.target && \
446                 $(LN_S) $(systemunitdir)/reboot.target ctrl-alt-del.target && \
447                 $(LN_S) $(systemunitdir)/rescue.target kbrequest.target && \
448                 rm -f runlevel2.target runlevel3.target runlevel4.target runlevel5.target && \
449                 $(LN_S) $(systemunitdir)/multi-user.target runlevel2.target && \
450                 $(LN_S) $(systemunitdir)/multi-user.target runlevel3.target && \
451                 $(LN_S) $(systemunitdir)/multi-user.target runlevel4.target && \
452                 $(LN_S) $(systemunitdir)/graphical.target runlevel5.target )
453         ( cd $(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants && \
454                 rm -f getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service && \
455                 $(LN_S) $(systemunitdir)/getty@.service getty@tty1.service && \
456                 $(LN_S) $(systemunitdir)/getty@.service getty@tty2.service && \
457                 $(LN_S) $(systemunitdir)/getty@.service getty@tty3.service && \
458                 $(LN_S) $(systemunitdir)/getty@.service getty@tty4.service && \
459                 $(LN_S) $(systemunitdir)/getty@.service getty@tty5.service && \
460                 $(LN_S) $(systemunitdir)/getty@.service getty@tty6.service )
461         ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
462                 rm -f getty.target && \
463                 $(LN_S) $(systemunitdir)/getty.target getty.target )
464         ( cd $(DESTDIR)$(systemunitdir)/basic.target.wants && \
465                 rm -f dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount && \
466                 $(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
467                 $(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
468                 $(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
469                 $(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount )
470 if TARGET_FEDORA
471         ( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
472                 rm -f prefdm.service && \
473                 $(LN_S) $(systemunitdir)/prefdm.service prefdm.service )
474         ( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
475                 rm -f rc-local.service && \
476                 $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
477         ( cd $(DESTDIR)$(systemunitdir) && \
478                 rm -f local.service && \
479                 $(LN_S) rc-local.service local.service )
480 endif
481
482 DISTCHECK_CONFIGURE_FLAGS = \
483         --with-udevrulesdir=$$dc_install_base/$(udevrulesdir)