1ef9cc924b356f9fb260c413d90a3ca84043b367
[util-vserver.git] / Makefile.am
1 ## $Id: Makefile.am,v 1.1.4.12 2004/02/09 23:18:59 ensc Exp $
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 legacydir               =  $(pkglibdir)/legacy
28
29 include_HEADERS         =  $(lib_HDRS)
30 noinst_HEADERS          =  $(src_HDRS) $(lib_XHDRS) compat.h
31
32 lib_LIBRARIES           =  $(lib_lib_LIBS)
33
34 pkglib_SCRIPTS          =  $(distrib_SCRPTS) $(scripts_SCRPTS) $(src_pkglib_SCRPTS)
35 pkglib_DATA             =  $(distrib_DAT) $(scriptscfg_DATA)
36 pkglib_PROGRAMS         =  $(src_pkglib_PRGS)
37
38 legacy_SCRIPTS          =  $(scripts_LEGSCRPTS)
39
40 sbin_SCRIPTS            =  $(scripts_PRGS) $(linuxconf_SCRPTS)
41 sbin_PROGRAMS           =  $(src_sbin_PRGS)
42 noinst_PROGRAMS         =  $(test_PRGS)
43
44 sysv_SCRIPTS            =  $(sysv_SCRPTS)
45 sysconf_DATA            =  $(sysv_CFG)
46 vservercfg_DATA         =  $(linuxconf_cfg_DTA)
47
48 BUILT_SOURCES           =  linuxcaps.h linuxvirtual.h
49
50 man_MANS                =  $(man_DATMAN) $(linuxconf_DATMAN)
51
52 m4_FILES                =  m4/ensc_cflags.m4 m4/ensc_kerneldir.m4 \
53                            m4/ensc_changelog.m4 m4/ensc_uv_vrootdir.m4
54
55 EXTRA_DIST              =  $(distrib_SCRPTS) $(distrib_DAT) \
56                            $(sysv_XTRAS) $(sysv_CFG) \
57                            $(doc_DAT) $(man_DATMAN) $(linuxconf_XTRAS) \
58                            $(scripts_SCRPTS) $(scripts_XTRAS) \
59                            $(m4_FILES) \
60                            util-vserver.spec THANKS
61
62 AM_CPPFLAGS             =  -I $(top_srcdir)/lib -D VERSION=\"$(VERSION)\" -D PKGLIBDIR=\"$(pkglibdir)\" -D _GNU_SOURCE
63 AM_CFLAGS               =  -Wall -pedantic
64
65 CLEANFILES              =  $(sysv_GENSCRPTS) $(scripts_GENSCRPTS) \
66                            $(linuxconf_GENFILES) $(src_GENFILES) \
67                            $(BUILT_SOURCES)
68
69
70 linuxcaps.h:    ${kernelincludedir}/linux/capability.h Makefile
71                 @rm -f $@
72                 echo '#include <stdint.h>' >$@.tmp
73                 sed -e 's!^#include .*!!g;s!\<__u32\>!uint32_t!g;s!\<__user\>!!g;' $< >>$@.tmp
74                 @-chmod --reference $< $@.tmp &>/dev/null
75                 mv -f $@.tmp $@
76                 @chmod a-w $@
77
78 linuxvirtual.h:
79 if ENSC_ENABLE_INTERNAL_HEADERS
80                 ln -sf '$(top_srcdir)/lib/virtual.h' '$@'
81 else
82                 ln -sf '$(kernelincludedir)/linux/virtual.h' '$@' && test -e '$@' || \
83                 ln -sf '$(top_srcdir)/lib/virtual.h' '$@'
84 endif
85
86 install-exec-hook:
87         cd $(DESTDIR)$(sbindir) && $(LN_S) vuseradd vadduser
88         cd $(DESTDIR)$(sbindir) && $(LN_S) vuserdel vdeluser
89
90 install-data-hook:
91         cd $(DESTDIR)$(sysvdir) && $(LN_S) vservers vserver-init
92
93 include $(top_srcdir)/lib/Makefile-files
94 include $(top_srcdir)/src/Makefile-files
95 include $(top_srcdir)/distrib/Makefile-files
96 include $(top_srcdir)/doc/Makefile-files
97 include $(top_srcdir)/man/Makefile-files
98 include $(top_srcdir)/scripts/Makefile-files
99 include $(top_srcdir)/tests/Makefile-files
100 include $(top_srcdir)/sysv/Makefile-files
101 include $(top_srcdir)/linuxconf/Makefile-files
102
103 include $(top_srcdir)/m4/gpgsig.am
104 include $(top_srcdir)/m4/validate.am
105 include $(top_srcdir)/m4/changelog.am