Commit b31895a7 authored by Roy T. Fielding's avatar Roy T. Fielding
Browse files

Change the make targets and rules to be consistent in all of the

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
parent e0c5f5fb
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
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(). 
+7 −6
Original line number Diff line number Diff line

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
+3 −0
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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
+127 −110
Original line number Diff line number Diff line
@@ -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,111 +94,79 @@ INSTALL = $(abs_srcdir)/build/install.sh -c
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_PROGRAM = $(INSTALL) -m 755 $(INSTALL_PROG_FLAGS)

# Suffixes

CXX_SUFFIX = cpp
SHLIB_SUFFIX = so

.SUFFIXES:
.SUFFIXES: .S .c .$(CXX_SUFFIX) .lo .o .s .y .l .slo .def .la

.c.o:
	$(COMPILE) -c $<

.s.o:
	$(COMPILE) -c $<

.c.lo:
	$(LT_COMPILE)

.s.lo:
	$(LT_COMPILE)

.c.slo:
	$(SH_COMPILE)

.$(CXX_SUFFIX).lo:
	$(LT_CXX_COMPILE)

.$(CXX_SUFFIX).slo:
	$(SH_CXX_COMPILE)

.y.c:
	$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
	if test -f y.tab.h; then \
	if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
	else :; fi

.l.c:
	$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@


#
# Standard build rules
#
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 $@ $<
depend: depend-recursive
clean: clean-recursive
distclean: distclean-recursive
extraclean: extraclean-recursive

install: all-recursive local-install
shared-build: shared-build-recursive

# 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:
all-recursive depend-recursive:
	@otarget=`echo $@|sed s/-recursive//`; \
	list='$(SUBDIRS)'; for i in $$list; do \
	list='$(SUBDIRS)'; \
	for i in $$list; do \
	    if test -d "$$i"; then \
		target="$$otarget"; \
		echo "Making $$target in $$i"; \
		if test "$$i" = "."; then \
			ok=yes; \
			target="$$target-p"; \
			made_local=yes; \
			target="local-$$target"; \
		fi; \
		(cd $$i && $(MAKE) $$target) || exit 1; \
	    fi; \
	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"`; \
	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"; \
			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"; \
			made_local=yes; \
			target="local-$$target"; \
		fi; \
				(cd $$i && $(MAKE) $$target) || exit 1; \
		(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-modules-recursive:
shared-build-recursive:
	@if test `pwd` = "$(top_builddir)"; then \
	    $(PRE_SHARED_CMDS) ; \
	fi; \
	list='$(SUBDIRS)'; for i in $$list; do \
		target="shared-modules"; \
	    target="shared-build"; \
	    if test "$$i" = "."; then \
			ok = yes; \
			target="shared-modules-p"; \
		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 modules: $(shared_targets)"; \
			if test -z '$(shared_targets)'; then ok=yes; fi; \
			if test "$$ok" != "yes"; then \
				$(MAKE) "shared-modules-p" || exit 1; \
	    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; \
@@ -206,43 +174,92 @@ shared-modules-recursive:
		$(POST_SHARED_CMDS) ; \
	fi

all-p: $(targets)
shared-modules-p: $(shared_targets)
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)

install-p: $(targets) $(shared_targets) $(install_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); \
		for i in $(PROGRAMS) ""; do \
		    if test "x$$i" != "x"; then \
	    list='$(PROGRAMS)'; for i in $$list; do \
	        $(INSTALL_PROGRAM) $$i $(bindir); \
		    fi; \
	    done; \
	fi

distclean-p depend-p clean-p:
# 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:

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
#
# Implicit rules for creating outputs from input files
#
CXX_SUFFIX = cpp
SHLIB_SUFFIX = so

clean: clean-recursive clean-x
.SUFFIXES:
.SUFFIXES: .S .c .$(CXX_SUFFIX) .lo .o .s .y .l .slo .def .la

clean-x:
	rm -f $(targets) *.slo *.lo *.la *.o *.obj $(CLEAN_TARGETS)
	rm -rf .libs
.c.o:
	$(COMPILE) -c $<

distclean: distclean-recursive clean-x
	rm -f config.cache config.log config.status config_vars.mk \
	stamp-h Makefile shlibtool .deps $(DISTCLEAN_TARGETS)
.s.o:
	$(COMPILE) -c $<

extraclean: distclean
	rm -f $(EXTRACLEAN_TARGETS)
.c.lo:
	$(LT_COMPILE)

.s.lo:
	$(LT_COMPILE)

.c.slo:
	$(SH_COMPILE)

.$(CXX_SUFFIX).lo:
	$(LT_CXX_COMPILE)

.$(CXX_SUFFIX).slo:
	$(SH_CXX_COMPILE)

.y.c:
	$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
	if test -f y.tab.h; then \
	if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
	else :; fi

.l.c:
	$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@

# Makes an import library from a def file
.def.la:
	$(LIBTOOL) --mode=compile $(MK_IMPLIB) -o $@ $<

#
# 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)
Loading