added new m4/*.m4 macros
[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 SUBDIRS                 =  . distrib
22
23 CVS2CL_AMFLAGS          =  $(CVS2CL_TAG) -U cvsusers.map
24 CVS2CL_ALLFLAGS        :=  $(CVS2CL_AMFLAGS) $(CVS2CL_FLAGS)
25
26 sysvdir                 =  $(sysconfdir)/init.d
27 confdir                 =  $(sysconfdir)/vservers
28
29 include_HEADERS         =  $(lib_HDRS)
30 noinst_HEADERS          =  $(src_HDRS) $(lib_XHDRS) compat.h
31
32 lib_LIBRARIES           =  $(lib_lib_LIBS)
33 #lib_LTLIBRARIES                =  $(lib_lib_LTLIBS)
34
35 pkglib_SCRIPTS          =  $(scripts_SCRPTS)
36 pkglib_DATA             =  $(scriptscfg_DATA) $(scripts_DTA)
37 pkglib_PROGRAMS         =  $(src_pkglib_PRGS)
38
39 sbin_SCRIPTS            =  $(scripts_PRGS)
40 sbin_PROGRAMS           =  $(src_sbin_PRGS)
41 noinst_PROGRAMS         =  $(test_PRGS)
42
43 sysv_SCRIPTS            =  $(sysv_SCRPTS)
44 sysconf_DATA            =  $(sysv_CFG)
45
46 DIETPROGS               =  $(src_DIETPROGS) $(tests_DIETPROGS)
47
48 BUILT_SOURCES           =  linuxcaps.h pathconfig.h linuxvirtual.h
49
50 man_MANS                =  $(man_DATMAN)
51
52 EXTRA_PROGRAMS          =  $(src_EXTRA_PROGS)
53 EXTRA_DIST              =  $(sysv_XTRAS) $(sysv_CFG) \
54                            $(doc_DAT) $(man_DATMAN) \
55                            $(scripts_SCRPTS) $(scripts_PRGS) $(scripts_XTRAS) \
56                            pathconfig.h.pathsubst \
57                            util-vserver.spec \
58                            m4/ensc_cflags.m4 m4/ensc_fpicsyscall.m4 \
59                            m4/ensc_cxxcompiler.m4 \
60                            THANKS
61
62 AM_CPPFLAGS             =  -I $(top_srcdir)/lib -D _GNU_SOURCE
63
64 CLEANFILES              =  $(sysv_GENSCRPTS) $(scripts_GENSCRPTS) $(BUILT_SOURCES) \
65                            .*.pathsubst.stamp */.*.pathsubst.stamp \
66                            linuxcaps.h pathconfig.h
67
68 AM_INSTALLCHECK_STD_OPTIONS_EXEMPT      =  $(src_OPTIONS_EXEMPT) \
69                                            $(scripts_OPTIONS_EXEMPT) \
70                                            $(sysv_OPTIONS_EXEMPT)
71
72 if USE_DIETLIBC
73 DIET                    =  diet
74 DIET_FLAGS              =
75 DIET_CC                :=  $(DIET) $(DIET_FLAGS) $(CC)
76 endif
77
78 linuxcaps.h:
79                         ln -sf ${kernelincludedir}/linux/capability.h linuxcaps.h
80
81 linuxvirtual.h:
82                         ln -sf '$(kernelincludedir)/linux/virtual.h' '$@' && test -e '$@' || \
83                         ln -sf '$(top_srcdir)/lib/virtual.h' '$@'
84
85 pathsubst_RULES         =  s!@'PKGLIBDIR'@!$(pkglibdir)!g; \
86                            s!@'SBINDIR'@!$(sbindir)!g; \
87                            s!@'CONFDIR'@!$(confdir)!g; \
88                            s!@'SYSCONFDIR'@!$(sysconfdir)!g; \
89                            s!@'PKGSTATEDIR'@!$(pkgstatedir)!g; \
90                            s!@'PACKAGE'@!$(PACKAGE)!g; \
91                            s!@'PACKAGE_BUGREPORT'@!$(PACKAGE_BUGREPORT)!g; \
92                            s!@'PACKAGE_NAME'@!$(PACKAGE_NAME)!g; \
93                            s!@'PACKAGE_STRING'@!$(PACKAGE_STRING)!g; \
94                            s!@'PACKAGE_TARNAME'@!$(PACKAGE_TARNAME)!g; \
95                            s!@'PACKAGE_VERSION'@!$(PACKAGE_VERSION)!g; \
96                            s!@'AWK'@!$(AWK)!g; \
97                            s!@'GREP'@!$(GREP)!g; \
98                            s!@'IP'@!$(IP)!g; \
99                            s!@'MOUNT'@!$(MOUNT)!g; \
100                            s!@'UMOUNT'@!$(UMOUNT)!g; \
101                            s!@'NICE'@!$(NICE)!g; \
102                            s!@'VCONFIG'@!$(VCONFIG)!g; \
103                            s!@'WC'@!$(WC)!g
104
105 pathconfig.h:           .pathconfig.h.pathsubst.stamp
106 .%.pathsubst.stamp:     %.pathsubst Makefile
107                         @mkdir -p $$(dirname '$@')
108                         @echo "sed -e '...' $*.pathsubst >$*"
109                         @sed -e '$(pathsubst_RULES)' '$<' >'$@.tmp'
110                         @if cmp -s '$@.tmp' '$*'; then \
111                                 echo "... no changes, reusing old version"; \
112                                 rm -f '$@.tmp'; \
113                         else \
114                                 rm -f '$*'; mv '$@.tmp' '$*'; \
115                         fi
116                         @chmod a-w '$*'
117                         @touch '$@'
118
119 pkgstatedir             =  $(localstatedir)/run/vservers
120 install-data-local:
121                         $(INSTALL) -d -m755 $(DESTDIR)$(pkgstatedir)
122
123 if USE_DIETLIBC
124 $(DIETPROGS):           LIBTOOL=$(LIBTOOL) --tag CC
125
126 $(addsuffix $(EXEEXT), $(DIETPROGS)) \
127 $(addsuffix $(OBJEXT), $(DIETPROGS)) \
128                 :               CC=$(DIET_CC)
129 endif
130
131 include $(top_srcdir)/lib/Makefile-files
132 include $(top_srcdir)/src/Makefile-files
133 include $(top_srcdir)/doc/Makefile-files
134 include $(top_srcdir)/man/Makefile-files
135 include $(top_srcdir)/scripts/Makefile-files
136 include $(top_srcdir)/tests/Makefile-files
137 include $(top_srcdir)/sysv/Makefile-files
138
139 include $(top_srcdir)/m4/gpgsig.am
140 include $(top_srcdir)/m4/validate.am
141 include $(top_srcdir)/m4/changelog.am
142 include $(top_srcdir)/m4/pkgconfig.am