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 \
78 kernel/network_cmd.h \
88 EXTRA_DIST = pathconfig.h.pathsubst \
98 TESTS_ENVIRONMENT = ensc_use_expensive_tests="$(ENSC_USE_EXPENSIVE_TESTS)" \
99 ensc_test_debug="$(TESTS_DEBUG)"
101 AM_CPPFLAGS = -I $(top_srcdir)/lib -I $(top_srcdir)/ensc_wrappers \
102 -D_GNU_SOURCE -D_REENTRANT $(RELEASE_CPPFLAGS)
104 CLEANFILES = $(BUILT_SOURCES) \
105 .*.pathsubst.stamp */.*.pathsubst.stamp */*/.*.pathsubst.stamp \
108 DISTCLEANFILES = FEATURES.txt
111 AM_INSTALLCHECK_STD_OPTIONS_EXEMPT =
114 DIET_CC := $(DIET) $(DIETFLAGS) $(CC)
115 VSERVER_LDFLGS := -static
120 if USE_DIETLIBC_COMPAT
121 DIET_COMPAT_LDADDS = -lcompat
126 VSERVER_LDADDS = $(LIBVSERVER) $(DIET_COMPAT_LDADDS)
129 @t=$$(mktemp /tmp/build.XXXXXX) && \
130 $(MAKE) '$*' -s 2>$$t >/dev/null && \
132 grep -v ': In function' | \
133 grep -v 'your code still has assertions enabled' | \
134 grep -v ' is obsoleted' | \
135 grep -v 'warning: #warning'; \
140 if ENSC_ENABLE_INTERNAL_HEADERS
141 ln -sf '$(top_srcdir)/lib/virtual.h' '$@'
143 ln -sf '$(kernelincludedir)/linux/virtual.h' '$@' && test -e '$@' || \
144 ln -sf '$(top_srcdir)/lib/virtual.h' '$@'
147 pathsubst_RULES = s!@'PKGLIBDIR'@!$(pkglibdir)!g; \
148 s!@'LEGACYDIR'@!$(legacydir)!g; \
149 s!@'SBINDIR'@!$(sbindir)!g; \
150 s!@'CONFDIR'@!$(confdir)!g; \
151 s!@'SYSCONFDIR'@!$(sysconfdir)!g; \
152 s!@'PKGSTATEDIR'@!$(pkgstatedir)!g; \
153 s!@'PKGSTATEREVDIR'@!$(pkgstaterevdir)!g; \
154 s!@'VSERVERDIR'@!$(vserverdir)!g; \
155 s!@'VSERVERPKGDIR'@!$(vserverpkgdir)!g; \
156 s!@'VSERVERPKGDIR'@!$(vserverpkgdir)!g; \
157 s!@'VSHELPERSTATEDIR'@!$(vshelperstatedir)!g; \
158 s!@'INITRDDIR'@!$(initrddir)!g; \
159 s!@'LIBDIR'@!$(libdir)!g; \
160 s!@'MANDIR'@!$(mandir)!g; \
161 s!@'INCLUDEDIR'@!$(includedir)!g; \
162 s!@'PACKAGE'@!$(PACKAGE)!g; \
163 s!@'PACKAGE_BUGREPORT'@!$(PACKAGE_BUGREPORT)!g; \
164 s!@'PACKAGE_NAME'@!$(PACKAGE_NAME)!g; \
165 s!@'PACKAGE_STRING'@!$(PACKAGE_STRING)!g; \
166 s!@'PACKAGE_TARNAME'@!$(PACKAGE_TARNAME)!g; \
167 s!@'PACKAGE_VERSION'@!$(PACKAGE_VERSION)!g; \
168 s!@'ENSC_HAVE_C99_COMPILER_TRUE'@!\@ENSC_HAVE_C99_COMPILER_TRUE@ !g; \
169 s!@'ENSC_HAVE_C99_COMPILER_FALSE'@!\@ENSC_HAVE_C99_COMPILER_FALSE@ !g; \
170 s!@'ENSC_HAVE_CXX_COMPILER_TRUE'@!\@ENSC_HAVE_CXX_COMPILER_TRUE@ !g; \
171 s!@'ENSC_HAVE_CXX_COMPILER_FALSE'@!\@ENSC_HAVE_CXX_COMPILER_FALSE@ !g; \
174 pathconfig.h: .pathconfig.h.pathsubst.stamp
175 .%.pathsubst.stamp: %.pathsubst Makefile
176 @mkdir -p $$(dirname '$@')
177 @echo "$(SED) -e '...' $*.pathsubst >$*"
178 @$(SED) -e '$(pathsubst_RULES)' '$<' >'$@.tmp'
179 @-chmod --reference='$<' '$@.tmp'
180 @if cmp -s '$@.tmp' '$*'; then \
181 echo "... no changes, reusing old version"; \
184 rm -f '$*'; mv '$@.tmp' '$*'; \
189 pkgstatedir = $(localstatedir)/run/vservers
190 pkgstaterevdir = $(confdefaultsdir)/run.rev
191 vserverpkgdir = $(vserverdir)/.pkg
192 vshelperstatedir = $(localstatedir)/run/vshelper
194 fix_SCRPTS = $(addprefix $(pkglibdir)/, $(notdir $(pkglib_SCRIPTS))) \
195 $(addprefix $(legacydir)/, $(notdir $(legacy_SCRIPTS))) \
196 $(addprefix $(sbindir)/, $(notdir $(sbin_SCRIPTS))) \
197 $(addprefix $(initrddir)/, $(notdir $(initrd_SCRIPTS)))
200 $(top_srcdir)/update-doc
202 install-data-hook: install-fix-script-paths install-create-dirs
205 $(mkinstalldirs) -m 755 $(DESTDIR)$(pkgstatedir) $(DESTDIR)$(pkgstatedir).rev $(DESTDIR)$(vshelperstatedir)
206 $(mkinstalldirs) -m 755 $(DESTDIR)$(confdefaultsdir)
207 f=$(DESTDIR)$(confdefaultsdir)/vdirbase; test -e "$$f" || ln -sf '$(vserverdir)' "$$f"
208 f=$(DESTDIR)$(pkgstaterevdir); test -e "$$f" || ln -sf '$(pkgstatedir).rev' "$$f"
210 install-fix-script-paths:
211 test "/usr/lib/util-vserver" = "$(pkglibdir)" || \
212 for i in $(fix_SCRPTS); do \
214 $(SED) -e 's!/usr/lib/util-vserver!$(pkglibdir)!g' "$$f" >"$$f.tmp"; \
215 $(CMP) -s "$$f.tmp" "$$f" || cat "$$f.tmp" >"$$f"; \
219 install-distribution: _install-vserverdir _install-vshelperlink
221 _install-vshelperlink:
222 $(mkinstalldirs) $(DESTDIR)/sbin
223 ln -sf ..$(pkglibdir)/vshelper $(DESTDIR)/sbin/vshelper
226 $(mkinstalldirs) $(DESTDIR)$(vserverdir) $(DESTDIR)$(vserverpkgdir)
229 .fixups: config.status util-vserver.spec
230 chmod a-w util-vserver.spec
234 $(addsuffix $(EXEEXT), $(DIETPROGS)) \
235 $(addsuffix $(OBJEXT), $(DIETPROGS)) \
238 nodist_lib_dietlibc_not_enabled_error_a_SOURCES = \
239 lib-dietlibc-not-enabled-error.c
242 include $(top_srcdir)/lib/Makefile-files
243 include $(top_srcdir)/src/Makefile-files
244 include $(top_srcdir)/doc/Makefile-files
245 include $(top_srcdir)/man/Makefile-files
246 include $(top_srcdir)/scripts/Makefile-files
247 include $(top_srcdir)/tests/Makefile-files
248 include $(top_srcdir)/sysv/Makefile-files
249 include $(top_srcdir)/contrib/Makefile-files
250 include $(top_srcdir)/ensc_vector/Makefile-files
251 include $(top_srcdir)/ensc_wrappers/Makefile-files
252 include $(top_srcdir)/ensc_fmt/Makefile-files
253 include $(top_srcdir)/lib_internal/Makefile-files
254 include $(top_srcdir)/vserver-start/Makefile-files
256 include $(top_srcdir)/m4/gpgsig.am
257 include $(top_srcdir)/m4/validate.am
258 include $(top_srcdir)/m4/changelog.am
259 include $(top_srcdir)/m4/pkgconfig.am
260 include $(top_srcdir)/m4/libsel.am
261 include $(top_srcdir)/m4/install-notify.am
263 .PHONY: FORCE update-doc