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