Work with builds done in a separate directory.
[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                         src/exec-remount
90
91 if ENSC_CAN_CRYPTO_WITH_DIETLIBC
92 DIETPROGS +=            src/vhashify
93 endif
94
95 noinst_HEADERS +=       src/capability-compat.h \
96                         src/util.h \
97                         src/fstool.h \
98                         src/compat-pivot_root.h \
99                         src/stack-start.h \
100                         src/vcopy-init.hc \
101                         src/vunify.h \
102                         src/vunify-init.hc \
103                         src/vhashify.h \
104                         src/vhashify-init.hc \
105                         src/vserver-visitdir.hc \
106                         src/context-sync.hc \
107                         src/attribute-util.h
108
109 pkglib_PROGRAMS +=      src/capchroot \
110                         src/chain-echo \
111                         src/chcontext-compat \
112                         src/check-unixfile \
113                         src/chroot-sh \
114                         src/fakerunlevel \
115                         src/filetime \
116                         src/keep-ctx-alive \
117                         src/lockfile \
118                         src/readlink \
119                         src/save_ctxinfo \
120                         src/secure-mount \
121                         src/mask2prefix \
122                         src/exec-ulimit \
123                         src/rpm-fake-resolver \
124                         src/vshelper-sync \
125                         src/sigexec \
126                         src/chbind-compat \
127                         src/vsysctl \
128                         src/h2ext \
129                         src/tunctl \
130                         src/exec-remount \
131                         $(src_pkglib_C99_X_PROGS) \
132                         $(src_pkglib_CXX_X_PROGS)
133
134 if ENSC_HAVE_C99_COMPILER
135 if ENSC_HAVE_CRYPTO
136 pkglib_PROGRAMS +=      src/vhashify
137 endif ENSC_HAVE_CRYPTO
138 endif ENSC_HAVE_C99_COMPILER
139
140 legacy_PROGRAMS +=      src/ifspec \
141                         src/listdevip \
142                         src/parserpmdump \
143                         src/rebootmgr \
144                         src/showperm \
145                         src/vreboot
146
147 pkglib_LTLIBRARIES +=   src/rpm-fake.la
148
149 sbin_PROGRAMS +=        src/exec-cd \
150                         src/lsxid \
151                         src/chxid \
152                         src/vps \
153                         src/showattr \
154                         src/setattr \
155                         src/reducecap \
156                         src/vdu \
157                         src/vattribute \
158                         src/vcontext \
159                         src/vlimit \
160                         src/vkill \
161                         src/vnamespace \
162                         src/vrsetup \
163                         src/vsched \
164                         src/vserver-stat \
165                         src/vserver-info \
166                         src/vuname \
167                         src/vwait \
168                         src/ncontext \
169                         src/nattribute \
170                         src/naddress \
171                         src/vdevmap \
172                         src/vtag \
173                         src/vspace \
174                         src/vmemctrl \
175                         $(src_sbin_CXX_X_PROGS)
176
177 if ENSC_HAVE_C99_COMPILER
178 sbin_PROGRAMS +=        src/vdlimit
179 endif
180
181
182 src_capchroot_SOURCES =         src/capchroot.c
183 src_capchroot_LDADD =           $(VSERVER_LDADDS)
184 src_capchroot_LDFLAGS =         $(VSERVER_LDFLGS)
185
186 src_chbind_compat_SOURCES =     src/chbind.c
187 src_chbind_compat_LDADD =       $(VSERVER_LDADDS)
188 src_chbind_compat_LDFLAGS =     $(VSERVER_LDFLGS)
189
190 src_chcontext_compat_SOURCES =  src/chcontext.c
191 src_chcontext_compat_LDADD =    $(VSERVER_LDADDS) $(LIBINTERNAL)
192 src_chcontext_compat_LDFLAGS =  $(VSERVER_LDFLGS)
193
194 src_vcontext_SOURCES            =  src/vcontext.c src/vlogin.c
195 src_vcontext_LDADD              =  $(VSERVER_LDADDS) $(LIBINTERNAL)
196 src_vcontext_LDFLAGS            =  $(VSERVER_LDFLGS)
197
198 src_vsched_SOURCES              =  src/vsched.c
199 src_vsched_LDADD                =  $(VSERVER_LDADDS) $(LIBINTERNAL)
200 src_vsched_LDFLAGS              =  $(VSERVER_LDFLGS)
201
202 src_filetime_SOURCES            =  src/filetime.c
203 src_filetime_LDADD              =  $(VSERVER_LDADDS)
204 src_filetime_LDFLAGS            =  $(VSERVER_LDFLGS)
205
206 src_chain_echo_SOURCES          =  src/chain-echo.c
207 src_chroot_sh_SOURCES           =  src/chroot-sh.c
208 src_chroot_sh_LDADD             =  $(LIBINTERNAL)
209 src_exec_cd_SOURCES             =  src/exec-cd.c
210 src_fakerunlevel_SOURCES        =  src/fakerunlevel.c
211 src_ifspec_SOURCES              =  src/ifspec.c
212 src_listdevip_SOURCES           =  src/listdevip.c
213 src_lockfile_SOURCES            =  src/lockfile.c
214 src_parserpmdump_SOURCES        =  src/parserpmdump.c
215 src_readlink_SOURCES            =  src/readlink.c
216 src_rebootmgr_SOURCES           =  src/rebootmgr.c
217 src_exec_ulimit_SOURCES         =  src/exec-ulimit.c
218 src_vshelper_sync_SOURCES       =  src/vshelper-sync.c
219
220 src_reducecap_SOURCES           =  src/reducecap.c
221 src_reducecap_LDADD             =  $(VSERVER_LDADDS)
222 src_reducecap_LDFLAGS           =  $(VSERVER_LDFLGS)
223
224 src_vkill_SOURCES               =  src/vkill.c
225 src_vkill_LDADD                 =  $(VSERVER_LDADDS)
226 src_vkill_LDFLAGS               =  $(VSERVER_LDFLGS) $(LIBINTERNAL)
227 src_vkill_CPPFLAGS              =  $(AM_CPPFLAGS) -DLEGACYDIR=\"$(legacydir)\"
228
229 src_vlimit_SOURCES              =  src/vlimit.c
230 src_vlimit_LDADD                =  $(VSERVER_LDADDS)
231 src_vlimit_LDFLAGS              =  $(VSERVER_LDFLGS)
232
233 src_save_ctxinfo_SOURCES        =  src/save_ctxinfo.c
234 src_save_ctxinfo_LDADD          =  $(VSERVER_LDADDS)
235 src_save_ctxinfo_LDFLAGS        =  $(VSERVER_LDFLGS)
236
237 src_vdu_SOURCES                 =  src/vdu.c
238 src_vdu_LDADD                   =  $(VSERVER_LDADDS) $(LIBINTERNAL)
239 src_vdu_LDFLAGS                 =  $(VSERVER_LDFLGS)
240
241 src_vreboot_SOURCES =           src/vreboot.c
242
243 src_secure_mount_SOURCES =      src/secure-mount.c
244 src_secure_mount_LDADD =        $(VSERVER_LDADDS)
245 src_secure_mount_LDFLAGS =      $(VSERVER_LDFLGS)
246
247 src_vattribute_SOURCES =        src/vattribute.c
248 src_vattribute_LDADD =          $(VSERVER_LDADDS)
249 src_vattribute_LDFLAGS =        $(VSERVER_LDFLGS)
250
251 src_vnamespace_SOURCES =        src/vnamespace.c
252 src_vnamespace_LDADD =          $(VSERVER_LDADDS) $(LIBINTERNAL)
253 src_vnamespace_LDFLAGS =        $(VSERVER_LDFLGS)
254
255 src_rpm_fake_resolver_SOURCES   =  src/rpm-fake-resolver.c
256 src_rpm_fake_resolver_LDADD     =  $(VSERVER_LDADDS)
257 src_rpm_fake_resolver_LDFLAGS   =  $(VSERVER_LDFLGS)
258
259 src_mask2prefix_SOURCES         =  src/mask2prefix.c
260
261 src_vps_SOURCES                 =  src/vps.c
262 src_vps_LDADD                   =  $(LIBINTERNAL) $(VSERVER_LDADDS)
263 src_vps_LDFLAGS                 =  $(VSERVER_LDFLGS)
264
265 src_vserver_info_SOURCES        =  src/vserver-info.c
266 src_vserver_info_LDADD          =  $(LIBINTERNAL) $(VSERVER_LDADDS)
267 src_vserver_info_LDFLAGS        =  $(VSERVER_LDFLGS)
268
269 src_vserver_stat_SOURCES        =  src/vserver-stat.c
270 src_vserver_stat_LDADD          =  $(LIBINTERNAL) $(VSERVER_LDADDS) $(LIBENSCVECTOR)
271 src_vserver_stat_LDFLAGS        =  $(VSERVER_LDFLGS)
272
273 src_lsxid_SOURCES               =  src/fstool.c src/lsxid.c
274 src_lsxid_LDADD                 =  $(LIBINTERNAL) $(VSERVER_LDADDS) $(LIBENSCVECTOR)
275 src_lsxid_LDFLAGS               =  $(VSERVER_LDFLGS) 
276
277 src_chxid_SOURCES               =  src/fstool.c src/chxid.c
278 src_chxid_LDADD                 =  $(LIBINTERNAL) $(VSERVER_LDADDS)
279 src_chxid_LDFLAGS               =  $(VSERVER_LDFLGS)
280
281 src_showattr_SOURCES            =  src/fstool.c src/showattr.c
282 src_showattr_LDADD              =  $(LIBINTERNAL) $(VSERVER_LDADDS)
283 src_showattr_LDFLAGS            =  $(VSERVER_LDFLGS)
284
285 src_setattr_SOURCES             =  src/fstool.c src/setattr.c
286 src_setattr_LDADD               =  $(LIBINTERNAL) $(VSERVER_LDADDS)
287 src_setattr_LDFLAGS             =  $(VSERVER_LDFLGS)
288
289 src_keep_ctx_alive_SOURCES =    src/keep-ctx-alive.c
290 src_keep_ctx_alive_LDADD =      $(VSERVER_LDADDS)
291 src_keep_ctx_alive_LDFLAGS =    $(VSERVER_LDFLGS)
292
293
294 src_vcopy_SOURCES =             src/vcopy.c
295 src_vcopy_LDADD =               $(LIBINTERNAL) $(VSERVER_LDADDS)
296 src_vcopy_LDFLAGS =             $(VSERVER_LDFLGS)
297
298 src_vunify_SOURCES =            src/vunify.c
299 src_vunify_LDADD =              $(LIBINTERNAL) $(VSERVER_LDADDS)
300 src_vunify_LDFLAGS =            $(VSERVER_LDFLGS)
301
302 src_vhashify_SOURCES =          src/vhashify.c
303 src_vhashify_CFLAGS =           $(AM_CFLAGS) $(ENSC_CRYPTO_CFLAGS)
304 if ENSC_CAN_CRYPTO_WITH_DIETLIBC
305 src_vhashify_LDADD =            $(LIBINTERNAL) $(LIBENSCVECTOR) $(ENSC_CRYPTO_LIB) $(VSERVER_LDADDS)
306 src_vhashify_LDFLAGS =          $(VSERVER_LDFLGS)
307 else
308 src_vhashify_LDADD =            $(LIBINTERNAL_GLIBC) $(LIBENSCVECTOR_GLIBC) $(LIBVSERVER_GLIBC) $(ENSC_CRYPTO_LIB)
309 src_vhashify_LDFLAGS =           -Wl,--as-needed
310 endif
311
312 src_vuname_SOURCES =            src/vuname.c
313 src_vuname_LDADD =              $(VSERVER_LDADDS)
314 src_vuname_LDFLAGS =            $(VSERVER_LDFLGS)
315
316 src_rpm_fake_la_SOURCES         =  src/rpm-fake.c
317 src_rpm_fake_la_CFLAGS          =  $(AM_CFLAGS)
318 src_rpm_fake_la_LDFLAGS         =  -module -avoid-version -rpath $(pkglibdir)
319 src_rpm_fake_la_LIBADD          =  $(LIBVSERVER_GLIBC) -ldl
320
321 src_vdlimit_SOURCES             = src/vdlimit.c
322 src_vdlimit_LDADD               = $(VSERVER_LDADDS)
323 src_vdlimit_LDFLAGS             = $(VSERVER_LDFLGS)
324
325 src_vwait_SOURCES               = src/vwait.c
326 src_vwait_LDADD                 = $(VSERVER_LDADDS)
327 src_vwait_LDFLAGS               = $(VSERVER_LDFLGS)
328
329 src_ncontext_SOURCES            = src/ncontext.c
330 src_ncontext_LDADD              = $(VSERVER_LDADDS) $(LIBINTERNAL)
331 src_ncontext_LDFLAGS            = $(VSERVER_LDFLGS)
332
333 src_nattribute_SOURCES          = src/nattribute.c
334 src_nattribute_LDADD            = $(VSERVER_LDADDS)
335 src_nattribute_LDFLAGS          = $(VSERVER_LDFLGS)
336
337 src_naddress_SOURCES            = src/naddress.c
338 src_naddress_LDADD              = $(VSERVER_LDADDS) $(LIBINTERNAL)
339 src_naddress_LDFLAGS            = $(VSERVER_LDFLGS)
340
341 src_vdevmap_SOURCES             = src/vdevmap.c
342 src_vdevmap_LDADD               = $(VSERVER_LDADDS) $(LIBINTERNAL)
343 src_vdevmap_LDFLAGS             = $(VSERVER_LDFLGS)
344
345 src_vsysctl_SOURCES             = src/vsysctl.c
346 src_vsysctl_LDADD               = $(VSERVER_LDADDS)
347 src_vsysctl_LDFLAGS             = $(VSERVER_LDFLGS)
348
349 src_vclone_SOURCES              = src/vclone.c
350 src_vclone_LDADD                = $(LIBINTERNAL) $(VSERVER_LDADDS)
351 src_vclone_LDFLAGS              = $(VSERVER_LDLFGS)
352
353 src_h2ext_SOURCES               = src/h2ext.c
354 src_h2ext_LDADD                 = $(LIBINTERNAL) $(VSERVER_LDADDS)
355 src_h2ext_LDFLAGS               = $(VSERVER_LDFLGS)
356
357 src_vtag_SOURCES                = src/vtag.c
358 src_vtag_LDADD                  = $(VSERVER_LDADDS)
359 src_vtag_LDFLAGS                = $(VSERVER_LDADDS)
360
361 src_vspace_SOURCES              = src/vspace.c
362 src_vspace_LDADD                = $(VSERVER_LDADDS) $(LIBINTERNAL)
363 src_vspace_LDFLAGS              = $(VSERVER_LDFLGS)
364
365 src_vmemctrl_SOURCES            = src/vmemctrl.c
366 src_vmemctrl_LDADD              = $(VSERVER_LDADDS) $(LIBINTERNAL)
367 src_vmemctrl_LDFLAGS            = $(VSERVER_LDFLGS)
368
369 src_tunctl_SOURCES              = src/tunctl.c
370 src_tunctl_LDADD                = $(VSERVER_LDADDS) $(LIBINTERNAL)
371 src_tunctl_LDFLAGS              = $(VSERVER_LDFLGS)
372
373 src_exec_remount_SOURCES        = src/exec-remount.c
374 src_exec_remount_LDADD          = $(VSERVER_LDADDS)
375 src_exec_remount_LDFLAGS        = $(VSERVER_LDFLGS)
376
377 EXTRA_PROGRAMS +=               $(src_sbin_CXX_PROGS) $(src_pkglib_CXX_PROGS)
378
379 TESTS_ENVIRONMENT +=            srctestsuitedir=$(top_builddir)/src/testsuite
380
381 if ENSC_HAVE_C99_COMPILER
382 src_sbin_C99_X_PROGS =          $(src_sbin_C99_PROGS)
383 src_pkglib_C99_X_PROGS =        $(src_pkglib_C99_PROGS)
384 else
385 src_sbin_C99_X_PROGS =
386 src_pkglib_C99_X_PROGS =  
387 endif
388
389 if ENSC_HAVE_CXX_COMPILER
390 src_sbin_CXX_X_PROGS =          $(src_sbin_CXX_PROGS)
391 src_pkglib_CXX_X_PROGS =        $(src_pkglib_CXX_PROGS)
392 else
393 src_sbin_CXX_X_PROGS =
394 src_pkglib_CXX_X_PROGS =  
395 endif
396
397 install-exec-hook:              src_install_exec_hook
398
399 src_install_exec_hook:
400                                 -rm -f $(DESTDIR)$(pkglibdir)/rpm-fake.a $(DESTDIR)$(pkglibdir)/rpm-fake.la
401
402 include $(top_srcdir)/src/testsuite/Makefile-files