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