]> granicus.if.org Git - apache/commitdiff
Change the make targets and rules to be consistent in all of the
authorRoy T. Fielding <fielding@apache.org>
Fri, 18 May 2001 00:48:57 +0000 (00:48 +0000)
committerRoy T. Fielding <fielding@apache.org>
Fri, 18 May 2001 00:48:57 +0000 (00:48 +0000)
Apache-owned source trees.  Sanity is a good thing.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89140 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
Makefile.in
acinclude.m4
build/ltlib.mk
build/rules.mk
build/special.mk
configure.in
modules/Makefile.in
server/Makefile.in
support/Makefile.in
test/Makefile.in

diff --git a/CHANGES b/CHANGES
index 605455cdff195af6832dde18ac1e469ab961f688..1a45636cf22b6a26137fdacd2946b425074bc3dd 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 Changes with Apache 2.0.18-dev
 
+  *) Change the make targets and rules to be consistent in all of the
+     Apache-owned source trees.  [Roy Fielding]
+     
   *) Fix processing of the TRACE method.  Previously we passed bogus
      parms to form_header_field() and it overlaid some vhost structures,
      resulting in a segfault in check_hostalias(). 
index 59673a0cc5c1cacbf7a4e5852238642b1d9729e5..36740313ea73e6de102d2362f1b437f5fee4b1d1 100644 (file)
@@ -1,5 +1,6 @@
 
 SUBDIRS = srclib os server modules support
+CLEAN_SUBDIRS = test
 
 PROGRAM_NAME         = $(progname)
 PROGRAM_SOURCES      = modules.c
@@ -13,14 +14,14 @@ PROGRAM_DEPENDENCIES = \
   $(AP_LIBS)
 
 PROGRAMS        = $(PROGRAM_NAME)
-targets         = $(PROGRAMS) $(shared_build) $(other_targets)
-phony_targets   = $(srcdir)/buildmark.c
-install_targets = install-conf install-htdocs install-icons install-other \
+TARGETS         = $(PROGRAMS) $(shared_build) $(other_targets)
+PHONY_TARGETS   = $(srcdir)/buildmark.c
+INSTALL_TARGETS = install-conf install-htdocs install-icons install-other \
        install-cgi install-include install-suexec
+
 DISTCLEAN_TARGETS  = include/ap_config_auto.h include/ap_config_path.h \
-       modules.c libtool
-EXTRACLEAN_TARGETS = configure include/ap_config_auto.h.in \
-       generated_lists
+       modules.c config.cache config.log config.status config_vars.mk
+EXTRACLEAN_TARGETS = configure include/ap_config_auto.h.in generated_lists
 
 include $(top_srcdir)/build/rules.mk
 include $(top_srcdir)/build/program.mk
