chiark / gitweb /
15da7b24390cee5d103fcd03eb40ff12796a8f9c
[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/local-fs.target \
70         units/network.target \
71         units/nss-lookup.target \
72         units/remote-fs.target \
73         units/rtc-set.target \
74         units/shutdown.target \
75         units/sigpwr.target \
76         units/sockets.target \
77         units/swap.target \
78         units/systemd-initctl.socket \
79         units/systemd-logger.socket
80
81 systemunit_DATA = \
82         units/systemd-initctl.service \
83         units/systemd-logger.service \
84         units/syslog.target
85
86 EXTRA_DIST = \
87         units/systemd-initctl.service.in \
88         units/systemd-logger.service.in \
89         units/syslog.target.in \
90         LICENSE \
91         README
92
93 # This is needed because automake is buggy in how it generates the
94 # rules for C programs, but not Vala programs.  We therefore can't
95 # list the .h files as dependencies if we want make dist to work.
96 BASIC_SOURCES = \
97         src/util.c \
98         src/hashmap.c \
99         src/set.c \
100         src/strv.c \
101         src/conf-parser.c \
102         src/socket-util.c \
103         src/log.c \
104         src/ratelimit.c
105
106 COMMON_SOURCES = \
107         $(BASIC_SOURCES) \
108         src/unit.c \
109         src/job.c \
110         src/manager.c \
111         src/load-fragment.c \
112         src/service.c \
113         src/automount.c \
114         src/mount.c \
115         src/swap.c \
116         src/device.c \
117         src/target.c \
118         src/snapshot.c \
119         src/socket.c \
120         src/timer.c \
121         src/load-dropin.c \
122         src/execute.c \
123         src/dbus.c \
124         src/dbus-manager.c \
125         src/dbus-unit.c \
126         src/dbus-job.c \
127         src/dbus-service.c \
128         src/dbus-socket.c \
129         src/dbus-target.c \
130         src/dbus-mount.c \
131         src/dbus-automount.c \
132         src/dbus-swap.c \
133         src/dbus-snapshot.c \
134         src/dbus-device.c \
135         src/dbus-execute.c \
136         src/cgroup.c \
137         src/mount-setup.c \
138         src/hostname-setup.c \
139         src/loopback-setup.c \
140         src/utmp-wtmp.c \
141         src/specifier.c \
142         src/unit-name.c \
143         src/fdset.c \
144         src/namespace.c
145
146 EXTRA_DIST += \
147         ${COMMON_SOURCES:.c=.h} \
148         src/macro.h \
149         src/ioprio.h \
150         src/missing.h \
151         src/list.h \
152         src/securebits.h \
153         src/linux/auto_dev-ioctl.h \
154         src/initreq.h \
155         src/sd-daemon.h
156
157 dist_man_MANS = \
158         man/systemd.unit.5 \
159         man/systemd.service.5 \
160         man/systemd.special.7
161
162 HTMLMANS = \
163         man/systemd.unit.html \
164         man/systemd.service.html \
165         man/systemd.special.html
166
167 dist_noinst_DATA = \
168         $(HTMLMANS)
169
170 EXTRA_DIST += \
171         man/systemd.unit.xml \
172         man/systemd.service.xml \
173         man/systemd.special.xml
174
175 systemd_SOURCES = \
176         $(COMMON_SOURCES) \
177         src/main.c
178
179 systemd_CPPFLAGS = \
180         $(AM_CPPFLAGS) \
181         $(DBUS_CFLAGS) \
182         $(UDEV_CFLAGS) \
183         $(CGROUP_CFLAGS)
184
185 systemd_LDADD = \
186         $(DBUS_LIBS) \
187         $(UDEV_LIBS) \
188         $(CGROUP_LIBS)
189
190 test_engine_SOURCES = \
191         $(COMMON_SOURCES) \
192         src/test-engine.c
193
194 test_engine_CPPFLAGS = $(systemd_CPPFLAGS)
195 test_engine_LDADD = $(systemd_LDADD)
196
197 test_job_type_SOURCES = \
198         $(COMMON_SOURCES) \
199         src/test-engine.c
200
201 test_job_type_CPPFLAGS = $(systemd_CPPFLAGS)
202 test_job_type_LDADD = $(systemd_LDADD)
203
204 test_ns_SOURCES = \
205         $(BASIC_SOURCES) \
206         src/test-ns.c \
207         src/namespace.c
208
209 test_ns_CPPFLAGS = $(systemd_CPPFLAGS)
210 test_ns_LDADD = $(systemd_LDADD)
211
212 test_loopback_SOURCES = \
213         $(BASIC_SOURCES) \
214         src/test-loopback.c \
215         src/loopback-setup.c
216
217 test_loopback_CPPFLAGS = $(systemd_CPPFLAGS)
218 test_loopback_LDADD = $(systemd_LDADD)
219
220 systemd_logger_SOURCES = \
221         $(BASIC_SOURCES) \
222         src/logger.c \
223         src/sd-daemon.c
224
225 systemd_initctl_SOURCES = \
226         $(BASIC_SOURCES) \
227         src/initctl.c \
228         src/sd-daemon.c
229
230 systemd_initctl_CPPFLAGS = \
231         $(AM_CPPFLAGS) \
232         $(DBUS_CFLAGS)
233
234 systemd_initctl_LDADD = \
235         $(DBUS_LIBS)
236
237 systemd_cgroups_agent_SOURCES = \
238         $(BASIC_SOURCES) \
239         src/cgroups-agent.c
240
241 systemd_cgroups_agent_CPPFLAGS = \
242         $(AM_CPPFLAGS) \
243         $(DBUS_CFLAGS)
244
245 systemd_cgroups_agent_LDADD = \
246         $(DBUS_LIBS)
247
248 VALAFLAGS = \
249         -g \
250         --save-temps \
251         --pkg=dbus-glib-1 \
252         --pkg=posix
253
254 if HAVE_GTK
255 VALAFLAGS += \
256         --pkg=gtk+-2.0
257 endif
258
259 VALA_CFLAGS = \
260         -Wno-unused-variable \
261         -Wno-unused-function
262
263 systemctl_SOURCES = \
264         src/systemctl.vala \
265         src/systemd-interfaces.vala
266
267 systemctl_CPPFLAGS = $(AM_CPPFLAGS) $(DBUSGLIB_CFLAGS) $(VALA_CFLAGS)
268 systemctl_LDADD = $(DBUSGLIB_LIBS)
269
270 systemadm_SOURCES = \
271         src/systemadm.vala \
272         src/systemd-interfaces.vala
273
274 systemadm_CPPFLAGS = $(AM_CPPFLAGS) $(DBUSGLIB_CFLAGS) $(GTK_CFLAGS) $(VALA_CFLAGS)
275 systemadm_LDADD = $(DBUSGLIB_LIBS) $(GTK_LIBS)
276
277 units/systemd-initctl.service: units/systemd-initctl.service.in Makefile
278         $(MKDIR_P) units
279         $(SED) -e 's,@libexecdir\@,$(libexecdir),g' \
280                 -e 's,@pkglibexecdir\@,$(pkglibexecdir),g' \
281                 < $< > $@
282
283 units/systemd-logger.service: units/systemd-logger.service.in Makefile
284         $(MKDIR_P) units
285         $(SED) -e 's,@libexecdir\@,$(libexecdir),g' \
286                 -e 's,@pkglibexecdir\@,$(pkglibexecdir),g' \
287                 < $< > $@
288
289 units/syslog.target: units/syslog.target.in Makefile
290         $(MKDIR_P) units
291         $(SED) -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
292                 < $< > $@
293
294 CLEANFILES = \
295         src/systemd-interfaces.c \
296         src/systemctl.c \
297         src/systemadm.c \
298         units/systemd-initctl.service \
299         units/systemd-logger.service \
300         units/syslog.target
301
302 if HAVE_XSLTPROC
303 man/%.5 man/%.7: man/%.xml
304         $(MKDIR_P) man
305         $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
306
307 man/%.html: man/%.xml
308         $(MKDIR_P) man
309         $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
310
311 CLEANFILES += \
312         $(dist_man_MANS) \
313         $(HTMLMANS)
314 endif
315
316 install-data-hook:
317         $(MKDIR_P) -m 0755 \
318                 $(DESTDIR)$(systemunitdir) \
319                 $(DESTDIR)$(sessionunitdir) \
320                 $(DESTDIR)$(pkgsysconfdir)/system \
321                 $(DESTDIR)$(pkgsysconfdir)/system/sockets.target.wants \
322                 $(DESTDIR)$(pkgsysconfdir)/session \
323                 $(DESTDIR)$(sysconfdir)/xdg/systemd \
324                 $(DESTDIR)/cgroup/debug
325         ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
326                 rm -f session && \
327                 $(LN_S) $(DESTDIR)$(pkgsysconfdir)/session session )
328         ( cd $(DESTDIR)$(pkgsysconfdir)/system/sockets.target.wants && \
329                 rm -f systemd-initctl.socket systemd-logger.socket && \
330                 $(LN_S) $(DESTDIR)$(systemunitdir)/systemd-logger.socket systemd-logger.socket && \
331                 $(LN_S) $(DESTDIR)$(systemunitdir)/systemd-initctl.socket systemd-initctl.socket )
332         ( cd $(DESTDIR)$(sessionunitdir) && \
333                 rm -f shutdown.target sockets.target && \
334                 $(LN_S) ../system/shutdown.target shutdown.target && \
335                 $(LN_S) ../system/sockets.target sockets.target )
336
337 DISTCHECK_CONFIGURE_FLAGS = \
338         --with-udevrulesdir=$$dc_install_base/$(udevrulesdir)