1 ## $Id: Makefile.am,v 1.70 2005/07/03 17:51:00 ensc Exp $
3 # Copyright (C) 2003,2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
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)
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.
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.
20 ACLOCAL_AMFLAGS = -I m4
23 CVS2CL_AMFLAGS = $(CVS2CL_TAG) -U cvsusers.map --show-dead -S --no-wrap
24 CVS2CL_ALLFLAGS := $(CVS2CL_AMFLAGS) $(CVS2CL_FLAGS)
26 confdir = $(sysconfdir)/vservers
27 confdefaultsdir = $(confdir)/.defaults
28 sbincfgdir = $(sbindir)
29 legacydir = $(pkglibdir)/legacy
32 noinst_HEADERS = $(ENSC_VECTOR_HDRS) \
35 noinst_LIBRARIES = $(ENSC_VECTOR_LIBS)
41 pkglib_DATA = FEATURES.txt
54 DIETPROGS = $(LIBENSCVECTOR_DIET)
56 BUILT_SOURCES = pathconfig.h linuxvirtual.h \
61 kernel_HDRS = kernel/context.h \
62 kernel/context_cmd.h \
77 kernel/namespace_cmd.h \
79 kernel/network_cmd.h \
89 EXTRA_DIST = pathconfig.h.pathsubst \
99 TESTS_ENVIRONMENT = ensc_use_expensive_tests="$(ENSC_USE_EXPENSIVE_TESTS)" \
100 ensc_test_debug="$(TESTS_DEBUG)"
102 AM_CPPFLAGS = -I $(top_srcdir)/lib -I $(top_srcdir)/ensc_wrappers \
103 -D_GNU_SOURCE -D_REENTRANT $(RELEASE_CPPFLAGS)
105 CLEANFILES = $(BUILT_SOURCES) \
106 .*.pathsubst.stamp */.*.pathsubst.stamp */*/.*.pathsubst.stamp \
109 DISTCLEANFILES = FEATURES.txt
112 AM_INSTALLCHECK_STD_OPTIONS_EXEMPT =
115 DIET_CC := $(DIET) $(DIETFLAGS) $(CC)
116 VSERVER_LDFLGS := -static
121 if USE_DIETLIBC_COMPAT
122 DIET_COMPAT_LDADDS = -lcompat
127 VSERVER_LDADDS = $(LIBVSERVER) $(DIET_COMPAT_LDADDS)
130 @t=$$(mktemp /tmp/build.XXXXXX) && \
131 $(MAKE) '$*' -s 2>$$t >/dev/null && \
133 grep -v ': In function' | \
134 grep -v 'your code still has assertions enabled' | \
135 grep -v ' is obsoleted' | \
136 grep -v 'warning: #warning'; \
141 if ENSC_ENABLE_INTERNAL_HEADERS
142 ln -sf '$(top_srcdir)/lib/virtual.h' '$@'
144 ln -sf '$(kernelincludedir)/linux/virtual.h' '$@' && test -e '$@' || \
145 ln -sf '$(top_srcdir)/lib/virtual.h' '$@'
148 pathsubst_RULES = s!@'PKGLIBDIR'@!$(pkglibdir)!g; \
149 s!@'LEGACYDIR'@!$(legacydir)!g; \
150 s!@'SBINDIR'@!$(sbindir)!g; \
151 s!@'CONFDIR'@!$(confdir)!g; \
152 s!@'SYSCONFDIR'@!$(sysconfdir)!g; \
153 s!@'PKGSTATEDIR'@!$(pkgstatedir)!g; \
154 s!@'PKGSTATEREVDIR'@!$(pkgstaterevdir)!g; \
155 s!@'VSERVERDIR'@!$(vserverdir)!g; \
156 s!@'VSERVERPKGDIR'@!$(vserverpkgdir)!g; \
157 s!@'VSERVERPKGDIR'@!$(vserverpkgdir)!g; \
158 s!@'VSHELPERSTATEDIR'@!$(vshelperstatedir)!g; \
159 s!@'INITRDDIR'@!$(initrddir)!g; \
160 s!@'LIBDIR'@!$(libdir)!g; \
161 s!@'MANDIR'@!$(mandir)!g; \
162 s!@'INCLUDEDIR'@!$(includedir)!g; \
163 s!@'PACKAGE'@!$(PACKAGE)!g; \
164 s!@'PACKAGE_BUGREPORT'@!$(PACKAGE_BUGREPORT)!g; \
165 s!@'PACKAGE_NAME'@!$(PACKAGE_NAME)!g; \
166 s!@'PACKAGE_STRING'@!$(PACKAGE_STRING)!g; \
167 s!@'PACKAGE_TARNAME'@!$(PACKAGE_TARNAME)!g; \
168 s!@'PACKAGE_VERSION'@!$(PACKAGE_VERSION)!g; \
169 s!@'ENSC_HAVE_C99_COMPILER_TRUE'@!\@ENSC_HAVE_C99_COMPILER_TRUE@ !g; \
170 s!@'ENSC_HAVE_C99_COMPILER_FALSE'@!\@ENSC_HAVE_C99_COMPILER_FALSE@ !g; \
171 s!@'ENSC_HAVE_CXX_COMPILER_TRUE'@!\@ENSC_HAVE_CXX_COMPILER_TRUE@ !g; \
172 s!@'ENSC_HAVE_CXX_COMPILER_FALSE'@!\@ENSC_HAVE_CXX_COMPILER_FALSE@ !g; \
175 pathconfig.h: .pathconfig.h.pathsubst.stamp
176 .%.pathsubst.stamp: %.pathsubst Makefile
177 @mkdir -p $$(dirname '$@')
178 @echo "$(SED) -e '...' $*.pathsubst >$*"
179 @$(SED) -e '$(pathsubst_RULES)' '$<' >'$@.tmp'
180 @-chmod --reference='$<' '$@.tmp'
181 @if cmp -s '$@.tmp' '$*'; then \
182 echo "... no changes, reusing old version"; \
185 rm -f '$*'; mv '$@.tmp' '$*'; \
190 pkgstatedir = $(localstatedir)/run/vservers
191 pkgstaterevdir = $(confdefaultsdir)/run.rev
192 vserverpkgdir = $(vserverdir)/.pkg
193 vshelperstatedir = $(localstatedir)/run/vshelper
195 fix_SCRPTS = $(addprefix $(pkglibdir)/, $(notdir $(pkglib_SCRIPTS))) \
196 $(addprefix $(legacydir)/, $(notdir $(legacy_SCRIPTS))) \
197 $(addprefix $(sbindir)/, $(notdir $(sbin_SCRIPTS))) \
198 $(addprefix $(initrddir)/, $(notdir $(initrd_SCRIPTS)))
201 $(top_srcdir)/update-doc
203 install-data-hook: install-fix-script-paths install-create-dirs
206 $(mkinstalldirs) -m 755 $(DESTDIR)$(pkgstatedir) $(DESTDIR)$(pkgstatedir).rev $(DESTDIR)$(vshelperstatedir)
207 $(mkinstalldirs) -m 755 $(DESTDIR)$(confdefaultsdir)
208 f=$(DESTDIR)$(confdefaultsdir)/vdirbase; test -e "$$f" || ln -sf '$(vserverdir)' "$$f"
209 f=$(DESTDIR)$(pkgstaterevdir); test -e "$$f" || ln -sf '$(pkgstatedir).rev' "$$f"
211 install-fix-script-paths:
212 test "/usr/lib/util-vserver" = "$(pkglibdir)" || \
213 for i in $(fix_SCRPTS); do \
215 $(SED) -e 's!/usr/lib/util-vserver!$(pkglibdir)!g' "$$f" >"$$f.tmp"; \
216 $(CMP) -s "$$f.tmp" "$$f" || cat "$$f.tmp" >"$$f"; \
220 install-distribution: _install-vserverdir _install-vshelperlink
222 _install-vshelperlink:
223 $(mkinstalldirs) $(DESTDIR)/sbin
224 ln -sf ..$(pkglibdir)/vshelper $(DESTDIR)/sbin/vshelper
227 $(mkinstalldirs) $(DESTDIR)$(vserverdir) $(DESTDIR)$(vserverpkgdir)
230 .fixups: config.status util-vserver.spec
231 chmod a-w util-vserver.spec
235 $(addsuffix $(EXEEXT), $(DIETPROGS)) \
236 $(addsuffix $(OBJEXT), $(DIETPROGS)) \
239 nodist_lib_dietlibc_not_enabled_error_a_SOURCES = \
240 lib-dietlibc-not-enabled-error.c
244 cd $(DESTDIR)$(sbindir) && $(LN_S) vuseradd vadduser
245 cd $(DESTDIR)$(sbindir) && $(LN_S) vuserdel vdeluser
246 mkdir -p $(DESTDIR)/bin
247 cd $(DESTDIR)/bin && $(LN_S) ../$(sbindir)/vsh
250 install -D -m 644 scripts/vcached.logrotate $(DESTDIR)/$(sysconfdir)/logrotate.d/vcached
251 install -D -m 644 scripts/vcached.cron $(DESTDIR)/$(sysconfdir)/cron.d/vcached
253 include $(top_srcdir)/lib/Makefile-files
254 include $(top_srcdir)/src/Makefile-files
255 include $(top_srcdir)/doc/Makefile-files
256 include $(top_srcdir)/man/Makefile-files
257 include $(top_srcdir)/scripts/Makefile-files
258 include $(top_srcdir)/tests/Makefile-files
259 include $(top_srcdir)/sysv/Makefile-files
260 include $(top_srcdir)/contrib/Makefile-files
261 include $(top_srcdir)/ensc_vector/Makefile-files
262 include $(top_srcdir)/ensc_wrappers/Makefile-files
263 include $(top_srcdir)/ensc_fmt/Makefile-files
264 include $(top_srcdir)/lib_internal/Makefile-files
265 include $(top_srcdir)/vserver-start/Makefile-files
267 include $(top_srcdir)/m4/gpgsig.am
268 include $(top_srcdir)/m4/validate.am
269 include $(top_srcdir)/m4/changelog.am
270 include $(top_srcdir)/m4/pkgconfig.am
271 include $(top_srcdir)/m4/libsel.am
272 include $(top_srcdir)/m4/install-notify.am
274 .PHONY: FORCE update-doc