index ee96803052a36a76b04de37457a5bd7c47711eba..bf71ff8d086af1b0d0e37c9134f4b7611037c8af 100644 (file)
@@ -76,6 +76,7 @@ AC_DEFUN(APACHE_GEN_CONFIG_VARS,[
   APACHE_SUBST(LIBTOOL)
   APACHE_SUBST(SHELL)
   APACHE_SUBST(MODULE_DIRS)
+  APACHE_SUBST(MODULE_CLEANDIRS)
   APACHE_SUBST(PORT)
   APACHE_SUBST(CORE_IMPLIB_FILE)
   APACHE_SUBST(CORE_IMPLIB)
@@ -144,6 +145,8 @@ AC_DEFUN(APACHE_MODPATH_FINISH,[
   echo "shared = $modpath_shared" >> $modpath_current/modules.mk
   if test ! -z "$modpath_static" -o ! -z "$modpath_shared"; then
     MODULE_DIRS="$MODULE_DIRS $current_dir"
+  else
+    MODULE_CLEANDIRS="$MODULE_CLEANDIRS $current_dir"
   fi
   APACHE_FAST_OUTPUT($modpath_current/Makefile)
 ])dnl
index 9b89d9c30957e4bf63e84549b6bc9ab867d11a90..d9b8e4e2429e596cdea6fa093d644d8e00112f33 100644 (file)
@@ -54,7 +54,7 @@
 # The build environment was provided by Sascha Schumann.
 #
 
-targets = $(LTLIBRARY_NAME)
+TARGETS = $(LTLIBRARY_NAME)
 
 include $(top_srcdir)/build/rules.mk
 include $(top_srcdir)/build/library.mk
index f050bbc89a133a0190d52204d650f0ce9c811d7c..c7ef27312cf7985f4622027240949a45ebe57734 100644 (file)
@@ -51,7 +51,7 @@
 # information on the Apache Software Foundation, please see
 # <http://www.apache.org/>.
 #
-# The build environment was provided by Sascha Schumann.
+# The build environment was originally provided by Sascha Schumann.
 #
 
 include $(top_builddir)/config_vars.mk
@@ -94,8 +94,122 @@ INSTALL = $(abs_srcdir)/build/install.sh -c
 INSTALL_DATA = $(INSTALL) -m 644
 INSTALL_PROGRAM = $(INSTALL) -m 755 $(INSTALL_PROG_FLAGS)
 
-# Suffixes
+#
+# Standard build rules
+#
+all: all-recursive
+depend: depend-recursive
+clean: clean-recursive
+distclean: distclean-recursive
+extraclean: extraclean-recursive
+
+install: all-recursive local-install
+shared-build: shared-build-recursive
+
+all-recursive depend-recursive:
+       @otarget=`echo $@|sed s/-recursive//`; \
+       list='$(SUBDIRS)'; \
+       for i in $$list; do \
+           if test -d "$$i"; then \
+               target="$$otarget"; \
+               echo "Making $$target in $$i"; \
+               if test "$$i" = "."; then \
+                       made_local=yes; \
+                       target="local-$$target"; \
+               fi; \
+               (cd $$i && $(MAKE) $$target) || exit 1; \
+           fi; \
+       done; \
+       if test "$$otarget" = "all" && test -z '$(TARGETS)'; then \
+           made_local=yes; \
+       fi; \
+       if test "$$made_local" != "yes"; then \
+           $(MAKE) "local-$$otarget" || exit 1; \
+       fi
+
+clean-recursive distclean-recursive extraclean-recursive:
+       @otarget=`echo $@|sed s/-recursive//`; \
+       list='$(SUBDIRS) $(CLEAN_SUBDIRS)'; \
+       for i in $$list; do \
+           if test -d "$$i"; then \
+               target="$$otarget"; \
+               echo "Making $$target in $$i"; \
+               if test "$$i" = "."; then \
+                       made_local=yes; \
+                       target="local-$$target"; \
+               fi; \
+               (cd $$i && $(MAKE) $$target); \
+           fi; \
+       done; \
+       if test "$$otarget" = "all" && test -z '$(TARGETS)'; then \
+           made_local=yes; \
+       fi; \
+       if test "$$made_local" != "yes"; then \
+           $(MAKE) "local-$$otarget"; \
+       fi
+
+shared-build-recursive:
+       @if test `pwd` = "$(top_builddir)"; then \
+           $(PRE_SHARED_CMDS) ; \
+       fi; \
+       list='$(SUBDIRS)'; for i in $$list; do \
+           target="shared-build"; \
+           if test "$$i" = "."; then \
+               made_local=yes; \
+               target="local-shared-build"; \
+           fi; \
+           if test "$$i" != "srclib"; then \
+               (cd $$i && $(MAKE) $$target) || exit 1; \
+           fi; \
+       done; \
+       if test -f 'modules.mk'; then \
+           if test -n '$(SHARED_TARGETS)'; then \
+               echo "Building shared: $(SHARED_TARGETS)"; \
+               if test "$$made_local" != "yes"; then \
+                       $(MAKE) "local-shared-build" || exit 1; \
+               fi; \
+           fi; \
+       fi; \
+       if test `pwd` = "$(top_builddir)"; then \
+               $(POST_SHARED_CMDS) ; \
+       fi
+
+local-all: $(TARGETS)
+
+local-shared-build: $(SHARED_TARGETS)
+
+local-depend: x-local-depend
+       if test "`echo $(srcdir)/*.c`" != "$(srcdir)'/*.c'"; then \
+               $(CC) -MM $(ALL_CPPFLAGS) $(ALL_INCLUDES) $(srcdir)/*.c | sed 's/\.o:/.lo:/' > $(builddir)/.deps || true;           \
+       fi
+
+local-clean: x-local-clean
+       rm -f *.o *.lo *.slo *.obj *.a *.la $(CLEAN_TARGETS) $(TARGETS)
+       rm -rf .libs
+
+local-distclean: local-clean x-local-distclean
+       rm -f .deps Makefile $(DISTCLEAN_TARGETS)
+
+local-extraclean: local-distclean x-local-extraclean
+       @if test -n "$(EXTRACLEAN_TARGETS)"; then \
+           echo "rm -f $(EXTRACLEAN_TARGETS)"; \
+           rm -f $(EXTRACLEAN_TARGETS) ; \
+       fi
+
+local-install: $(TARGETS) $(SHARED_TARGETS) $(INSTALL_TARGETS)
+       @if test -n '$(PROGRAMS)'; then \
+           test -d $(bindir) || $(MKINSTALLDIRS) $(bindir); \
+           list='$(PROGRAMS)'; for i in $$list; do \
+               $(INSTALL_PROGRAM) $$i $(bindir); \
+           done; \
+       fi
 
+# to be filled in by the actual Makefile if extra commands are needed
+x-local-depend x-local-clean x-local-distclean x-local-extraclean:
+
+#
+# Implicit rules for creating outputs from input files
+#
 CXX_SUFFIX = cpp
 SHLIB_SUFFIX = so
 
@@ -132,117 +246,20 @@ SHLIB_SUFFIX = so
 .l.c:
        $(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
 
-
-all: all-recursive
-shared-modules: shared-modules-recursive
-install: install-recursive
-
-
 # Makes an import library from a def file
 .def.la:
        $(LIBTOOL) --mode=compile $(MK_IMPLIB) -o $@ $<
 
-
-# if we are doing a distclean, we actually want to hit every 
-# directory that has ever been configured.  To do this, we just do a quick
-# find for all the leftover Makefiles, and then run make distclean in those
-# directories.
-# Exception: Skip APR directories (other than the base APR directory),
-#            because APR knows how to do these tasks better than we do.
-distclean-recursive clean-recursive depend-recursive all-recursive install-recursive:
-       @otarget=`echo $@|sed s/-recursive//`; \
-       list='$(SUBDIRS)'; for i in $$list; do \
-               target="$$otarget"; \
-               echo "Making $$target in $$i"; \
-               if test "$$i" = "."; then \
-                       ok=yes; \
-                       target="$$target-p"; \
-               fi; \
-               (cd $$i && $(MAKE) $$target) || exit 1; \
-       done; \
-       if test "$$otarget" = "all" && test -z '$(targets)'; then ok=yes; fi;\
-       if test "$$ok" != "yes"; then $(MAKE) "$$otarget-p" || exit 1; fi; \
-       if test "$$otarget" = "distclean" ; then\
-               for d in `find . -name Makefile`; do \
-                       i=`dirname "$$d"`; \
-                       target="$$otarget"; \
-                       in_apr=`echo $$i|sed 's%^.*apr/.*$$%ignore_apr_subdirs%'`; \
-                       in_apr=`echo $$in_apr|sed 's%^.*apr-util/.*$$%ignore_apr_subdirs%'`; \
-                       if test "x$$in_apr" != "xignore_apr_subdirs"; then \
-                               echo "Making $$target in $$i"; \
-                               if test "$$i" = "."; then \
-                                       ok=yes; \
-                                       target="$$target-p"; \
-                               fi; \
-                               (cd $$i && $(MAKE) $$target) || exit 1; \
-                       fi; \
-               done; \
-       fi
-
-shared-modules-recursive:
-       @if test `pwd` = "$(top_builddir)"; then \
-               $(PRE_SHARED_CMDS) ; \
-       fi; \
-       list='$(SUBDIRS)'; for i in $$list; do \
-               target="shared-modules"; \
-               if test "$$i" = "."; then \
-                       ok = yes; \
-                       target="shared-modules-p"; \
-               fi; \
-               if test "$$i" != "srclib"; then \
-                       (cd $$i && $(MAKE) $$target) || exit 1; \
-               fi; \
-       done; \
-       if test -f 'modules.mk'; then \
-               if test -n '$(shared_targets)'; then \
-                       echo "Building shared modules: $(shared_targets)"; \
-                       if test -z '$(shared_targets)'; then ok=yes; fi; \
-                       if test "$$ok" != "yes"; then \
-                               $(MAKE) "shared-modules-p" || exit 1; \
-                       fi; \
-               fi; \
-       fi; \
-       if test `pwd` = "$(top_builddir)"; then \
-               $(POST_SHARED_CMDS) ; \
-       fi
-
-all-p: $(targets)
-shared-modules-p: $(shared_targets)
-
-install-p: $(targets) $(shared_targets) $(install_targets)
-       @if test -n '$(PROGRAMS)'; then \
-               test -d $(bindir) || $(MKINSTALLDIRS) $(bindir); \
-               for i in $(PROGRAMS) ""; do \
-                   if test "x$$i" != "x"; then \
-                       $(INSTALL_PROGRAM) $$i $(bindir); \
-                   fi; \
-               done; \
-       fi
-
-distclean-p depend-p clean-p:
-
-depend: depend-recursive
-       if test "`echo $(srcdir)/*.c`" != "$(srcdir)'/*.c'"; then \
-               $(CC) -MM $(ALL_CPPFLAGS) $(ALL_INCLUDES) $(srcdir)/*.c | sed 's/\.o:/.lo:/' > $(builddir)/.deps || true;           \
-       fi
-#          test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) *.c > .deps
-
-clean: clean-recursive clean-x
-
-clean-x:
-       rm -f $(targets) *.slo *.lo *.la *.o *.obj $(CLEAN_TARGETS)
-       rm -rf .libs
-
-distclean: distclean-recursive clean-x
-       rm -f config.cache config.log config.status config_vars.mk \
-       stamp-h Makefile shlibtool .deps $(DISTCLEAN_TARGETS)
-
-extraclean: distclean
-       rm -f $(EXTRACLEAN_TARGETS)
-
+#
+# Dependencies
+#
 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)
+.PHONY: all all-recursive local-all $(PHONY_TARGETS) \
+       shared-build shared-build-recursive local-shared-build \
+       depend depend-recursive local-depend x-local-depend \
+       clean clean-recursive local-clean x-local-clean \
+       distclean distclean-recursive local-distclean x-local-distclean \
+       extraclean extraclean-recursive local-extraclean x-local-extraclean \
+       install local-install $(INSTALL_TARGETS)
+
index ef0b47ee0a692bde98237b7c8bc58b365ea86d42..3d974f1a727d957fcc5c9699d8d80ca2dcea7af8 100644 (file)
 all: all-recursive
 
 include $(builddir)/modules.mk
-targets = $(static)
-shared_targets = $(shared)
-install_targets = install-modules
+TARGETS = $(static)
+SHARED_TARGETS = $(shared)
+INSTALL_TARGETS = install-modules
 
 install-modules:
-       @shared='$(shared)'; \
-       builtin='$(BUILTIN_LIBS)'; \
+       @builtin='$(BUILTIN_LIBS)'; \
        has_mod_so=`echo $$builtin|sed 's/^.*mod_so.*$$/has_mod_so/'`; \
        if [ "x$$has_mod_so" = "xhas_mod_so" ]; then \
                $(MKINSTALLDIRS) $(libexecdir); \
-               for i in $$shared; do \
+               @list='$(shared)'; \
+               for i in $$list; do \
                        $(SH_LIBTOOL) --mode=install cp $$i $(libexecdir); \
                done; \
        fi      
index 6a71e01f973888c75f8727fc9282d59011a03788..3f158b9af4b522c3ad84a45c84f4a9c924f401ae 100644 (file)
@@ -246,7 +246,7 @@ if test "$apache_need_shared" = "yes"; then
       HTTPD_LDFLAGS="$HTTPD_LDFLAGS --main=$abs_srcdir/server/main.o --core-dll=$abs_srcdir/apachecore.dll"
       SH_LDFLAGS="$SH_LDFLAGS --core-dll=$abs_srcdir/apachecore.dll"
   esac
-  shared_build="shared-modules"
+  shared_build="shared-build"
 fi
 
 APACHE_SUBST(PRE_SHARED_CMDS)
index ecb043547baf5f8a62d642c4229b9c46b8360a64..79d278248fe2eca9a4c3376119d2110cb38d73d1 100644 (file)
@@ -1,5 +1,6 @@
 
 SUBDIRS = $(MODULE_DIRS)
+CLEAN_SUBDIRS = $(MODULE_CLEANDIRS)
 
 include $(top_srcdir)/build/rules.mk
 
index 24aef10277560b4e4fa7439e014e716c297c631b..c7d54516010049c491e4e5a73870c61b4eb4a26f 100644 (file)
@@ -16,7 +16,7 @@ LTLIBRARY_SOURCES = \
        util_filter.c exports.c buildmark.c scoreboard.c \
        error_bucket.c protocol.c core.c request.c
 
-targets = delete-exports $(LTLIBRARY_NAME) $(CORE_IMPLIB_FILE)
+TARGETS = delete-exports $(LTLIBRARY_NAME) $(CORE_IMPLIB_FILE)
 
 include $(top_srcdir)/build/rules.mk
 include $(top_srcdir)/build/library.mk
index ff5f6a4e265c4fe19b84a0d92924a789fdddad18..70f287b9e728bc9a4ff2630ba499c77b9774ab81 100644 (file)
@@ -2,7 +2,7 @@ DISTCLEAN_TARGETS = apxs apachectl dbmmanage log_server_status logresolve.pl \
        phf_abuse_log.cgi split-logfile
 
 PROGRAMS = htpasswd htdigest rotatelogs logresolve ab
-targets  = $(PROGRAMS)
+TARGETS  = $(PROGRAMS)
 
 PROGRAM_LDADD        = $(EXTRA_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(EXTRA_LIBS)
 PROGRAM_DEPENDENCIES = \
index 1426e44c950043a7e9f0f0e061a234d60205e183..7d0a9b0ace6ab7c57c19750328d61e1eecda2693 100644 (file)
@@ -1,7 +1,7 @@
 
 # no targets: we don't want to build anything by default. if you want the
 # test programs, then "make test"
-targets =
+TARGETS =
 
 PROGRAMS =