rules.mk revision 7bfe076b680e6e591add6cdc754ce9a6910682a2
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# ====================================================================
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# The Apache Software License, Version 1.1
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim#
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# Copyright (c) 2000 The Apache Software Foundation. All rights
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# reserved.
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim#
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# Redistribution and use in source and binary forms, with or without
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# modification, are permitted provided that the following conditions
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# are met:
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim#
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# 1. Redistributions of source code must retain the above copyright
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# notice, this list of conditions and the following disclaimer.
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim#
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# 2. Redistributions in binary form must reproduce the above copyright
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# notice, this list of conditions and the following disclaimer in
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# the documentation and/or other materials provided with the
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# distribution.
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim#
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# 3. The end-user documentation included with the redistribution,
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# if any, must include the following acknowledgment:
12b170a812f740fafc96da32a188a8b2761a3d5cjim# "This product includes software developed by the
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# Apache Software Foundation (http://www.apache.org/)."
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# Alternately, this acknowledgment may appear in the software itself,
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# if and wherever such third-party acknowledgments normally appear.
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim#
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# 4. The names "Apache" and "Apache Software Foundation" must
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# not be used to endorse or promote products derived from this
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# software without prior written permission. For written
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# permission, please contact apache@apache.org.
834fc281be8e0f7f2614961f12d8bbf603382a17jfclere#
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# 5. Products derived from this software may not be called "Apache",
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# nor may "Apache" appear in their name, without prior written
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# permission of the Apache Software Foundation.
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim#
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
5bfaaf573bacb45c1cf290ce85ecc676587e8a64jim# DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# SUCH DAMAGE.
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# ====================================================================
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim#
834fc281be8e0f7f2614961f12d8bbf603382a17jfclere# This software consists of voluntary contributions made by many
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# individuals on behalf of the Apache Software Foundation. For more
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# information on the Apache Software Foundation, please see
834fc281be8e0f7f2614961f12d8bbf603382a17jfclere# <http://www.apache.org/>.
834fc281be8e0f7f2614961f12d8bbf603382a17jfclere#
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# The build environment was provided by Sascha Schumann.
4efeaf392b8e7584b7fe240e8c6116837c3f54bajim#
4efeaf392b8e7584b7fe240e8c6116837c3f54bajim
4efeaf392b8e7584b7fe240e8c6116837c3f54bajiminclude $(top_builddir)/config_vars.mk
4efeaf392b8e7584b7fe240e8c6116837c3f54bajim
4efeaf392b8e7584b7fe240e8c6116837c3f54bajim# Compile commands
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim
4efeaf392b8e7584b7fe240e8c6116837c3f54bajimCOMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS)
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jimCOMPILE = $(CC) $(COMMON_FLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jimCXX_COMPILE = $(CXX) $(COMMON_FLAGS) $(CXXFLAGS) $(EXTRA_CXXFLAGS)
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jimSH_COMPILE = $(SH_LIBTOOL) --mode=compile $(COMPILE) -c $< && touch $@
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jimSH_CXX_COMPILE = $(SH_LIBTOOL) --mode=compile $(CXX_COMPILE) -c $< && touch $@
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jimLT_COMPILE = $(LIBTOOL) --mode=compile $(COMPILE) -c $< && touch $@
834fc281be8e0f7f2614961f12d8bbf603382a17jfclereLT_CXX_COMPILE = $(LIBTOOL) --mode=compile $(CXX_COMPILE) -c $< && touch $@
834fc281be8e0f7f2614961f12d8bbf603382a17jfclere
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# Link-related commands
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jimLINK = $(LIBTOOL) --mode=link $(COMPILE) $(LDFLAGS) -o $@
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jimSH_LINK = $(SH_LIBTOOL) --mode=link $(COMPILE) $(LDFLAGS) -o $@
834fc281be8e0f7f2614961f12d8bbf603382a17jfclere
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# Helper programs
834fc281be8e0f7f2614961f12d8bbf603382a17jfclere
834fc281be8e0f7f2614961f12d8bbf603382a17jfclereSH_LIBTOOL = $(SHELL) $(top_builddir)/shlibtool --silent
5bfaaf573bacb45c1cf290ce85ecc676587e8a64jimMKINSTALLDIRS = $(abs_srcdir)/helpers/mkdir.sh
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jimINSTALL = $(abs_srcdir)/helpers/install.sh -c
834fc281be8e0f7f2614961f12d8bbf603382a17jfclereINSTALL_DATA = $(INSTALL) -m 644
834fc281be8e0f7f2614961f12d8bbf603382a17jfclereINSTALL_PROGRAM = $(INSTALL) -m 755
834fc281be8e0f7f2614961f12d8bbf603382a17jfclere
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jimDEFS = -I. -I$(srcdir) -I$(top_srcdir)/modules/mpm/$(MPM_NAME)
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# Suffixes
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jimCXX_SUFFIX = cpp
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jimSHLIB_SUFFIX = so
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim.SUFFIXES:
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim.SUFFIXES: .S .c .$(CXX_SUFFIX) .lo .o .s .y .l .slo
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim.c.o:
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim $(COMPILE) -c $<
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim.s.o:
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim $(COMPILE) -c $<
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim.c.lo:
23a31b10f869a72c9197b5f153f4f3e1a4c68f28jim $(LT_COMPILE)
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim.s.lo:
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim $(LT_COMPILE)
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim.c.slo:
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim $(SH_COMPILE)
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim
2c4ed36c350564e8bfb68e9d9ba58fe77b9bf3c0jim.$(CXX_SUFFIX).lo:
6bed231822ad2aaba16de74c4c01023e5982a5e2jfclere $(LT_CXX_COMPILE)
2c4ed36c350564e8bfb68e9d9ba58fe77b9bf3c0jim
2c4ed36c350564e8bfb68e9d9ba58fe77b9bf3c0jim.$(CXX_SUFFIX).slo:
2c4ed36c350564e8bfb68e9d9ba58fe77b9bf3c0jim $(SH_CXX_COMPILE)
2c4ed36c350564e8bfb68e9d9ba58fe77b9bf3c0jim
2c4ed36c350564e8bfb68e9d9ba58fe77b9bf3c0jim.y.c:
2c4ed36c350564e8bfb68e9d9ba58fe77b9bf3c0jim $(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
2c4ed36c350564e8bfb68e9d9ba58fe77b9bf3c0jim if test -f y.tab.h; then \
2c4ed36c350564e8bfb68e9d9ba58fe77b9bf3c0jim if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
b1e3273c2e70ad5ac64feef979b2ed1d98c09963jim else :; fi
b1e3273c2e70ad5ac64feef979b2ed1d98c09963jim
6bed231822ad2aaba16de74c4c01023e5982a5e2jfclere.l.c:
b1e3273c2e70ad5ac64feef979b2ed1d98c09963jim $(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
b1e3273c2e70ad5ac64feef979b2ed1d98c09963jim
b1e3273c2e70ad5ac64feef979b2ed1d98c09963jim
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jimall: all-recursive
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jiminstall: install-recursive
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim# if we are doing a distclean, we actually want to hit every
9a0e1ad272fdbe3fee989e93bdae8253418429edjfclere# directory that has ever been configured. To do this, we just do a quick
b1e3273c2e70ad5ac64feef979b2ed1d98c09963jim# find for all the leftover Makefiles, and then run make distclean in those
9a0e1ad272fdbe3fee989e93bdae8253418429edjfclere# directories.
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jimdistclean-recursive clean-recursive depend-recursive all-recursive install-recursive:
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim @otarget=`echo $@|sed s/-recursive//`; \
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim list='$(SUBDIRS)'; for i in $$list; do \
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim target="$$otarget"; \
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim echo "Making $$target in $$i"; \
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim if test "$$i" = "."; then \
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim ok=yes; \
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim target="$$target-p"; \
36ef8f77bffe75d1aa327882be1b5bdbe2ff567asf fi; \
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim (cd $$i && $(MAKE) $$target) || exit 1; \
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim done; \
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim if test "$$otarget" = "all" && test -z '$(targets)'; then ok=yes; fi;\
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim if test "$$ok" != "yes"; then $(MAKE) "$$otarget-p" || exit 1; fi; \
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim if test "$$otarget" = "distclean" ; then\
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim for d in `find . -name Makefile`; do \
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim i=`dirname "$$d"`; \
dfcadcd3e6bbdee594540b8f8e4e50586a2e3219jim target="$$otarget"; \
echo "Making $$target in $$i"; \
if test "$$i" = "."; then \
ok=yes; \
target="$$target-p"; \
fi; \
(cd $$i && $(MAKE) $$target) || exit 1; \
done; \
fi
all-p: $(targets)
install-p: $(targets) $(install_targets)
@if test -n '$(PROGRAMS)'; then \
test -d $(bindir) || $(MKINSTALLDIRS) $(bindir); \
for i in "$(PROGRAMS)"; do \
$(INSTALL_PROGRAM) $$i $(bindir); \
done; \
fi
distclean-p depend-p clean-p:
depend: depend-recursive
gcc -MM $(INCLUDES) $(EXTRA_INCLUDES) $(DEFS) $(CPPFLAGS) $(srcdir)/*.c | sed 's/\.o:/.lo:/' > $(builddir)/.deps || true
# test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) *.c > .deps
clean: clean-recursive clean-x
clean-x:
rm -f $(targets) *.slo *.lo *.la *.o $(CLEANFILES)
rm -rf .libs
distclean: distclean-recursive clean-x
rm -f config.cache config.log config.status config_vars.mk libtool \
stamp-h Makefile shlibtool .deps $(DISTCLEANFILES)
include $(builddir)/.deps
.PHONY: all-recursive clean-recursive install-recursive \
$(install_targets) install all clean depend depend-recursive shared \
distclean-recursive distclean clean-x all-p install-p distclean-p \
depend-p clean-p $(phony_targets)