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