]> git.proxmox.com Git - mirror_lxc.git/blob - src/lxc/Makefile.am
apparmor: profile generation
[mirror_lxc.git] / src / lxc / Makefile.am
1 pkginclude_HEADERS = attach_options.h \
2 lxccontainer.h \
3 version.h
4
5 noinst_HEADERS = attach.h \
6 caps.h \
7 cgroups/cgroup.h \
8 cgroups/cgroup_utils.h \
9 conf.h \
10 confile.h \
11 confile_utils.h \
12 criu.h \
13 error.h \
14 initutils.h \
15 list.h \
16 log.h \
17 lxc.h \
18 lxclock.h \
19 monitor.h \
20 namespace.h \
21 start.h \
22 state.h \
23 storage/btrfs.h \
24 storage/dir.h \
25 storage/loop.h \
26 storage/lvm.h \
27 storage/nbd.h \
28 storage/overlay.h \
29 storage/rbd.h \
30 storage/rsync.h \
31 storage/storage.h \
32 storage/storage_utils.h \
33 storage/zfs.h \
34 terminal.h \
35 ../tests/lxctest.h \
36 tools/arguments.h \
37 utils.h
38
39 if IS_BIONIC
40 noinst_HEADERS += ../include/ifaddrs.h \
41 ../include/lxcmntent.h \
42 ../include/openpty.h
43 endif
44
45 if !HAVE_PRLIMIT
46 if HAVE_PRLIMIT64
47 noinst_HEADERS += ../include/prlimit.h
48 endif
49 endif
50
51 if !HAVE_GETLINE
52 if HAVE_FGETLN
53 noinst_HEADERS += ../include/getline.h
54 endif
55 endif
56
57 if !HAVE_GETSUBOPT
58 noinst_HEADERS += tools/include/getsubopt.h
59 endif
60
61 if !HAVE_GETGRGID_R
62 noinst_HEADERS += ../include/getgrgid_r.h
63 endif
64
65 sodir=$(libdir)
66
67 LSM_SOURCES = lsm/lsm.c \
68 lsm/lsm.h \
69 lsm/nop.c
70
71 if ENABLE_APPARMOR
72 LSM_SOURCES += lsm/apparmor.c
73 endif
74
75 if ENABLE_SELINUX
76 LSM_SOURCES += lsm/selinux.c
77 endif
78
79 lib_LTLIBRARIES = liblxc.la
80 liblxc_la_SOURCES = af_unix.c af_unix.h \
81 attach.c attach.h \
82 caps.c caps.h \
83 cgroups/cgfsng.c \
84 cgroups/cgroup.c cgroups/cgroup.h \
85 cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
86 commands.c commands.h \
87 commands_utils.c commands_utils.h \
88 conf.c conf.h \
89 confile.c confile.h \
90 confile_utils.c confile_utils.h \
91 criu.c criu.h \
92 error.c error.h \
93 execute.c \
94 freezer.c \
95 initutils.c initutils.h \
96 list.h \
97 log.c log.h \
98 lxc.h \
99 lxccontainer.c lxccontainer.h \
100 lxclock.c lxclock.h \
101 lxcseccomp.h \
102 mainloop.c mainloop.h \
103 namespace.c namespace.h \
104 nl.c nl.h \
105 network.c network.h \
106 monitor.c monitor.h \
107 parse.c parse.h \
108 ringbuf.c ringbuf.h \
109 rtnl.c rtnl.h \
110 state.c state.h \
111 start.c start.h \
112 storage/btrfs.c storage/btrfs.h \
113 storage/dir.c storage/dir.h \
114 storage/loop.c storage/loop.h \
115 storage/lvm.c storage/lvm.h \
116 storage/nbd.c storage/nbd.h \
117 storage/overlay.c storage/overlay.h \
118 storage/rbd.c storage/rbd.h \
119 storage/rsync.c storage/rsync.h \
120 storage/storage.c storage/storage.h \
121 storage/storage_utils.c storage/storage_utils.h \
122 storage/zfs.c storage/zfs.h \
123 sync.c sync.h \
124 terminal.c \
125 utils.c utils.h \
126 version.h \
127 $(LSM_SOURCES)
128
129 if IS_BIONIC
130 liblxc_la_SOURCES += ../include/ifaddrs.c ../include/ifaddrs.h \
131 ../include/lxcmntent.c ../include/lxcmntent.h \
132 ../include/openpty.c ../include/openpty.h
133 endif
134
135 if !HAVE_GETGRGID_R
136 liblxc_la_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h
137 endif
138
139 if !HAVE_GETLINE
140 if HAVE_FGETLN
141 liblxc_la_SOURCES += ../include/getline.c ../include/getline.h
142 endif
143 endif
144
145 if !HAVE_PRLIMIT
146 if HAVE_PRLIMIT64
147 liblxc_la_SOURCES += ../include/prlimit.c ../include/prlimit.h
148 endif
149 endif
150
151 if ENABLE_SECCOMP
152 liblxc_la_SOURCES += seccomp.c
153 endif
154
155 if !HAVE_STRLCPY
156 liblxc_la_SOURCES += ../include/strlcpy.c ../include/strlcpy.h
157 endif
158
159 if !HAVE_STRLCAT
160 liblxc_la_SOURCES += ../include/strlcat.c ../include/strlcat.h
161 endif
162
163 AM_CFLAGS = -DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \
164 -DLXCPATH=\"$(LXCPATH)\" \
165 -DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \
166 -DLXCINITDIR=\"$(LXCINITDIR)\" \
167 -DLIBEXECDIR=\"$(LIBEXECDIR)\" \
168 -DLXCTEMPLATEDIR=\"$(LXCTEMPLATEDIR)\" \
169 -DLXCTEMPLATECONFIG=\"$(LXCTEMPLATECONFIG)\" \
170 -DLOGPATH=\"$(LOGPATH)\" \
171 -DLXC_DEFAULT_CONFIG=\"$(LXC_DEFAULT_CONFIG)\" \
172 -DLXC_USERNIC_DB=\"$(LXC_USERNIC_DB)\" \
173 -DLXC_USERNIC_CONF=\"$(LXC_USERNIC_CONF)\" \
174 -DDEFAULT_CGROUP_PATTERN=\"$(DEFAULT_CGROUP_PATTERN)\" \
175 -DRUNTIME_PATH=\"$(RUNTIME_PATH)\" \
176 -DSBINDIR=\"$(SBINDIR)\" \
177 -DAPPARMOR_CACHE_DIR=\"$(APPARMOR_CACHE_DIR)\" \
178 -I $(top_srcdir)/src \
179 -I $(top_srcdir)/src/lxc \
180 -I $(top_srcdir)/src/lxc/storage \
181 -I $(top_srcdir)/src/lxc/cgroups
182
183 if ENABLE_APPARMOR
184 AM_CFLAGS += -DHAVE_APPARMOR
185 endif
186
187 if ENABLE_GNUTLS
188 AM_CFLAGS += -DHAVE_LIBGNUTLS
189 endif
190
191 if ENABLE_SECCOMP
192 AM_CFLAGS += -DHAVE_SECCOMP \
193 $(SECCOMP_CFLAGS)
194 endif
195
196 if ENABLE_SELINUX
197 AM_CFLAGS += -DHAVE_SELINUX
198 endif
199
200 if USE_CONFIGPATH_LOGS
201 AM_CFLAGS += -DUSE_CONFIGPATH_LOGS
202 endif
203
204 # build the shared library
205 liblxc_la_CFLAGS = -fPIC \
206 -DPIC \
207 $(AM_CFLAGS) \
208 -pthread
209
210 liblxc_la_LDFLAGS = -pthread \
211 -Wl,-soname,liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) \
212 -version-info @LXC_ABI_MAJOR@
213
214 liblxc_la_LIBADD = $(CAP_LIBS) \
215 $(GNUTLS_LIBS) \
216 $(SELINUX_LIBS) \
217 $(SECCOMP_LIBS)
218
219 bin_SCRIPTS=
220
221 if ENABLE_COMMANDS
222 bin_SCRIPTS += cmd/lxc-checkconfig \
223 cmd/lxc-update-config
224 endif
225
226 if ENABLE_TOOLS
227 bin_PROGRAMS = lxc-attach \
228 lxc-autostart \
229 lxc-cgroup \
230 lxc-checkpoint \
231 lxc-copy \
232 lxc-config \
233 lxc-console \
234 lxc-create \
235 lxc-destroy \
236 lxc-device \
237 lxc-execute \
238 lxc-freeze \
239 lxc-info \
240 lxc-ls \
241 lxc-monitor \
242 lxc-snapshot \
243 lxc-start \
244 lxc-stop \
245 lxc-top \
246 lxc-unfreeze \
247 lxc-unshare \
248 lxc-usernsexec \
249 lxc-wait
250 endif
251
252 if ENABLE_COMMANDS
253 sbin_PROGRAMS = init.lxc
254
255 pkglibexec_PROGRAMS = lxc-monitord \
256 lxc-user-nic
257 endif
258
259 AM_LDFLAGS = -Wl,-E
260
261 if ENABLE_RPATH
262 AM_LDFLAGS += -Wl,-rpath -Wl,$(libdir)
263 endif
264
265 LDADD = liblxc.la \
266 @CAP_LIBS@ \
267 @GNUTLS_LIBS@ \
268 @SECCOMP_LIBS@ \
269 @SELINUX_LIBS@
270
271 if ENABLE_TOOLS
272 lxc_attach_SOURCES = tools/lxc_attach.c \
273 tools/arguments.c tools/arguments.h
274 lxc_autostart_SOURCES = tools/lxc_autostart.c \
275 tools/arguments.c tools/arguments.h
276 lxc_cgroup_SOURCES = tools/lxc_cgroup.c \
277 tools/arguments.c tools/arguments.h
278 lxc_config_SOURCES = tools/lxc_config.c \
279 tools/arguments.c tools/arguments.h
280 lxc_console_SOURCES = tools/lxc_console.c \
281 tools/arguments.c tools/arguments.h
282 lxc_destroy_SOURCES = tools/lxc_destroy.c \
283 tools/arguments.c tools/arguments.h
284 lxc_device_SOURCES = tools/lxc_device.c \
285 tools/arguments.c tools/arguments.h
286 lxc_execute_SOURCES = tools/lxc_execute.c \
287 tools/arguments.c tools/arguments.h
288 lxc_freeze_SOURCES = tools/lxc_freeze.c \
289 tools/arguments.c tools/arguments.h
290 lxc_info_SOURCES = tools/lxc_info.c \
291 tools/arguments.c tools/arguments.h
292 lxc_monitor_SOURCES = tools/lxc_monitor.c \
293 tools/arguments.c tools/arguments.h
294 lxc_ls_SOURCES = tools/lxc_ls.c \
295 tools/arguments.c tools/arguments.h
296 lxc_copy_SOURCES = tools/lxc_copy.c \
297 tools/arguments.c tools/arguments.h
298 lxc_start_SOURCES = tools/lxc_start.c \
299 tools/arguments.c tools/arguments.h
300 lxc_stop_SOURCES = tools/lxc_stop.c \
301 tools/arguments.c tools/arguments.h
302 lxc_top_SOURCES = tools/lxc_top.c \
303 tools/arguments.c tools/arguments.h
304 lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c \
305 tools/arguments.c tools/arguments.h
306 lxc_unshare_SOURCES = tools/lxc_unshare.c \
307 tools/arguments.c tools/arguments.h
308 lxc_wait_SOURCES = tools/lxc_wait.c \
309 tools/arguments.c tools/arguments.h
310 lxc_create_SOURCES = tools/lxc_create.c \
311 tools/arguments.c tools/arguments.h
312 lxc_snapshot_SOURCES = tools/lxc_snapshot.c \
313 tools/arguments.c tools/arguments.h
314 lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c \
315 tools/arguments.c tools/arguments.h
316 endif
317
318 if ENABLE_COMMANDS
319 # Binaries shipping with liblxc
320 init_lxc_SOURCES = cmd/lxc_init.c
321 lxc_monitord_SOURCES = cmd/lxc_monitord.c
322 lxc_user_nic_SOURCES = cmd/lxc_user_nic.c \
323 namespace.c namespace.h \
324 network.c network.h \
325 parse.c parse.h
326 lxc_usernsexec_SOURCES = cmd/lxc_usernsexec.c
327 endif
328
329
330 if ENABLE_TOOLS
331 if !HAVE_GETSUBOPT
332 lxc_copy_SOURCES += tools/include/getsubopt.c tools/include/getsubopt.h
333 endif
334 endif
335
336 if ENABLE_COMMANDS
337 if HAVE_STATIC_LIBCAP
338 sbin_PROGRAMS += init.lxc.static
339
340 init_lxc_static_SOURCES = cmd/lxc_init.c \
341 caps.c caps.h \
342 error.c error.h \
343 initutils.c initutils.h \
344 log.c log.h \
345 namespace.c namespace.h \
346 parse.c parse.h
347
348 if !HAVE_GETLINE
349 if HAVE_FGETLN
350 init_lxc_static_SOURCES += ../include/getline.c ../include/getline.h
351 endif
352 endif
353
354 if !HAVE_STRLCPY
355 init_lxc_static_SOURCES += ../include/strlcpy.c ../include/strlcpy.h
356 endif
357
358 if !HAVE_STRLCAT
359 init_lxc_static_SOURCES += ../include/strlcat.c ../include/strlcat.h
360 endif
361
362 init_lxc_static_LDFLAGS = -all-static
363 init_lxc_static_LDADD = @CAP_LIBS@
364 init_lxc_static_CFLAGS = $(AM_CFLAGS) -DNO_LXC_CONF
365 endif
366 endif
367
368 if ENABLE_PAM
369 if HAVE_PAM
370 pam_LTLIBRARIES = pam_cgfs.la
371 pam_cgfs_la_SOURCES = pam/pam_cgfs.c \
372 pam/utils.c pam/utils.h
373 pam_cgfs_la_CFLAGS = $(AM_CFLAGS)
374 pam_cgfs_la_LIBADD = $(AM_LIBS) \
375 $(PAM_LIBS) \
376 -L$(top_srcdir)
377 pam_cgfs_la_LDFLAGS = $(AM_LDFLAGS) \
378 -avoid-version \
379 -module \
380 -shared
381 endif
382 endif
383
384 install-exec-local: install-libLTLIBRARIES
385 mkdir -p $(DESTDIR)$(datadir)/lxc
386 install -c -m 644 lxc.functions $(DESTDIR)$(datadir)/lxc
387 mv $(shell readlink -f $(DESTDIR)$(libdir)/liblxc.so) $(DESTDIR)$(libdir)/liblxc.so.@LXC_ABI@
388 rm -f $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.1
389 cd $(DESTDIR)$(libdir); \
390 ln -sf liblxc.so.@LXC_ABI@ liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)); \
391 ln -sf liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) liblxc.so
392
393 install-exec-hook:
394 chmod u+s $(DESTDIR)$(libexecdir)/lxc/lxc-user-nic
395
396 uninstall-local:
397 $(RM) $(DESTDIR)$(libdir)/liblxc.so*
398 $(RM) $(DESTDIR)$(libdir)/liblxc.a
399 if ENABLE_PAM
400 if HAVE_PAM
401 $(RM) $(DESTDIR)$(pamdir)/pam_cgfs.so*
402
403 install-data-hook: install-pamLTLIBRARIES
404 $(RM) "$(DESTDIR)$(pamdir)/pam_cgfs.la"
405 $(RM) "$(DESTDIR)$(pamdir)/pam_cgfs.a"
406 endif
407 endif