]> git.proxmox.com Git - mirror_lxc.git/blob - src/lxc/Makefile.am
Merge pull request #724 from brauner/2015-12-12/split_bdev_into_modules
[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/lxc-btrfs.h \
11 bdev/overlay.h \
12 caps.h \
13 cgroup.h \
14 conf.h \
15 console.h \
16 error.h \
17 initutils.h \
18 list.h \
19 log.h \
20 lxc.h \
21 lxclock.h \
22 monitor.h \
23 namespace.h \
24 start.h \
25 state.h \
26 utils.h \
27 criu.h
28
29 if IS_BIONIC
30 noinst_HEADERS += \
31 ../include/ifaddrs.h \
32 ../include/openpty.h \
33 ../include/lxcmntent.h
34 endif
35
36 if !HAVE_GETLINE
37 if HAVE_FGETLN
38 noinst_HEADERS += ../include/getline.h
39 endif
40 endif
41
42 if !HAVE_GETSUBOPT
43 noinst_HEADERS += ../include/getsubopt.h
44 endif
45
46 sodir=$(libdir)
47 # use PROGRAMS to avoid complains from automake
48 so_PROGRAMS = liblxc.so
49
50 LSM_SOURCES = \
51 lsm/nop.c \
52 lsm/lsm.h lsm/lsm.c
53
54 if ENABLE_APPARMOR
55 LSM_SOURCES += lsm/apparmor.c
56 endif
57
58 if ENABLE_SELINUX
59 LSM_SOURCES += lsm/selinux.c
60 endif
61
62 liblxc_so_SOURCES = \
63 arguments.c arguments.h \
64 bdev/bdev.c bdev/bdev.h bdev/overlay.c bdev/overlay.h bdev/lxc-btrfs.h \
65 commands.c commands.h \
66 start.c start.h \
67 execute.c \
68 monitor.c monitor.h \
69 console.c \
70 freezer.c \
71 error.h error.c \
72 parse.c parse.h \
73 cgfs.c \
74 cgroup.c cgroup.h \
75 lxc.h \
76 initutils.c initutils.h \
77 utils.c utils.h \
78 sync.c sync.h \
79 namespace.h namespace.c \
80 conf.c conf.h \
81 confile.c confile.h \
82 list.h \
83 state.c state.h \
84 log.c log.h \
85 attach.c attach.h \
86 criu.c criu.h \
87 \
88 network.c network.h \
89 nl.c nl.h \
90 rtnl.c rtnl.h \
91 genl.c genl.h \
92 \
93 caps.c caps.h \
94 lxcseccomp.h \
95 mainloop.c mainloop.h \
96 af_unix.c af_unix.h \
97 \
98 lxcutmp.c lxcutmp.h \
99 lxclock.h lxclock.c \
100 lxccontainer.c lxccontainer.h \
101 version.h \
102 \
103 $(LSM_SOURCES)
104
105 if ENABLE_CGMANAGER
106 liblxc_so_SOURCES += cgmanager.c
107 endif
108
109 if IS_BIONIC
110 liblxc_so_SOURCES += \
111 ../include/ifaddrs.c ../include/ifaddrs.h \
112 ../include/openpty.c ../include/openpty.h \
113 ../include/lxcmntent.c ../include/lxcmntent.h
114 endif
115
116 if !HAVE_GETLINE
117 if HAVE_FGETLN
118 liblxc_so_SOURCES += ../include/getline.c ../include/getline.h
119 endif
120 endif
121
122 AM_CFLAGS=-I$(top_srcdir)/src \
123 -DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \
124 -DLXCPATH=\"$(LXCPATH)\" \
125 -DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \
126 -DLXCINITDIR=\"$(LXCINITDIR)\" \
127 -DLIBEXECDIR=\"$(LIBEXECDIR)\" \
128 -DLXCTEMPLATEDIR=\"$(LXCTEMPLATEDIR)\" \
129 -DLOGPATH=\"$(LOGPATH)\" \
130 -DLXC_DEFAULT_CONFIG=\"$(LXC_DEFAULT_CONFIG)\" \
131 -DLXC_USERNIC_DB=\"$(LXC_USERNIC_DB)\" \
132 -DLXC_USERNIC_CONF=\"$(LXC_USERNIC_CONF)\" \
133 -DDEFAULT_CGROUP_PATTERN=\"$(DEFAULT_CGROUP_PATTERN)\" \
134 -DRUNTIME_PATH=\"$(RUNTIME_PATH)\" \
135 -DSBINDIR=\"$(SBINDIR)\"
136
137 if ENABLE_APPARMOR
138 AM_CFLAGS += -DHAVE_APPARMOR
139 endif
140
141 if ENABLE_CGMANAGER
142 AM_CFLAGS += -DHAVE_CGMANAGER
143 endif
144
145 if ENABLE_SELINUX
146 AM_CFLAGS += -DHAVE_SELINUX
147 endif
148
149 if USE_CONFIGPATH_LOGS
150 AM_CFLAGS += -DUSE_CONFIGPATH_LOGS
151 endif
152
153 if ENABLE_SECCOMP
154 AM_CFLAGS += -DHAVE_SECCOMP $(SECCOMP_CFLAGS)
155 liblxc_so_SOURCES += seccomp.c
156 endif
157
158 liblxc_so_CFLAGS = -fPIC -DPIC $(AM_CFLAGS) -pthread
159
160 liblxc_so_LDFLAGS = \
161 -pthread \
162 -shared \
163 -Wl,-soname,liblxc.so.$(firstword $(subst ., ,$(VERSION)))
164
165 liblxc_so_LDADD = $(CAP_LIBS) $(APPARMOR_LIBS) $(SELINUX_LIBS) $(SECCOMP_LIBS)
166
167 if ENABLE_CGMANAGER
168 liblxc_so_LDADD += $(CGMANAGER_LIBS) $(DBUS_LIBS) $(NIH_LIBS) $(NIH_DBUS_LIBS)
169 liblxc_so_CFLAGS += $(CGMANAGER_CFLAGS) $(DBUS_CFLAGS) $(NIH_CFLAGS) $(NIH_DBUS_CFLAGS)
170 endif
171
172 bin_SCRIPTS = lxc-checkconfig
173
174 EXTRA_DIST = \
175 lxc-ls \
176 lxc-top.lua
177
178 if ENABLE_PYTHON
179 bin_SCRIPTS += lxc-ls
180 bin_SCRIPTS += lxc-start-ephemeral
181 else
182 bin_SCRIPTS += legacy/lxc-ls
183 endif
184
185 bin_PROGRAMS = \
186 lxc-attach \
187 lxc-autostart \
188 lxc-cgroup \
189 lxc-checkpoint \
190 lxc-clone \
191 lxc-copy \
192 lxc-config \
193 lxc-console \
194 lxc-create \
195 lxc-destroy \
196 lxc-device \
197 lxc-execute \
198 lxc-freeze \
199 lxc-info \
200 lxc-monitor \
201 lxc-snapshot \
202 lxc-start \
203 lxc-stop \
204 lxc-top \
205 lxc-unfreeze \
206 lxc-unshare \
207 lxc-usernsexec \
208 lxc-wait
209
210 sbin_PROGRAMS = init.lxc
211 pkglibexec_PROGRAMS = \
212 lxc-monitord \
213 lxc-user-nic
214
215 AM_LDFLAGS = -Wl,-E
216 if ENABLE_RPATH
217 AM_LDFLAGS += -Wl,-rpath -Wl,$(libdir)
218 endif
219 LDADD=liblxc.so @CAP_LIBS@ @APPARMOR_LIBS@ @SELINUX_LIBS@ @SECCOMP_LIBS@
220
221 lxc_attach_SOURCES = lxc_attach.c
222 lxc_autostart_SOURCES = lxc_autostart.c
223 lxc_cgroup_SOURCES = lxc_cgroup.c
224 lxc_config_SOURCES = lxc_config.c
225 lxc_console_SOURCES = lxc_console.c
226 lxc_destroy_SOURCES = lxc_destroy.c
227 lxc_device_SOURCES = lxc_device.c
228 lxc_execute_SOURCES = lxc_execute.c
229 lxc_freeze_SOURCES = lxc_freeze.c
230 lxc_info_SOURCES = lxc_info.c
231 init_lxc_SOURCES = lxc_init.c
232 lxc_monitor_SOURCES = lxc_monitor.c
233 lxc_monitord_SOURCES = lxc_monitord.c
234 lxc_clone_SOURCES = lxc_clone.c
235 lxc_copy_SOURCES = lxc_copy.c
236 lxc_start_SOURCES = lxc_start.c
237 lxc_stop_SOURCES = lxc_stop.c
238 lxc_top_SOURCES = lxc_top.c
239 lxc_unfreeze_SOURCES = lxc_unfreeze.c
240 lxc_unshare_SOURCES = lxc_unshare.c
241 lxc_wait_SOURCES = lxc_wait.c
242 lxc_create_SOURCES = lxc_create.c
243 lxc_snapshot_SOURCES = lxc_snapshot.c
244 lxc_usernsexec_SOURCES = lxc_usernsexec.c
245 lxc_user_nic_SOURCES = lxc_user_nic.c network.c network.h
246 lxc_checkpoint_SOURCES = lxc_checkpoint.c
247
248 if !HAVE_GETSUBOPT
249 lxc_copy_SOURCES += ../include/getsubopt.c ../include/getsubopt.h
250 endif
251
252 if HAVE_STATIC_LIBCAP
253 sbin_PROGRAMS += init.lxc.static
254
255 init_lxc_static_SOURCES = lxc_init.c error.c log.c initutils.c caps.c
256
257 if !HAVE_GETLINE
258 if HAVE_FGETLN
259 init_lxc_static_SOURCES += ../include/getline.c
260 endif
261 endif
262
263 init_lxc_static_LDFLAGS = -static
264 init_lxc_static_LDADD = @CAP_LIBS@
265 init_lxc_static_CFLAGS = $(AM_CFLAGS) -DNO_LXC_CONF
266 endif
267
268 install-exec-local: install-soPROGRAMS
269 mkdir -p $(DESTDIR)$(datadir)/lxc
270 install -c -m 644 lxc.functions $(DESTDIR)$(datadir)/lxc
271 mv $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
272 cd $(DESTDIR)$(libdir); \
273 ln -sf liblxc.so.$(VERSION) liblxc.so.$(firstword $(subst ., ,$(VERSION))); \
274 ln -sf liblxc.so.$(firstword $(subst ., ,$(VERSION))) liblxc.so
275
276 install-exec-hook:
277 chmod u+s $(DESTDIR)$(libexecdir)/lxc/lxc-user-nic
278
279 uninstall-local:
280 $(RM) $(DESTDIR)$(libdir)/liblxc.so*