New debootstrap.
[util-vserver.git] / src / Makefile-files
1 ## $Id$  -*- makefile -*-
2
3 ## Copyright (C) 2003,2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
4 ##  
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 2, or (at your option)
8 ## any later version.
9 ##  
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 ## GNU General Public License for more details.
14 ##  
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program; if not, write to the Free Software
17 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 ##  
19
20 src_sbin_CXX_PROGS =    
21 src_pkglib_CXX_PROGS =  
22
23 src_pkglib_C99_PROGS =  src/vunify src/vcopy src/vclone
24
25
26 AM_INSTALLCHECK_STD_OPTIONS_EXEMPT += \
27                         src/parserpmdump \
28                         src/showperm \
29                         src/vbuild \
30                         src/vcheck \
31                         src/vreboot \
32                         src/save_ctxinfo \
33                         src/mask2prefix \
34                         src/ifspec \
35                         src/rebootmgr \
36                         src/vfiles
37
38 DIETPROGS +=            src/chcontext-compat \
39                         src/capchroot \
40                         src/chain-echo \
41                         src/check-unixfile \
42                         src/chroot-sh \
43                         src/filetime \
44                         src/lockfile \
45                         src/readlink \
46                         src/secure-mount \
47                         src/save_ctxinfo \
48                         src/mask2prefix \
49                         src/chbind-compat \
50                         src/exec-cd \
51                         src/fakerunlevel \
52                         src/keep-ctx-alive \
53                         src/exec-ulimit \
54                         src/vps \
55                         src/lsxid \
56                         src/chxid \
57                         src/reducecap \
58                         src/showattr \
59                         src/setattr \
60                         src/sigexec \
61                         src/vattribute \
62                         src/vlimit \
63                         src/vnamespace \
64                         src/vunify \
65                         src/vuname \
66                         src/rpm-fake-resolver \
67                         src/vcontext \
68                         src/vcopy \
69                         src/vkill \
70                         src/vsched \
71                         src/vshelper-sync \
72                         src/vrsetup \
73                         src/vserver-stat \
74                         src/vserver-info \
75                         src/vdlimit \
76                         src/vdu \
77                         src/vwait \
78                         src/ncontext \
79                         src/nattribute \
80                         src/naddress \
81                         src/vdevmap \
82                         src/vsysctl \
83                         src/vclone \
84                         src/h2ext \
85                         src/vtag \
86                         src/vspace \
87                         src/vmemctrl \
88                         src/tunctl
89
90 if ENSC_CAN_CRYPTO_WITH_DIETLIBC
91 DIETPROGS +=            src/vhashify
92 endif
93
94 noinst_HEADERS +=       src/capability-compat.h \
95                         src/util.h \
96                         src/fstool.h \
97                         src/compat-pivot_root.h \
98                         src/stack-start.h \
99                         src/vcopy-init.hc \
100                         src/vunify.h \
101                         src/vunify-init.hc \
102                         src/vhashify.h \
103                         src/vhashify-init.hc \
104                         src/vserver-visitdir.hc \
105                         src/context-sync.hc \
106                         src/attribute-util.h
107
108 pkglib_PROGRAMS +=      src/capchroot \
109                         src/chain-echo \
110                         src/chcontext-compat \
111                         src/check-unixfile \
112                         src/chroot-sh \
113                         src/fakerunlevel \
114                         src/filetime \
115                         src/keep-ctx-alive \
116                         src/lockfile \
117                         src/readlink \
118                         src/save_ctxinfo \
119                         src/secure-mount \
120                         src/mask2prefix \
121                         src/exec-ulimit \
122                         src/rpm-fake-resolver \
123                         src/vshelper-sync \
124                         src/sigexec \
125                         src/chbind-compat \
126                         src/vsysctl \
127                         src/h2ext \
128                         src/tunctl \
129                         $(src_pkglib_C99_X_PROGS) \
130                         $(src_pkglib_CXX_X_PROGS)
131
132 if ENSC_HAVE_C99_COMPILER
133 if ENSC_HAVE_CRYPTO
134 pkglib_PROGRAMS +=      src/vhashify
135 endif ENSC_HAVE_CRYPTO
136 endif ENSC_HAVE_C99_COMPILER
137
138 legacy_PROGRAMS +=      src/ifspec \
139                         src/listdevip \
140                         src/parserpmdump \
141                         src/rebootmgr \
142                         src/showperm \
143                         src/vreboot
144
145 pkglib_LTLIBRARIES +=   src/rpm-fake.la
146
147 sbin_PROGRAMS +=        src/exec-cd \
148                         src/lsxid \
149                         src/chxid \
150                         src/vps \
151                         src/showattr \
152                         src/setattr \
153                         src/reducecap \
154                         src/vdu \
155                         src/vattribute \
156                         src/vcontext \
157                         src/vlimit \
158                         src/vkill \
159                         src/vnamespace \
160                         src/vrsetup \
161                         src/vsched \
162                         src/vserver-stat \
163                         src/vserver-info \
164                         src/vuname \
165                         src/vwait \
166                         src/ncontext \
167                         src/nattribute \
168                         src/naddress \
169                         src/vdevmap \
170                         src/vtag \
171                         src/vspace \
172                         src/vmemctrl \
173                         $(src_sbin_CXX_X_PROGS)
174
175 if ENSC_HAVE_C99_COMPILER
176 sbin_PROGRAMS +=        src/vdlimit
177 endif
178
179
180 src_capchroot_SOURCES =         src/capchroot.c
181 src_capchroot_LDADD =           $(VSERVER_LDADDS)
182 src_capchroot_LDFLAGS =         $(VSERVER_LDFLGS)
183
184 src_chbind_compat_SOURCES =     src/chbind.c
185 src_chbind_compat_LDADD =       $(VSERVER_LDADDS)
186 src_chbind_compat_LDFLAGS =     $(VSERVER_LDFLGS)
187
188 src_chcontext_compat_SOURCES =  src/chcontext.c
189 src_chcontext_compat_LDADD =    $(VSERVER_LDADDS) $(LIBINTERNAL)
190 src_chcontext_compat_LDFLAGS =  $(VSERVER_LDFLGS)
191
192 src_vcontext_SOURCES            =  src/vcontext.c src/vlogin.c
193 src_vcontext_LDADD              =  $(VSERVER_LDADDS) $(LIBINTERNAL)
194 src_vcontext_LDFLAGS            =  $(VSERVER_LDFLGS)
195
196 src_vsched_SOURCES              =  src/vsched.c
197 src_vsched_LDADD                =  $(VSERVER_LDADDS) $(LIBINTERNAL)
198 src_vsched_LDFLAGS              =  $(VSERVER_LDFLGS)
199
200 src_filetime_SOURCES            =  src/filetime.c
201 src_filetime_LDADD              =  $(VSERVER_LDADDS)
202 src_filetime_LDFLAGS            =  $(VSERVER_LDFLGS)
203
204 src_chain_echo_SOURCES          =  src/chain-echo.c
205 src_chroot_sh_SOURCES           =  src/chroot-sh.c
206 src_chroot_sh_LDADD             =  $(LIBINTERNAL)
207 src_exec_cd_SOURCES             =  src/exec-cd.c
208 src_fakerunlevel_SOURCES        =  src/fakerunlevel.c
209 src_ifspec_SOURCES              =  src/ifspec.c
210 src_listdevip_SOURCES           =  src/listdevip.c
211 src_lockfile_SOURCES            =  src/lockfile.c
212 src_parserpmdump_SOURCES        =  src/parserpmdump.c
213 src_readlink_SOURCES            =  src/readlink.c
214 src_rebootmgr_SOURCES           =  src/rebootmgr.c
215 src_exec_ulimit_SOURCES         =  src/exec-ulimit.c
216 src_vshelper_sync_SOURCES       =  src/vshelper-sync.c
217
218 src_reducecap_SOURCES           =  src/reducecap.c
219 src_reducecap_LDADD             =  $(VSERVER_LDADDS)
220 src_reducecap_LDFLAGS           =  $(VSERVER_LDFLGS)
221
222 src_vkill_SOURCES               =  src/vkill.c
223 src_vkill_LDADD                 =  $(VSERVER_LDADDS)
224 src_vkill_LDFLAGS               =  $(VSERVER_LDFLGS) $(LIBINTERNAL)
225 src_vkill_CPPFLAGS              =  $(AM_CPPFLAGS) -DLEGACYDIR=\"$(legacydir)\"
226
227 src_vlimit_SOURCES              =  src/vlimit.c
228 src_vlimit_LDADD                =  $(VSERVER_LDADDS)
229 src_vlimit_LDFLAGS              =  $(VSERVER_LDFLGS)
230
231 src_save_ctxinfo_SOURCES        =  src/save_ctxinfo.c
232 src_save_ctxinfo_LDADD          =  $(VSERVER_LDADDS)
233 src_save_ctxinfo_LDFLAGS        =  $(VSERVER_LDFLGS)
234
235 src_vdu_SOURCES                 =  src/vdu.c
236 src_vdu_LDADD                   =  $(VSERVER_LDADDS) $(LIBINTERNAL)
237 src_vdu_LDFLAGS                 =  $(VSERVER_LDFLGS)
238
239 src_vreboot_SOURCES =           src/vreboot.c
240
241 src_secure_mount_SOURCES =      src/secure-mount.c
242 src_secure_mount_LDADD =        $(VSERVER_LDADDS)
243 src_secure_mount_LDFLAGS =      $(VSERVER_LDFLGS)
244
245 src_vattribute_SOURCES =        src/vattribute.c
246 src_vattribute_LDADD =          $(VSERVER_LDADDS)
247 src_vattribute_LDFLAGS =        $(VSERVER_LDFLGS)
248
249 src_vnamespace_SOURCES =        src/vnamespace.c
250 src_vnamespace_LDADD =          $(VSERVER_LDADDS) $(LIBINTERNAL)
251 src_vnamespace_LDFLAGS =        $(VSERVER_LDFLGS)
252
253 src_rpm_fake_resolver_SOURCES   =  src/rpm-fake-resolver.c
254 src_rpm_fake_resolver_LDADD     =  $(VSERVER_LDADDS)
255 src_rpm_fake_resolver_LDFLAGS   =  $(VSERVER_LDFLGS)
256
257 src_mask2prefix_SOURCES         =  src/mask2prefix.c
258
259 src_vps_SOURCES                 =  src/vps.c
260 src_vps_LDADD                   =  $(LIBINTERNAL) $(VSERVER_LDADDS)
261 src_vps_LDFLAGS                 =  $(VSERVER_LDFLGS)
262
263 src_vserver_info_SOURCES        =  src/vserver-info.c
264 src_vserver_info_LDADD          =  $(LIBINTERNAL) $(VSERVER_LDADDS)
265 src_vserver_info_LDFLAGS        =  $(VSERVER_LDFLGS)
266
267 src_vserver_stat_SOURCES        =  src/vserver-stat.c
268 src_vserver_stat_LDADD          =  $(LIBINTERNAL) $(VSERVER_LDADDS) $(LIBENSCVECTOR)
269 src_vserver_stat_LDFLAGS        =  $(VSERVER_LDFLGS)
270
271 src_lsxid_SOURCES               =  src/fstool.c src/lsxid.c
272 src_lsxid_LDADD                 =  $(LIBINTERNAL) $(VSERVER_LDADDS) $(LIBENSCVECTOR)
273 src_lsxid_LDFLAGS               =  $(VSERVER_LDFLGS) 
274
275 src_chxid_SOURCES               =  src/fstool.c src/chxid.c
276 src_chxid_LDADD                 =  $(LIBINTERNAL) $(VSERVER_LDADDS)
277 src_chxid_LDFLAGS               =  $(VSERVER_LDFLGS)
278
279 src_showattr_SOURCES            =  src/fstool.c src/showattr.c
280 src_showattr_LDADD              =  $(LIBINTERNAL) $(VSERVER_LDADDS)
281 src_showattr_LDFLAGS            =  $(VSERVER_LDFLGS)
282
283 src_setattr_SOURCES             =  src/fstool.c src/setattr.c
284 src_setattr_LDADD               =  $(LIBINTERNAL) $(VSERVER_LDADDS)
285 src_setattr_LDFLAGS             =  $(VSERVER_LDFLGS)
286
287 src_keep_ctx_alive_SOURCES =    src/keep-ctx-alive.c
288 src_keep_ctx_alive_LDADD =      $(VSERVER_LDADDS)
289 src_keep_ctx_alive_LDFLAGS =    $(VSERVER_LDFLGS)
290
291
292 src_vcopy_SOURCES =             src/vcopy.c
293 src_vcopy_LDADD =               $(LIBINTERNAL) $(VSERVER_LDADDS)
294 src_vcopy_LDFLAGS =             $(VSERVER_LDFLGS)
295
296 src_vunify_SOURCES =            src/vunify.c
297 src_vunify_LDADD =              $(LIBINTERNAL) $(VSERVER_LDADDS)
298 src_vunify_LDFLAGS =            $(VSERVER_LDFLGS)
299
300 src_vhashify_SOURCES =          src/vhashify.c
301 src_vhashify_CFLAGS =           $(AM_CFLAGS) $(ENSC_CRYPTO_CFLAGS)
302 if ENSC_CAN_CRYPTO_WITH_DIETLIBC
303 src_vhashify_LDADD =            $(LIBINTERNAL) $(LIBENSCVECTOR) $(ENSC_CRYPTO_LIB) $(VSERVER_LDADDS)
304 src_vhashify_LDFLAGS =          $(VSERVER_LDFLGS)
305 else
306 src_vhashify_LDADD =            $(LIBINTERNAL_GLIBC) $(LIBENSCVECTOR_GLIBC) $(LIBVSERVER_GLIBC) $(ENSC_CRYPTO_LIB)
307 src_vhashify_LDFLAGS =           -Wl,--as-needed
308 endif
309
310 src_vuname_SOURCES =            src/vuname.c
311 src_vuname_LDADD =              $(VSERVER_LDADDS)
312 src_vuname_LDFLAGS =            $(VSERVER_LDFLGS)
313
314 src_rpm_fake_la_SOURCES         =  src/rpm-fake.c
315 src_rpm_fake_la_CFLAGS          =  $(AM_CFLAGS)
316 src_rpm_fake_la_LDFLAGS         =  -module -avoid-version -rpath $(pkglibdir)
317 src_rpm_fake_la_LIBADD          =  $(LIBVSERVER_GLIBC) -ldl
318
319 src_vdlimit_SOURCES             = src/vdlimit.c
320 src_vdlimit_LDADD               = $(VSERVER_LDADDS)
321 src_vdlimit_LDFLAGS             = $(VSERVER_LDFLGS)
322
323 src_vwait_SOURCES               = src/vwait.c
324 src_vwait_LDADD                 = $(VSERVER_LDADDS)
325 src_vwait_LDFLAGS               = $(VSERVER_LDFLGS)
326
327 src_ncontext_SOURCES            = src/ncontext.c
328 src_ncontext_LDADD              = $(VSERVER_LDADDS) $(LIBINTERNAL)
329 src_ncontext_LDFLAGS            = $(VSERVER_LDFLGS)
330
331 src_nattribute_SOURCES          = src/nattribute.c
332 src_nattribute_LDADD            = $(VSERVER_LDADDS)
333 src_nattribute_LDFLAGS          = $(VSERVER_LDFLGS)
334
335 src_naddress_SOURCES            = src/naddress.c
336 src_naddress_LDADD              = $(VSERVER_LDADDS) $(LIBINTERNAL)
337 src_naddress_LDFLAGS            = $(VSERVER_LDFLGS)
338
339 src_vdevmap_SOURCES             = src/vdevmap.c
340 src_vdevmap_LDADD               = $(VSERVER_LDADDS) $(LIBINTERNAL)
341 src_vdevmap_LDFLAGS             = $(VSERVER_LDFLGS)
342
343 src_vsysctl_SOURCES             = src/vsysctl.c
344 src_vsysctl_LDADD               = $(VSERVER_LDADDS)
345 src_vsysctl_LDFLAGS             = $(VSERVER_LDFLGS)
346
347 src_vclone_SOURCES              = src/vclone.c
348 src_vclone_LDADD                = $(LIBINTERNAL) $(VSERVER_LDADDS)
349 src_vclone_LDFLAGS              = $(VSERVER_LDLFGS)
350
351 src_h2ext_SOURCES               = src/h2ext.c
352 src_h2ext_LDADD                 = $(LIBINTERNAL) $(VSERVER_LDADDS)
353 src_h2ext_LDFLAGS               = $(VSERVER_LDFLGS)
354
355 src_vtag_SOURCES                = src/vtag.c
356 src_vtag_LDADD                  = $(VSERVER_LDADDS)
357 src_vtag_LDFLAGS                = $(VSERVER_LDADDS)
358
359 src_vspace_SOURCES              = src/vspace.c
360 src_vspace_LDADD                = $(VSERVER_LDADDS) $(LIBINTERNAL)
361 src_vspace_LDFLAGS              = $(VSERVER_LDFLGS)
362
363 src_vmemctrl_SOURCES            = src/vmemctrl.c
364 src_vmemctrl_LDADD              = $(VSERVER_LDADDS) $(LIBINTERNAL)
365 src_vmemctrl_LDFLAGS            = $(VSERVER_LDFLGS)
366
367 src_tunctl_SOURCES              = src/tunctl.c
368 src_tunctl_LDADD                = $(VSERVER_LDADDS) $(LIBINTERNAL)
369 src_tunctl_LDFLAGS              = $(VSERVER_LDFLGS)
370
371 EXTRA_PROGRAMS +=               $(src_sbin_CXX_PROGS) $(src_pkglib_CXX_PROGS)
372
373 TESTS_ENVIRONMENT +=            srctestsuitedir=$(top_builddir)/src/testsuite
374
375 if ENSC_HAVE_C99_COMPILER
376 src_sbin_C99_X_PROGS =          $(src_sbin_C99_PROGS)
377 src_pkglib_C99_X_PROGS =        $(src_pkglib_C99_PROGS)
378 else
379 src_sbin_C99_X_PROGS =
380 src_pkglib_C99_X_PROGS =  
381 endif
382
383 if ENSC_HAVE_CXX_COMPILER
384 src_sbin_CXX_X_PROGS =          $(src_sbin_CXX_PROGS)
385 src_pkglib_CXX_X_PROGS =        $(src_pkglib_CXX_PROGS)
386 else
387 src_sbin_CXX_X_PROGS =
388 src_pkglib_CXX_X_PROGS =  
389 endif
390
391 install-exec-hook:              src_install_exec_hook
392
393 src_install_exec_hook:
394                                 -rm -f $(DESTDIR)$(pkglibdir)/rpm-fake.a $(DESTDIR)$(pkglibdir)/rpm-fake.la
395
396 include $(top_srcdir)/src/testsuite/Makefile-files