]> git.proxmox.com Git - mirror_lxc.git/blob - src/lxc/Makefile.am
genl: remove
[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 attach.h \
8 storage/storage.h \
9 storage/btrfs.h \
10 storage/dir.h \
11 storage/loop.h \
12 storage/lvm.h \
13 storage/nbd.h \
14 storage/overlay.h \
15 storage/rbd.h \
16 storage/rsync.h \
17 storage/zfs.h \
18 storage/storage_utils.h \
19 tools/arguments.h \
20 tools/tool_utils.h \
21 tools/tool_list.h \
22 cgroups/cgroup.h \
23 cgroups/cgroup_utils.h \
24 caps.h \
25 conf.h \
26 confile.h \
27 confile_utils.h \
28 error.h \
29 initutils.h \
30 list.h \
31 log.h \
32 lxc.h \
33 lxclock.h \
34 monitor.h \
35 namespace.h \
36 start.h \
37 state.h \
38 terminal.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 += tools/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/btrfs.c storage/btrfs.h \
84 storage/dir.c storage/dir.h \
85 storage/loop.c storage/loop.h \
86 storage/lvm.c storage/lvm.h \
87 storage/nbd.c storage/nbd.h \
88 storage/overlay.c storage/overlay.h \
89 storage/rbd.c storage/rbd.h \
90 storage/rsync.c storage/rsync.h \
91 storage/zfs.c storage/zfs.h \
92 storage/storage_utils.c storage/storage_utils.h \
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 terminal.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_utils.c confile_utils.h \
113 list.h \
114 state.c state.h \
115 log.c log.h \
116 attach.c attach.h \
117 criu.c criu.h \
118 ringbuf.c ringbuf.h \
119 \
120 network.c network.h \
121 nl.c nl.h \
122 rtnl.c rtnl.h \
123 \
124 caps.c caps.h \
125 lxcseccomp.h \
126 mainloop.c mainloop.h \
127 af_unix.c af_unix.h \
128 \
129 lxclock.h lxclock.c \
130 lxccontainer.c lxccontainer.h \
131 version.h \
132 \
133 $(LSM_SOURCES)
134
135 if IS_BIONIC
136 liblxc_la_SOURCES += \
137 ../include/ifaddrs.c ../include/ifaddrs.h \
138 ../include/openpty.c ../include/openpty.h \
139 ../include/lxcmntent.c ../include/lxcmntent.h
140 endif
141
142 if !HAVE_PRLIMIT
143 if HAVE_PRLIMIT64
144 liblxc_la_SOURCES += ../include/prlimit.c ../include/prlimit.h
145 endif
146 endif
147
148 if !HAVE_GETLINE
149 if HAVE_FGETLN
150 liblxc_la_SOURCES += ../include/getline.c ../include/getline.h
151 endif
152 endif
153
154 AM_CFLAGS=-DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \
155 -DLXCPATH=\"$(LXCPATH)\" \
156 -DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \
157 -DLXCINITDIR=\"$(LXCINITDIR)\" \
158 -DLIBEXECDIR=\"$(LIBEXECDIR)\" \
159 -DLXCTEMPLATEDIR=\"$(LXCTEMPLATEDIR)\" \
160 -DLXCTEMPLATECONFIG=\"$(LXCTEMPLATECONFIG)\" \
161 -DLOGPATH=\"$(LOGPATH)\" \
162 -DLXC_DEFAULT_CONFIG=\"$(LXC_DEFAULT_CONFIG)\" \
163 -DLXC_USERNIC_DB=\"$(LXC_USERNIC_DB)\" \
164 -DLXC_USERNIC_CONF=\"$(LXC_USERNIC_CONF)\" \
165 -DDEFAULT_CGROUP_PATTERN=\"$(DEFAULT_CGROUP_PATTERN)\" \
166 -DRUNTIME_PATH=\"$(RUNTIME_PATH)\" \
167 -DSBINDIR=\"$(SBINDIR)\" \
168 -I $(top_srcdir)/src \
169 -I $(top_srcdir)/src/lxc \
170 -I $(top_srcdir)/src/lxc/storage \
171 -I $(top_srcdir)/src/lxc/cgroups
172
173 if ENABLE_APPARMOR
174 AM_CFLAGS += -DHAVE_APPARMOR
175 endif
176
177 if ENABLE_GNUTLS
178 AM_CFLAGS += -DHAVE_LIBGNUTLS
179 endif
180
181 if ENABLE_SELINUX
182 AM_CFLAGS += -DHAVE_SELINUX
183 endif
184
185 if USE_CONFIGPATH_LOGS
186 AM_CFLAGS += -DUSE_CONFIGPATH_LOGS
187 endif
188
189 if ENABLE_SECCOMP
190 AM_CFLAGS += -DHAVE_SECCOMP $(SECCOMP_CFLAGS)
191 liblxc_la_SOURCES += seccomp.c
192 endif
193
194 liblxc_la_CFLAGS = -fPIC -DPIC $(AM_CFLAGS) -pthread
195
196 liblxc_la_LDFLAGS = \
197 -pthread \
198 -shared \
199 -Wl,-soname,liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) \
200 -version-info @LXC_ABI_MAJOR@
201
202 liblxc_la_LIBADD = $(CAP_LIBS) $(GNUTLS_LIBS) $(SELINUX_LIBS) $(SECCOMP_LIBS)
203
204 bin_SCRIPTS=
205
206 if ENABLE_COMMANDS
207 bin_SCRIPTS += cmd/lxc-checkconfig \
208 cmd/lxc-update-config
209 endif
210
211 if ENABLE_TOOLS
212 bin_PROGRAMS = \
213 lxc-attach \
214 lxc-autostart \
215 lxc-cgroup \
216 lxc-checkpoint \
217 lxc-copy \
218 lxc-config \
219 lxc-console \
220 lxc-create \
221 lxc-destroy \
222 lxc-device \
223 lxc-execute \
224 lxc-freeze \
225 lxc-info \
226 lxc-ls \
227 lxc-monitor \
228 lxc-snapshot \
229 lxc-start \
230 lxc-stop \
231 lxc-top \
232 lxc-unfreeze \
233 lxc-unshare \
234 lxc-usernsexec \
235 lxc-wait
236 endif
237
238 if ENABLE_COMMANDS
239 sbin_PROGRAMS = init.lxc
240 pkglibexec_PROGRAMS = \
241 lxc-monitord \
242 lxc-user-nic
243 endif
244
245 AM_LDFLAGS = -Wl,-E
246 if ENABLE_RPATH
247 AM_LDFLAGS += -Wl,-rpath -Wl,$(libdir)
248 endif
249 LDADD=liblxc.la @CAP_LIBS@ @GNUTLS_LIBS@ @SELINUX_LIBS@ @SECCOMP_LIBS@
250
251 if ENABLE_TOOLS
252 lxc_attach_SOURCES = tools/lxc_attach.c tools/arguments.c tools/tool_utils.c
253 lxc_autostart_SOURCES = tools/lxc_autostart.c tools/arguments.c tools/tool_utils.c
254 lxc_cgroup_SOURCES = tools/lxc_cgroup.c tools/arguments.c tools/tool_utils.c
255 lxc_config_SOURCES = tools/lxc_config.c tools/arguments.c tools/tool_utils.c
256 lxc_console_SOURCES = tools/lxc_console.c tools/arguments.c tools/tool_utils.c
257 lxc_destroy_SOURCES = tools/lxc_destroy.c tools/arguments.c tools/tool_utils.c
258 lxc_device_SOURCES = tools/lxc_device.c tools/arguments.c tools/tool_utils.c
259 lxc_execute_SOURCES = tools/lxc_execute.c tools/arguments.c tools/tool_utils.c
260 lxc_freeze_SOURCES = tools/lxc_freeze.c tools/arguments.c tools/tool_utils.c
261 lxc_info_SOURCES = tools/lxc_info.c tools/arguments.c tools/tool_utils.c
262 lxc_monitor_SOURCES = tools/lxc_monitor.c tools/arguments.c tools/tool_utils.c
263 lxc_ls_SOURCES = tools/lxc_ls.c tools/arguments.c tools/tool_utils.c
264 lxc_copy_SOURCES = tools/lxc_copy.c tools/arguments.c tools/tool_utils.c
265 lxc_start_SOURCES = tools/lxc_start.c tools/arguments.c tools/tool_utils.c
266 lxc_stop_SOURCES = tools/lxc_stop.c tools/arguments.c tools/tool_utils.c
267 lxc_top_SOURCES = tools/lxc_top.c tools/arguments.c tools/tool_utils.c
268 lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c tools/arguments.c tools/tool_utils.c
269 lxc_unshare_SOURCES = tools/lxc_unshare.c tools/arguments.c tools/tool_utils.c
270 lxc_wait_SOURCES = tools/lxc_wait.c tools/arguments.c tools/tool_utils.c
271 lxc_create_SOURCES = tools/lxc_create.c tools/arguments.c tools/tool_utils.c
272 lxc_snapshot_SOURCES = tools/lxc_snapshot.c tools/arguments.c tools/tool_utils.c
273 lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c tools/arguments.c tools/tool_utils.c
274 endif
275
276 if ENABLE_COMMANDS
277 # Binaries shipping with liblxc
278 init_lxc_SOURCES = cmd/lxc_init.c
279 lxc_monitord_SOURCES = cmd/lxc_monitord.c
280 lxc_user_nic_SOURCES = cmd/lxc_user_nic.c namespace.c network.c parse.c
281 lxc_usernsexec_SOURCES = cmd/lxc_usernsexec.c
282 endif
283
284
285 if ENABLE_TOOLS
286 if !HAVE_GETSUBOPT
287 lxc_copy_SOURCES += tools/include/getsubopt.c tools/include/getsubopt.h
288 endif
289 endif
290
291 if ENABLE_COMMANDS
292 if HAVE_STATIC_LIBCAP
293 sbin_PROGRAMS += init.lxc.static
294
295 init_lxc_static_SOURCES = cmd/lxc_init.c error.c log.c initutils.c caps.c parse.c namespace.c
296
297 if !HAVE_GETLINE
298 if HAVE_FGETLN
299 init_lxc_static_SOURCES += ../include/getline.c
300 endif
301 endif
302
303 init_lxc_static_LDFLAGS = -all-static
304 init_lxc_static_LDADD = @CAP_LIBS@
305 init_lxc_static_CFLAGS = $(AM_CFLAGS) -DNO_LXC_CONF
306 endif
307 endif
308
309 if ENABLE_PAM
310 if HAVE_PAM
311 pam_LTLIBRARIES = pam_cgfs.la
312 pam_cgfs_la_SOURCES = pam/pam_cgfs.c pam/utils.c pam/utils.h
313 pam_cgfs_la_CFLAGS = $(AM_CFLAGS)
314 pam_cgfs_la_LIBADD = $(AM_LIBS) $(PAM_LIBS) -L$(top_srcdir)
315 pam_cgfs_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version -shared
316 endif
317 endif
318
319 install-exec-local: install-libLTLIBRARIES
320 mkdir -p $(DESTDIR)$(datadir)/lxc
321 install -c -m 644 lxc.functions $(DESTDIR)$(datadir)/lxc
322 mv $(shell readlink -f $(DESTDIR)$(libdir)/liblxc.so) $(DESTDIR)$(libdir)/liblxc.so.@LXC_ABI@
323 rm -f $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.1
324 cd $(DESTDIR)$(libdir); \
325 ln -sf liblxc.so.@LXC_ABI@ liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)); \
326 ln -sf liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) liblxc.so
327
328 install-exec-hook:
329 chmod u+s $(DESTDIR)$(libexecdir)/lxc/lxc-user-nic
330
331 uninstall-local:
332 $(RM) $(DESTDIR)$(libdir)/liblxc.so*
333 if ENABLE_PAM
334 if HAVE_PAM
335 $(RM) $(DESTDIR)$(pamdir)/pam_cgfs.so*
336
337 install-data-hook: install-pamLTLIBRARIES
338 $(RM) "$(DESTDIR)$(pamdir)/pam_cgfs.la"
339 $(RM) "$(DESTDIR)$(pamdir)/pam_cgfs.a"
340 endif
341 endif