- use internal lib/virtual.h on default (controlled by
[util-vserver.git] / util-vserver / Makefile.am
1 ## $Id$
2
3 # Copyright (C) 2003 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 ACLOCAL_AMFLAGS         =  -I m4
21
22 CVS2CL_AMFLAGS          =  $(CVS2CL_TAG) -U cvsusers.map --show-dead
23 CVS2CL_ALLFLAGS        :=  $(CVS2CL_AMFLAGS) $(CVS2CL_FLAGS)
24
25 sysvdir                 =  $(sysconfdir)/init.d
26 vservercfgdir           =  $(sysconfdir)/vservers
27
28 include_HEADERS         =  $(lib_HDRS)
29 noinst_HEADERS          =  $(src_HDRS) $(lib_XHDRS) compat.h
30
31 lib_LIBRARIES           =  $(lib_lib_LIBS)
32
33 pkglib_SCRIPTS          =  $(distrib_SCRPTS) $(scripts_SCRPTS) $(src_pkglib_SCRPTS)
34 pkglib_DATA             =  $(distrib_DAT) $(scriptscfg_DATA)
35 pkglib_PROGRAMS         =  $(src_pkglib_PRGS)
36
37 sbin_SCRIPTS            =  $(scripts_PRGS) $(linuxconf_SCRPTS)
38 sbin_PROGRAMS           =  $(src_sbin_PRGS)
39 noinst_PROGRAMS         =  $(test_PRGS)
40
41 sysv_SCRIPTS            =  $(sysv_SCRPTS)
42 sysconf_DATA            =  $(sysv_CFG)
43 vservercfg_DATA         =  $(linuxconf_cfg_DTA)
44
45 BUILT_SOURCES           =  linuxcaps.h linuxvirtual.h
46
47 man_MANS                =  $(man_DATMAN) $(linuxconf_DATMAN)
48
49 m4_FILES                =  m4/ensc_cflags.m4 m4/ensc_kerneldir.m4 \
50                            m4/ensc_changelog.m4 m4/ensc_uv_vrootdir.m4
51
52 EXTRA_DIST              =  $(distrib_SCRPTS) $(distrib_DAT) \
53                            $(sysv_XTRAS) $(sysv_CFG) \
54                            $(doc_DAT) $(man_DATMAN) $(linuxconf_XTRAS) \
55                            $(scripts_SCRPTS) $(scripts_XTRAS) \
56                            $(m4_FILES) \
57                            util-vserver.spec THANKS
58
59 AM_CPPFLAGS             =  -I $(top_srcdir)/lib -D VERSION=\"$(VERSION)\" -D PKGLIBDIR=\"$(pkglibdir)\" -D _GNU_SOURCE
60 AM_CFLAGS               =  -Wall -pedantic
61
62 CLEANFILES              =  $(sysv_GENSCRPTS) $(scripts_GENSCRPTS) \
63                            $(linuxconf_GENFILES) \
64                            $(BUILT_SOURCES)
65
66
67 linuxcaps.h:    ${kernelincludedir}/linux/capability.h Makefile
68                 @rm -f $@
69                 echo '#include <stdint.h>' >$@.tmp
70                 sed -e 's!^#include .*!!g;s!\<__u32\>!uint32_t!g;s!\<__user\>!!g;' $< >>$@.tmp
71                 @-chmod --reference $< $@.tmp &>/dev/null
72                 mv -f $@.tmp $@
73                 @chmod a-w $@
74
75 linuxvirtual.h:
76 if ENSC_ENABLE_INTERNAL_HEADERS
77                 ln -sf '$(top_srcdir)/lib/virtual.h' '$@'
78 else
79                 ln -sf '$(kernelincludedir)/linux/virtual.h' '$@' && test -e '$@' || \
80                 ln -sf '$(top_srcdir)/lib/virtual.h' '$@'
81 endif
82
83 include $(top_srcdir)/lib/Makefile-files
84 include $(top_srcdir)/src/Makefile-files
85 include $(top_srcdir)/distrib/Makefile-files
86 include $(top_srcdir)/doc/Makefile-files
87 include $(top_srcdir)/man/Makefile-files
88 include $(top_srcdir)/scripts/Makefile-files
89 include $(top_srcdir)/tests/Makefile-files
90 include $(top_srcdir)/sysv/Makefile-files
91 include $(top_srcdir)/linuxconf/Makefile-files
92
93 include $(top_srcdir)/m4/gpgsig.am
94 include $(top_srcdir)/m4/validate.am
95 include $(top_srcdir)/m4/changelog.am