diff options
author | Bob Beck <beck@cvs.openbsd.org> | 1998-10-01 17:36:23 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 1998-10-01 17:36:23 +0000 |
commit | 950219bcd13066bb48b2cd43f6eab3db7c2d8f6e (patch) | |
tree | 3d29bbdedcd9a38223c26e47380027be57aa9e21 /usr.sbin/httpd | |
parent | 3838222615c2d2e0a04218e15970ae20cd90e972 (diff) |
fix conflict.
simplify a bit
Diffstat (limited to 'usr.sbin/httpd')
-rw-r--r-- | usr.sbin/httpd/src/Makefile.tmpl | 623 |
1 files changed, 478 insertions, 145 deletions
diff --git a/usr.sbin/httpd/src/Makefile.tmpl b/usr.sbin/httpd/src/Makefile.tmpl index 7014d713516..a1fea7c7c51 100644 --- a/usr.sbin/httpd/src/Makefile.tmpl +++ b/usr.sbin/httpd/src/Makefile.tmpl @@ -1,155 +1,488 @@ -# Apache makefile template (well, suffix). +## ==================================================================== +## Copyright (c) 1998 The Apache Group. All rights reserved. +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions +## are met: +## +## 1. Redistributions of source code must retain the above copyright +## notice, this list of conditions and the following disclaimer. +## +## 2. Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in +## the documentation and/or other materials provided with the +## distribution. +## +## 3. All advertising materials mentioning features or use of this +## software must display the following acknowledgment: +## "This product includes software developed by the Apache Group +## for use in the Apache HTTP server project (http://www.apache.org/)." +## +## 4. The names "Apache Server" and "Apache Group" must not be used to +## endorse or promote products derived from this software without +## prior written permission. For written permission, please contact +## apache@apache.org. +## +## 5. Products derived from this software may not be called "Apache" +## nor may "Apache" appear in their names without prior written +## permission of the Apache Group. +## +## 6. Redistributions of any form whatsoever must retain the following +## acknowledgment: +## "This product includes software developed by the Apache Group +## for use in the Apache HTTP server project (http://www.apache.org/)." +## +## THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY +## EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR +## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +## NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +## LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +## STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +## OF THE POSSIBILITY OF SUCH DAMAGE. +## ==================================================================== +## +## This software consists of voluntary contributions made by many +## individuals on behalf of the Apache Group and was originally based +## on public domain software written at the National Center for +## Supercomputing Applications, University of Illinois, Urbana-Champaign. +## For more information on the Apache Group and the Apache HTTP server +## project, please see <http://www.apache.org/>. +## -# This is combined with the information in the "Configuration" file -# by the configure script to make the actual Makefile. +## +## Makefile -- Apache Autoconf-style Interface (APACI) +## top-level control Makefile for out-of-the-box +## build and installation procedure. +## +## Written by Ralf S. Engelschall <rse@apache.org> +## -CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) -LIBS=$(EXTRA_LIBS) $(LIBS1) -INCLUDES=$(INCLUDES1) $(EXTRA_INCLUDES) -LFLAGS=$(LFLAGS1) $(EXTRA_LFLAGS) +## ================================================================== +## Options +## ================================================================== -OBJS= alloc.o http_main.o http_core.o http_config.o http_request.o \ - http_log.o http_protocol.o rfc1413.o util.o util_script.o modules.o buff.o\ - md5c.o util_md5.o explain.o http_bprintf.o util_date.o util_snprintf.o\ - $(MODULES) +# safe environment +SHELL = /bin/sh -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(SPACER) $< +# paths to the source tree parts +TOP = @TOP@ +SRC = @SRC@ +MKF = @MKF@ +AUX = @AUX@ -all: httpd +# build tools +CP = cp +LN = ln +RM = rm -f +TAR = tar +MKDIR = $(TOP)/$(AUX)/mkdir.sh +INSTALL = $(TOP)/$(AUX)/install.sh -c +INSTALL_PROGRAM = $(INSTALL) -s -m 755 +INSTALL_DSO = $(INSTALL) -m 755 +INSTALL_SCRIPT = $(INSTALL) -m 755 +INSTALL_DATA = $(INSTALL) -m 644 +PERL = @PERL@ -httpd: $(REGLIB) $(OBJS) - $(CC) $(LFLAGS) -o httpd $(OBJS) $(REGLIB) $(LIBS) +# installation root +# (overrideable by package maintainers for +# rolling packages without bristling the system) +root = -regex/libregex.a: - (cd regex; $(MAKE) lib CC='$(CC)' AUX_CFLAGS='$(CFLAGS)' RANLIB='$(RANLIB)') +# installation paths +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +mandir = @mandir@ +sysconfdir = @sysconfdir@ +datadir = @datadir@ +includedir = @includedir@ +localstatedir = @localstatedir@ +runtimedir = @runtimedir@ +logfiledir = @logfiledir@ +proxycachedir = @proxycachedir@ -modules/last-built: - (cd modules; \ - $(MAKE) CC='$(CC)' AUX_CFLAGS='$(CFLAGS)' RANLIB='$(RANLIB)') +libexecdir_relative = @libexecdir_relative@ +# suexec details (optional) +suexec = @suexec@ +suexec_caller = @suexec_caller@ +suexec_userdir = @suexec_userdir@ +suexec_uidmin = @suexec_uidmin@ +suexec_gidmin = @suexec_gidmin@ +suexec_safepath = @suexec_safepath@ + +# some substituted configuration parameters +conf_group = @conf_group@ +conf_port = @conf_port@ +conf_serveradmin = @conf_serveradmin@ +conf_servername = @conf_servername@ + +# usage of src/support stuff +build-support = @build_support@ +install-support = @install_support@ +clean-support = @clean_support@ +distclean-support = @distclean_support@ + +# forwarding arguments +MFWD = root=$(root) + +## ================================================================== +## Targets +## ================================================================== + +# default target +all: build + +## ------------------------------------------------------------------ +## Build Target +## ------------------------------------------------------------------ + +# build the package +build: + @echo "===> $(SRC)" + @$(MAKE) -f $(MKF) $(MFLAGS) $(MFWD) build-std $(build-support) + @touch $(TOP)/$(SRC)/.apaci.build.ok + @echo "<=== $(SRC)" + +# build the standard stuff +build-std: + @cd $(TOP)/$(SRC); $(MAKE) $(MFLAGS) SDP=$(SRC)/ all + +# build the additional support stuff +build-support: + @echo "===> $(SRC)/support"; \ + cd $(TOP)/$(SRC)/support; $(MAKE) $(MFLAGS) all; \ + if [ ".$(suexec)" = .1 ]; then \ + $(MAKE) $(MFLAGS) \ + EXTRA_CFLAGS='\ + -DHTTPD_USER=\"$(suexec_caller)\" \ + -DUID_MIN=$(suexec_uidmin) \ + -DGID_MIN=$(suexec_gidmin) \ + -DUSERDIR_SUFFIX=\"$(suexec_userdir)\" \ + -DLOG_EXEC=\"$(logfiledir)/suexec_log\" \ + -DDOC_ROOT=\"$(datadir)/htdocs\" \ + -DSAFE_PATH=\"$(suexec_safepath)\" \ + ' \ + suexec; \ + fi; \ + echo "<=== $(SRC)/support" + +## ------------------------------------------------------------------ +## Installation Targets +## ------------------------------------------------------------------ + +# the install target for installing the complete Apache +# package. This is implemented by running subtargets for the +# separate parts of the installation process. +install: + @if [ ! -f $(TOP)/$(SRC)/.apaci.build.ok ]; then \ + $(MAKE) -f $(MKF) $(MFLAGS) $(MFWD) build; \ + else \ + :; \ + fi + @$(MAKE) -f $(MKF) $(MFLAGS) $(MFWD) \ + install-mktree install-programs $(install-support) \ + install-include install-data install-config + -@$(RM) $(SRC)/.apaci.install.tmp + -@$(RM) $(SRC)/.apaci.install.conf + -@if [ ".$(QUIET)" != .1 ]; then \ + echo "+--------------------------------------------------------+"; \ + echo "| You now have successfully built and installed the |"; \ + echo "| Apache 1.3 HTTP server. To verify that Apache actually |"; \ + echo "| works correctly you now should first check the |"; \ + echo "| (initially created or preserved) configuration files |"; \ + echo "| |"; \ + echo "| $(sysconfdir)/{httpd,access,srm}.conf"; \ + echo "| |"; \ + echo "| and then you should be able to immediately fire up |"; \ + echo "| Apache the first time by running: |"; \ + echo "| |"; \ + echo "| $(sbindir)/apachectl start"; \ + echo "| |"; \ + echo "| Thanks for using Apache. The Apache Group |"; \ + echo "| http://www.apache.org/ |"; \ + echo "+--------------------------------------------------------+"; \ + fi + +# the non-verbose variant for package maintainers +install-quiet: + @$(MAKE) -f $(MKF) $(MFLAGS) $(MFWD) QUIET=1 install + +# create the installation tree +install-mktree: + @echo "===> [mktree: Creating Apache installation tree]" + $(MKDIR) $(root)$(bindir) + $(MKDIR) $(root)$(sbindir) + $(MKDIR) $(root)$(libexecdir) + $(MKDIR) $(root)$(mandir)/man1 + $(MKDIR) $(root)$(mandir)/man8 + $(MKDIR) $(root)$(sysconfdir) + $(MKDIR) $(root)$(datadir)/htdocs + $(MKDIR) $(root)$(datadir)/icons + $(MKDIR) $(root)$(datadir)/cgi-bin + $(MKDIR) $(root)$(includedir) + $(MKDIR) $(root)$(runtimedir) + $(MKDIR) $(root)$(logfiledir) + $(MKDIR) $(root)$(proxycachedir) + @echo "<=== [mktree]" + +# install the server program and optionally corresponding +# shared object files. +install-programs: + @echo "===> [programs: Installing Apache httpd program and shared objects]" + $(INSTALL_PROGRAM) $(TOP)/$(SRC)/httpd $(root)$(sbindir)/httpd + -@if [ ".`grep 'SUBTARGET=target_shared' $(TOP)/$(SRC)/Makefile`" != . ]; then \ + SHLIB_SUFFIX_NAME="`grep '^SHLIB_SUFFIX_NAME=' $(TOP)/$(SRC)/Makefile | sed -e 's:^.*=::'`"; \ + SHLIB_SUFFIX_LIST="`grep '^SHLIB_SUFFIX_LIST=' $(TOP)/$(SRC)/Makefile | sed -e 's:^.*=::'`"; \ + echo "$(INSTALL_DSO) $(TOP)/$(SRC)/libhttpd.ep $(root)$(libexecdir)/libhttpd.ep"; \ + $(INSTALL_DSO) $(TOP)/$(SRC)/libhttpd.ep $(root)$(libexecdir)/libhttpd.ep; \ + echo "$(INSTALL_DSO) $(TOP)/$(SRC)/libhttpd.$${SHLIB_SUFFIX_NAME} $(root)$(libexecdir)/libhttpd.$${SHLIB_SUFFIX_NAME}"; \ + $(INSTALL_DSO) $(TOP)/$(SRC)/libhttpd.$${SHLIB_SUFFIX_NAME} $(root)$(libexecdir)/libhttpd.$${SHLIB_SUFFIX_NAME}; \ + if [ ".$${SHLIB_SUFFIX_LIST}" != . ]; then \ + echo "$(RM) $(libexecdir)/libhttpd.$${SHLIB_SUFFIX_NAME}.*"; \ + $(RM) $(libexecdir)/libhttpd.$${SHLIB_SUFFIX_NAME}.*; \ + for suffix in $${SHLIB_SUFFIX_LIST} ""; do \ + [ ".$${suffix}" = . ] && continue; \ + echo "$(LN) $(root)$(libexecdir)/libhttpd.$${SHLIB_SUFFIX_NAME} $(root)$(libexecdir)/libhttpd.$${SHLIB_SUFFIX_NAME}.$${suffix}"; \ + $(LN) $(root)$(libexecdir)/libhttpd.$${SHLIB_SUFFIX_NAME} $(root)$(libexecdir)/libhttpd.$${SHLIB_SUFFIX_NAME}.$${suffix}; \ + done; \ + fi; \ + fi + $(INSTALL_DATA) $(TOP)/$(SRC)/support/httpd.8 $(root)$(mandir)/man8/httpd.8 + -@$(RM) $(SRC)/.apaci.install.conf; touch $(SRC)/.apaci.install.conf + -@if [ ".`grep '^[ ]*SharedModule' $(TOP)/$(SRC)/Configuration.apaci`" != . ]; then \ + for mod in `egrep '^[ ]*SharedModule' $(TOP)/$(SRC)/Configuration.apaci |\ + sed -e 's/^[ ]*SharedModule[ ]*//'`; do \ + file=`echo $${mod} | sed -e 's;^.*/\([^/]*\);\1;'`; \ + echo "$(INSTALL_DSO) $(TOP)/$(SRC)/$${mod} $(root)$(libexecdir)/$${file}"; \ + $(INSTALL_DSO) $(TOP)/$(SRC)/$${mod} $(root)$(libexecdir)/$${file}; \ + name=`$(TOP)/$(AUX)/fmn.sh $(TOP)/$(SRC)/$${mod}`; \ + echo dummy | awk '{ printf("LoadModule %-18s %s\n", modname, modpath); }' \ + modname="$${name}" modpath="$(libexecdir_relative)$${file}" >>$(SRC)/.apaci.install.conf; \ + done; \ + echo "" >>$(SRC)/.apaci.install.conf; \ + echo "# Reconstruction of the complete module list from all available modules" >>$(SRC)/.apaci.install.conf; \ + echo "# (static and shared ones) to achieve correct module execution order." >>$(SRC)/.apaci.install.conf; \ + echo "# [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]" >>$(SRC)/.apaci.install.conf; \ + echo "ClearModuleList" >>$(SRC)/.apaci.install.conf; \ + egrep "^[ ]*(Add|Shared)Module" $(SRC)/Configuration.apaci |\ + sed -e 's:SharedModule:AddModule:' \ + -e 's:modules/[^/]*/::' \ + -e 's:[ ]lib: mod_:' \ + -e 's:\.[soa]*$$:.c:' >>$(SRC)/.apaci.install.conf; \ + fi + @echo "<=== [programs]" + +# install the support programs and scripts +install-support: + @echo "===> [support: Installing Apache support programs and scripts]" + $(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/ab $(root)$(sbindir)/ab + $(INSTALL_DATA) $(TOP)/$(SRC)/support/ab.1 $(root)$(mandir)/man1/ab.1 + @echo "$(INSTALL_SCRIPT) $(TOP)/$(SRC)/support/apachectl[*] $(root)$(sbindir)/apachectl"; \ + sed -e 's;PIDFILE=.*;PIDFILE=$(runtimedir)/httpd.pid;' \ + -e 's;HTTPD=.*;HTTPD=$(sbindir)/httpd;' \ + < $(TOP)/$(SRC)/support/apachectl > $(TOP)/$(SRC)/.apaci.install.tmp && \ + $(INSTALL_SCRIPT) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(sbindir)/apachectl + $(INSTALL_DATA) $(TOP)/$(SRC)/support/apachectl.1 $(root)$(mandir)/man1/apachectl.1 + $(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/htpasswd $(root)$(bindir)/htpasswd + $(INSTALL_DATA) $(TOP)/$(SRC)/support/htpasswd.1 $(root)$(mandir)/man1/htpasswd.1 + $(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/htdigest $(root)$(bindir)/htdigest + $(INSTALL_DATA) $(TOP)/$(SRC)/support/htdigest.1 $(root)$(mandir)/man1/htdigest.1 + @echo "$(INSTALL_SCRIPT) $(TOP)/$(SRC)/support/dbmmanage[*] $(root)$(bindir)/dbmmanage"; \ + sed -e 's;^#!/.*;#!$(PERL);' \ + < $(TOP)/$(SRC)/support/dbmmanage > $(TOP)/$(SRC)/.apaci.install.tmp && \ + $(INSTALL_SCRIPT) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(bindir)/dbmmanage + $(INSTALL_DATA) $(TOP)/$(SRC)/support/dbmmanage.1 $(root)$(mandir)/man1/dbmmanage.1 + $(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/logresolve $(root)$(sbindir)/logresolve + $(INSTALL_DATA) $(TOP)/$(SRC)/support/logresolve.8 $(root)$(mandir)/man8/logresolve.8 + $(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/rotatelogs $(root)$(sbindir)/rotatelogs + $(INSTALL_DATA) $(TOP)/$(SRC)/support/rotatelogs.8 $(root)$(mandir)/man8/rotatelogs.8 + @echo "$(INSTALL_SCRIPT) $(TOP)/$(SRC)/support/apxs[*] $(root)$(sbindir)/apxs"; \ + sed -e 's;^#!/.*;#!$(PERL);' \ + -e 's;\@prefix\@;$(prefix);' \ + -e 's;\@sbindir\@;$(sbindir);' \ + -e 's;\@libexecdir\@;$(libexecdir);' \ + -e 's;\@includedir\@;$(includedir);' \ + -e 's;\@sysconfdir\@;$(sysconfdir);' \ + < $(TOP)/$(SRC)/support/apxs > $(TOP)/$(SRC)/.apaci.install.tmp && \ + $(INSTALL_SCRIPT) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(sbindir)/apxs + $(INSTALL_DATA) $(TOP)/$(SRC)/support/apxs.8 $(root)$(mandir)/man8/apxs.8 + -@if [ ".$(suexec)" = .1 ]; then \ + echo "$(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/suexec $(root)$(sbindir)/suexec"; \ + $(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/suexec $(root)$(sbindir)/suexec; \ + echo "chown root $(root)$(sbindir)/suexec"; \ + chown root $(root)$(sbindir)/suexec; \ + echo "chmod 4711 $(root)$(sbindir)/suexec"; \ + chmod 4711 $(root)$(sbindir)/suexec; \ + echo "$(INSTALL_DATA) $(TOP)/$(SRC)/support/suexec.8 $(root)$(mandir)/man8/suexec.8"; \ + $(INSTALL_DATA) $(TOP)/$(SRC)/support/suexec.8 $(root)$(mandir)/man8/suexec.8; \ + fi + @echo "<=== [support]" + +# install the Apache C header files +install-include: + @echo "===> [include: Installing Apache C header files]" + $(CP) $(TOP)/$(SRC)/include/*.h $(root)$(includedir)/ + @osdir=`grep '^OSDIR=' $(TOP)/$(SRC)/Makefile.config | sed -e 's:^OSDIR=.*/os:os:'`; \ + echo "$(CP) $(TOP)/$(SRC)/$${osdir}/os.h $(root)$(includedir)/"; \ + $(CP) $(TOP)/$(SRC)/$${osdir}/os.h $(root)$(includedir)/ + chmod 644 $(root)$(includedir)/*.h + @echo "<=== [include]" + +# create an initial document root containing the Apache manual, +# icons and distributed CGI scripts. +install-data: + @echo "===> [data: Installing initial data files]" + -@if [ -f $(root)$(datadir)/htdocs/index.html ]; then \ + echo "[PRESERVING EXISTING DATA SUBDIR: $(root)$(datadir)/htdocs/]"; \ + else \ + echo "Copying tree $(TOP)/htdocs/ -> $(root)$(datadir)/htdocs/"; \ + (cd $(TOP)/htdocs/ && $(TAR) cf - *) |\ + (cd $(root)$(datadir)/htdocs/ && $(TAR) xf -); \ + find $(root)$(datadir)/htdocs/ -type d -exec chmod a+rx {} \; ; \ + find $(root)$(datadir)/htdocs/ -type f -exec chmod a+r {} \; ; \ + fi + -@if [ -f $(root)$(datadir)/cgi-bin/printenv ]; then \ + echo "[PRESERVING EXISTING DATA SUBDIR: $(root)$(datadir)/cgi-bin/]"; \ + else \ + for script in printenv test-cgi; do \ + cat $(TOP)/cgi-bin/$${script} |\ + sed -e 's;^#!/.*perl;#!$(PERL);' \ + > $(TOP)/$(SRC)/.apaci.install.tmp; \ + echo "$(INSTALL_DATA) $(TOP)/conf/$${script}[*] $(root)$(datadir)/cgi-bin/$${script}"; \ + $(INSTALL_DATA) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(datadir)/cgi-bin/$${script}; \ + done; \ + fi + @echo "Copying tree $(TOP)/icons/ -> $(root)$(datadir)/icons/"; \ + (cd $(TOP)/icons/ && $(TAR) cf - *) |\ + (cd $(root)$(datadir)/icons/ && $(TAR) xf -); \ + find $(root)$(datadir)/icons/ -type d -exec chmod a+rx {} \; ;\ + find $(root)$(datadir)/icons/ -type f -exec chmod a+r {} \; + @echo "<=== [data]" + +# create the initial configuration by providing default files +# and initial config files while preserving existing ones. +install-config: + @echo "===> [config: Installing Apache configuration files]" + -@for conf in httpd.conf access.conf srm.conf; do \ + (echo "##"; \ + echo "## $${conf} -- Apache HTTP server configuration file"; \ + echo "##"; \ + echo ""; \ + cat $(TOP)/conf/$${conf}-dist ) |\ + sed -e '/# LoadModule/r $(TOP)/$(SRC)/.apaci.install.conf' \ + -e 's;@@ServerRoot@@/htdocs;$(datadir)/htdocs;' \ + -e 's;@@ServerRoot@@/icons;$(datadir)/icons;' \ + -e 's;@@ServerRoot@@/cgi-bin;$(datadir)/cgi-bin;' \ + -e 's;@@ServerRoot@@/proxy;$(proxycachedir);' \ + -e 's;@@ServerRoot@@;$(prefix);' \ + -e 's;logs/accept.lock;$(runtimedir)/httpd.lock;' \ + -e 's;logs/apache_runtime_status;$(runtimedir)/httpd.scoreboard;' \ + -e 's;logs/httpd.pid;$(runtimedir)/httpd.pid;' \ + -e 's;logs/access_log;$(logfiledir)/access_log;' \ + -e 's;logs/error_log;$(logfiledir)/error_log;' \ + -e 's;logs/referer_log;$(logfiledir)/referer_log;' \ + -e 's;logs/agent_log;$(logfiledir)/agent_log;' \ + -e 's;conf/magic;$(sysconfdir)/magic;' \ + -e 's;conf/mime.types;$(sysconfdir)/mime.types;' \ + -e 's;Group #-1;Group $(conf_group);' \ + -e 's;Port 80;Port $(conf_port);' \ + -e 's;ServerAdmin you@your.address;ServerAdmin $(conf_serveradmin);' \ + -e 's;ServerName new.host.name;ServerName $(conf_servername);' \ + > $(TOP)/$(SRC)/.apaci.install.tmp && \ + echo "$(INSTALL_DATA) $(TOP)/conf/$${conf}-dist[*] $(root)$(sysconfdir)/$${conf}.default"; \ + $(INSTALL_DATA) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(sysconfdir)/$${conf}.default; \ + if [ ! -f "$(root)$(sysconfdir)/$${conf}" ]; then \ + echo "$(INSTALL_DATA) $(TOP)/conf/$${conf}-dist[*] $(root)$(sysconfdir)/$${conf}"; \ + $(INSTALL_DATA) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(sysconfdir)/$${conf}; \ + else \ + echo "[PRESERVING EXISTING CONFIG FILE: $(root)$(sysconfdir)/$${conf}]"; \ + fi; \ + done + -@for conf in mime.types magic; do \ + echo "$(INSTALL_DATA) $(TOP)/conf/$${conf} $(root)$(sysconfdir)/$${conf}.default"; \ + $(INSTALL_DATA) $(TOP)/conf/$${conf} $(root)$(sysconfdir)/$${conf}.default; \ + if [ ! -f "$(root)$(sysconfdir)/$${conf}" ]; then \ + echo "$(INSTALL_DATA) $(TOP)/conf/$${conf} $(root)$(sysconfdir)/$${conf}"; \ + $(INSTALL_DATA) $(TOP)/conf/$${conf} $(root)$(sysconfdir)/$${conf}; \ + else \ + echo "[PRESERVING EXISTING CONFIG FILE: $(root)$(sysconfdir)/$${conf}]"; \ + fi; \ + done + @echo "<=== [config]" + + +## ------------------------------------------------------------------ +## Cleanup Targets +## ------------------------------------------------------------------ + +# cleanup the source tree by removing anything which was +# created by the build target clean: - rm -f httpd *.o core - cd regex; $(MAKE) clean - cd modules; $(MAKE) clean - -dist.tar: - # Assure a semi-sensible configuration going out... - cp Makefile.orig Makefile - cp modules.c.orig modules.c - tar cvf dist.tar README INSTALL CHANGES TODO API.html \ - Configuration Configure Makefile.tmpl Makefile *.h *.c - -# Work around broken compilers -http_bprintf.o: http_bprintf.c - $(CC) -c $(INCLUDES) $(CFLAGS) $(BROKEN_BPRINTF_FLAGS) http_bprintf.c - -# We really don't expect end users to use this rule. It works only with -# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after -# using it. -depend: - sed -ne '1,/^# DO NOT REMOVE/p' Makefile.tmpl > Makefile.new \ - && $(CC) -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ - && mv Makefile.tmpl Makefile.tmpl.bak \ - && mv Makefile.new Makefile.tmpl - -#Dependencies - -$(OBJS): Makefile - -# DO NOT REMOVE -alloc.o: alloc.c httpd.h conf.h alloc.h buff.h -buff.o: buff.c conf.h alloc.h buff.h -explain.o: explain.c explain.h -http_bprintf.o: http_bprintf.c conf.h alloc.h buff.h -http_config.o: http_config.c httpd.h conf.h alloc.h buff.h \ - http_config.h http_core.h http_log.h http_request.h \ - http_conf_globals.h explain.h -http_core.o: http_core.c httpd.h conf.h alloc.h buff.h http_config.h \ - http_core.h http_protocol.h http_conf_globals.h http_main.h \ - http_log.h rfc1413.h util_md5.h md5.h scoreboard.h -http_log.o: http_log.c httpd.h conf.h alloc.h buff.h http_config.h \ - http_core.h http_log.h -http_main.o: http_main.c httpd.h conf.h alloc.h buff.h http_main.h \ - http_log.h http_config.h http_protocol.h http_request.h \ - http_conf_globals.h http_core.h scoreboard.h explain.h -http_protocol.o: http_protocol.c httpd.h conf.h alloc.h buff.h \ - http_config.h http_core.h http_protocol.h http_main.h http_log.h \ - util_date.h -http_request.o: http_request.c httpd.h conf.h alloc.h buff.h \ - http_config.h http_request.h http_core.h http_protocol.h http_log.h \ - http_main.h scoreboard.h -md5c.o: md5c.c md5.h -mod_access.o: mod_access.c httpd.h conf.h alloc.h buff.h http_core.h \ - http_config.h http_log.h http_request.h -mod_actions.o: mod_actions.c httpd.h conf.h alloc.h buff.h \ - http_config.h http_request.h http_core.h http_protocol.h http_main.h \ - http_log.h util_script.h -mod_alias.o: mod_alias.c httpd.h conf.h alloc.h buff.h http_config.h -mod_asis.o: mod_asis.c httpd.h conf.h alloc.h buff.h http_config.h \ - http_protocol.h http_log.h util_script.h http_main.h http_request.h -mod_auth.o: mod_auth.c httpd.h conf.h alloc.h buff.h http_config.h \ - http_core.h http_log.h http_protocol.h -mod_auth_anon.o: mod_auth_anon.c httpd.h conf.h alloc.h buff.h \ - http_config.h http_core.h http_log.h http_protocol.h -mod_auth_db.o: mod_auth_db.c httpd.h conf.h alloc.h buff.h \ - http_config.h http_core.h http_log.h http_protocol.h -mod_auth_dbm.o: mod_auth_dbm.c httpd.h conf.h alloc.h buff.h \ - http_config.h http_core.h http_log.h http_protocol.h -mod_auth_msql.o: mod_auth_msql.c httpd.h conf.h alloc.h buff.h \ - http_config.h http_core.h http_log.h http_protocol.h -mod_browser.o: mod_browser.c httpd.h conf.h alloc.h buff.h \ - http_config.h -mod_cern_meta.o: mod_cern_meta.c httpd.h conf.h alloc.h buff.h \ - http_config.h util_script.h http_log.h http_request.h -mod_cgi.o: mod_cgi.c httpd.h conf.h alloc.h buff.h http_config.h \ - http_request.h http_core.h http_protocol.h http_main.h http_log.h \ - util_script.h http_conf_globals.h -mod_digest.o: mod_digest.c httpd.h conf.h alloc.h buff.h http_config.h \ - http_core.h http_log.h http_protocol.h util_md5.h md5.h -mod_dir.o: mod_dir.c httpd.h conf.h alloc.h buff.h http_config.h \ - http_core.h http_request.h http_protocol.h http_log.h http_main.h \ - util_script.h -mod_dld.o: mod_dld.c httpd.h conf.h alloc.h buff.h http_config.h \ - http_conf_globals.h -mod_env.o: mod_env.c httpd.h conf.h alloc.h buff.h http_config.h -mod_expires.o: mod_expires.c httpd.h conf.h alloc.h buff.h \ - http_config.h http_log.h -mod_headers.o: mod_headers.c httpd.h conf.h alloc.h buff.h \ - http_config.h -mod_imap.o: mod_imap.c httpd.h conf.h alloc.h buff.h http_config.h \ - http_request.h http_core.h http_protocol.h http_main.h http_log.h \ - util_script.h -mod_include.o: mod_include.c httpd.h conf.h alloc.h buff.h \ - http_config.h http_request.h http_core.h http_protocol.h http_log.h \ - http_main.h util_script.h -mod_info.o: mod_info.c httpd.h conf.h alloc.h buff.h http_config.h \ - http_core.h http_log.h http_main.h http_protocol.h util_script.h -mod_log_agent.o: mod_log_agent.c httpd.h conf.h alloc.h buff.h \ - http_config.h -mod_log_config.o: mod_log_config.c httpd.h conf.h alloc.h buff.h \ - http_config.h http_core.h -mod_log_referer.o: mod_log_referer.c httpd.h conf.h alloc.h buff.h \ - http_config.h -mod_mime.o: mod_mime.c httpd.h conf.h alloc.h buff.h http_config.h -mod_negotiation.o: mod_negotiation.c httpd.h conf.h alloc.h buff.h \ - http_config.h http_request.h http_core.h http_log.h util_script.h -mod_rewrite.o: mod_rewrite.c httpd.h conf.h alloc.h buff.h \ - http_config.h http_request.h http_core.h http_log.h mod_rewrite.h -mod_status.o: mod_status.c httpd.h conf.h alloc.h buff.h http_config.h \ - http_core.h http_protocol.h http_main.h util_script.h scoreboard.h \ - http_log.h -mod_userdir.o: mod_userdir.c httpd.h conf.h alloc.h buff.h \ - http_config.h -mod_usertrack.o: mod_usertrack.c httpd.h conf.h alloc.h buff.h \ - http_config.h http_core.h -modules.o: modules.c httpd.h conf.h alloc.h buff.h http_config.h -rfc1413.o: rfc1413.c httpd.h conf.h alloc.h buff.h http_log.h \ - rfc1413.h -util.o: util.c httpd.h conf.h alloc.h buff.h http_conf_globals.h -util_date.o: util_date.c util_date.h -util_md5.o: util_md5.c httpd.h conf.h alloc.h buff.h util_md5.h md5.h -util_script.o: util_script.c httpd.h conf.h alloc.h buff.h \ - http_config.h http_conf_globals.h http_main.h http_log.h \ - http_protocol.h http_core.h http_request.h util_script.h -util_snprintf.o: util_snprintf.c conf.h + @echo "===> $(SRC)" + @$(MAKE) -f $(MKF) $(MFLAGS) $(MFWD) clean-std $(clean-support) + @echo "<=== $(SRC)" + @$(RM) $(TOP)/$(SRC)/.apaci.build.ok + +# clean the standard stuff +clean-std: + @cd $(TOP)/$(SRC); $(MAKE) $(MFLAGS) SDP=$(SRC)/ clean + +# clean additional support stuff +clean-support: + @echo "===> $(SRC)/support"; \ + cd $(TOP)/$(SRC)/support; $(MAKE) $(MFLAGS) clean; \ + if [ ".$(suexec)" = .1 ]; then \ + echo "$(RM) suexec"; \ + $(RM) suexec; \ + fi; \ + echo "<=== $(SRC)/support" + +# cleanup the source tree by removing anything which was +# created by the configure step and the build target. +# When --shadow is used we just remove the complete shadow tree. +distclean: + @if [ ".$(SRC)" = .src ]; then \ + $(MAKE) -f $(MKF) $(MFLAGS) $(MFWD) distclean-normal; \ + else \ + $(MAKE) -f $(MKF) $(MFLAGS) $(MFWD) distclean-shadow; \ + fi + +distclean-normal: + @echo "===> $(SRC)" + @$(MAKE) -f $(MKF) $(MFLAGS) $(MFWD) distclean-std $(distclean-support) + @echo "<=== $(SRC)" + -$(RM) $(SRC)/Configuration.apaci + -$(RM) $(SRC)/apaci + @$(RM) $(SRC)/.apaci.build.ok + -$(RM) Makefile + -$(RM) config.status + +# clean the standard stuff +distclean-std: + @cd $(TOP)/$(SRC); $(MAKE) $(MFLAGS) SDP=$(SRC)/ distclean + +distclean-support: + @echo "===> $(SRC)/support"; \ + cd $(TOP)/$(SRC)/support; $(MAKE) $(MFLAGS) distclean; \ + if [ ".$(suexec)" = .1 ]; then \ + echo "$(RM) suexec"; \ + $(RM) suexec; \ + fi; \ + echo "<=== $(SRC)/support" + +distclean-shadow: + $(RM) -r $(SRC) + $(RM) $(MKF) + -@if [ ".`ls $(TOP)/src.* 2>/dev/null`" = . ]; then \ + echo "$(RM) Makefile"; \ + $(RM) Makefile; \ + fi + |