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