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