chiark / gitweb /
780ded62fa95655168dd5a847e519e2b6ec63ed5
[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
161 HTMLMANS = \
162         man/systemd.unit.html \
163         man/systemd.service.html
164
165 dist_noinst_DATA = \
166         $(HTMLMANS)
167
168 EXTRA_DIST += \
169         man/systemd.unit.xml \
170         man/systemd.service.xml
171
172 systemd_SOURCES = \
173         $(COMMON_SOURCES) \
174         src/main.c
175
176 systemd_CPPFLAGS = \
177         $(AM_CPPFLAGS) \
178         $(DBUS_CFLAGS) \
179         $(UDEV_CFLAGS) \
180         $(CGROUP_CFLAGS)
181
182 systemd_LDADD = \
183         $(DBUS_LIBS) \
184         $(UDEV_LIBS) \
185         $(CGROUP_LIBS)
186
187 test_engine_SOURCES = \
188         $(COMMON_SOURCES) \
189         src/test-engine.c
190
191 test_engine_CPPFLAGS = $(systemd_CPPFLAGS)
192 test_engine_LDADD = $(systemd_LDADD)
193
194 test_job_type_SOURCES = \
195         $(COMMON_SOURCES) \
196         src/test-engine.c
197
198 test_job_type_CPPFLAGS = $(systemd_CPPFLAGS)
199 test_job_type_LDADD = $(systemd_LDADD)
200
201 test_ns_SOURCES = \
202         $(BASIC_SOURCES) \
203         src/test-ns.c \
204         src/namespace.c
205
206 test_ns_CPPFLAGS = $(systemd_CPPFLAGS)
207 test_ns_LDADD = $(systemd_LDADD)
208
209 test_loopback_SOURCES = \
210         $(BASIC_SOURCES) \
211         src/test-loopback.c \
212         src/loopback-setup.c
213
214 test_loopback_CPPFLAGS = $(systemd_CPPFLAGS)
215 test_loopback_LDADD = $(systemd_LDADD)
216
217 systemd_logger_SOURCES = \
218         $(BASIC_SOURCES) \
219         src/logger.c \
220         src/sd-daemon.c
221
222 systemd_initctl_SOURCES = \
223         $(BASIC_SOURCES) \
224         src/initctl.c \
225         src/sd-daemon.c
226
227 systemd_initctl_CPPFLAGS = \
228         $(AM_CPPFLAGS) \
229         $(DBUS_CFLAGS)
230
231 systemd_initctl_LDADD = \
232         $(DBUS_LIBS)
233
234 systemd_cgroups_agent_SOURCES = \
235         $(BASIC_SOURCES) \
236         src/cgroups-agent.c
237
238 systemd_cgroups_agent_CPPFLAGS = \
239         $(AM_CPPFLAGS) \
240         $(DBUS_CFLAGS)
241
242 systemd_cgroups_agent_LDADD = \
243         $(DBUS_LIBS)
244
245 VALAFLAGS = \
246         -g \
247         --save-temps \
248         --pkg=dbus-glib-1 \
249         --pkg=posix
250
251 if HAVE_GTK
252 VALAFLAGS += \
253         --pkg=gtk+-2.0
254 endif
255
256 VALA_CFLAGS = \
257         -Wno-unused-variable \
258         -Wno-unused-function
259
260 systemctl_SOURCES = \
261         src/systemctl.vala \
262         src/systemd-interfaces.vala
263
264 systemctl_CPPFLAGS = $(AM_CPPFLAGS) $(DBUSGLIB_CFLAGS) $(VALA_CFLAGS)
265 systemctl_LDADD = $(DBUSGLIB_LIBS)
266
267 systemadm_SOURCES = \
268         src/systemadm.vala \
269         src/systemd-interfaces.vala
270
271 systemadm_CPPFLAGS = $(AM_CPPFLAGS) $(DBUSGLIB_CFLAGS) $(GTK_CFLAGS) $(VALA_CFLAGS)
272 systemadm_LDADD = $(DBUSGLIB_LIBS) $(GTK_LIBS)
273
274 units/systemd-initctl.service: units/systemd-initctl.service.in Makefile
275         $(MKDIR_P) units
276         $(SED) -e 's,@libexecdir\@,$(libexecdir),g' \
277                 -e 's,@pkglibexecdir\@,$(pkglibexecdir),g' \
278                 < $< > $@
279
280 units/systemd-logger.service: units/systemd-logger.service.in Makefile
281         $(MKDIR_P) units
282         $(SED) -e 's,@libexecdir\@,$(libexecdir),g' \
283                 -e 's,@pkglibexecdir\@,$(pkglibexecdir),g' \
284                 < $< > $@
285
286 units/syslog.target: units/syslog.target.in Makefile
287         $(MKDIR_P) units
288         $(SED) -e 's,@SPECIAL_SYSLOG_SERVICE\@,$(SPECIAL_SYSLOG_SERVICE),g' \
289                 < $< > $@
290
291 CLEANFILES = \
292         src/systemd-interfaces.c \
293         src/systemctl.c \
294         src/systemadm.c \
295         units/systemd-initctl.service \
296         units/systemd-logger.service \
297         units/syslog.target
298
299 if HAVE_XSLTPROC
300 man/%.5: man/%.xml
301         $(MKDIR_P) man
302         $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
303
304 man/%.html: man/%.xml
305         $(MKDIR_P) man
306         $(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
307
308 CLEANFILES += \
309         $(dist_man_MANS) \
310         $(HTMLMANS)
311 endif
312
313 install-data-hook:
314         $(MKDIR_P) -m 0755 \
315                 $(DESTDIR)$(systemunitdir) \
316                 $(DESTDIR)$(sessionunitdir) \
317                 $(DESTDIR)$(pkgsysconfdir)/system \
318                 $(DESTDIR)$(pkgsysconfdir)/system/sockets.target.wants \
319                 $(DESTDIR)$(pkgsysconfdir)/session \
320                 $(DESTDIR)$(sysconfdir)/xdg/systemd \
321                 $(DESTDIR)/cgroup/debug
322         ( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
323                 rm -f session && \
324                 $(LN_S) $(DESTDIR)$(pkgsysconfdir)/session session )
325         ( cd $(DESTDIR)$(pkgsysconfdir)/system/sockets.target.wants && \
326                 rm -f systemd-initctl.socket systemd-logger.socket && \
327                 $(LN_S) $(DESTDIR)$(systemunitdir)/systemd-logger.socket systemd-logger.socket && \
328                 $(LN_S) $(DESTDIR)$(systemunitdir)/systemd-initctl.socket systemd-initctl.socket )
329         ( cd $(DESTDIR)$(sessionunitdir) && \
330                 rm -f shutdown.target sockets.target && \
331                 $(LN_S) ../system/shutdown.target shutdown.target && \
332                 $(LN_S) ../system/sockets.target sockets.target )
333
334 DISTCHECK_CONFIGURE_FLAGS = \
335         --with-udevrulesdir=$$dc_install_base/$(udevrulesdir)