home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 August / PCWorld_2001-08_cd.bin / Komunikace / phptriad / phptriadsetup2-11.exe / Makefile.tmpl < prev    next >
Makefile  |  2000-04-13  |  27KB  |  613 lines

  1. ## ====================================================================
  2. ## Copyright (c) 1998-1999 The Apache Group.  All rights reserved.
  3. ##
  4. ## Redistribution and use in source and binary forms, with or without
  5. ## modification, are permitted provided that the following conditions
  6. ## are met:
  7. ##
  8. ## 1. Redistributions of source code must retain the above copyright
  9. ##    notice, this list of conditions and the following disclaimer.
  10. ##
  11. ## 2. Redistributions in binary form must reproduce the above copyright
  12. ##    notice, this list of conditions and the following disclaimer in
  13. ##    the documentation and/or other materials provided with the
  14. ##    distribution.
  15. ##
  16. ## 3. All advertising materials mentioning features or use of this
  17. ##    software must display the following acknowledgment:
  18. ##    "This product includes software developed by the Apache Group
  19. ##    for use in the Apache HTTP server project (http://www.apache.org/)."
  20. ##
  21. ## 4. The names "Apache Server" and "Apache Group" must not be used to
  22. ##    endorse or promote products derived from this software without
  23. ##    prior written permission. For written permission, please contact
  24. ##    apache@apache.org.
  25. ##
  26. ## 5. Products derived from this software may not be called "Apache"
  27. ##    nor may "Apache" appear in their names without prior written
  28. ##    permission of the Apache Group.
  29. ##
  30. ## 6. Redistributions of any form whatsoever must retain the following
  31. ##    acknowledgment:
  32. ##    "This product includes software developed by the Apache Group
  33. ##    for use in the Apache HTTP server project (http://www.apache.org/)."
  34. ##
  35. ## THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
  36. ## EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  37. ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  38. ## PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
  39. ## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  40. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  41. ## NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  42. ## LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  43. ## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  44. ## STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  45. ## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  46. ## OF THE POSSIBILITY OF SUCH DAMAGE.
  47. ## ====================================================================
  48. ##
  49. ## This software consists of voluntary contributions made by many
  50. ## individuals on behalf of the Apache Group and was originally based
  51. ## on public domain software written at the National Center for
  52. ## Supercomputing Applications, University of Illinois, Urbana-Champaign.
  53. ## For more information on the Apache Group and the Apache HTTP server
  54. ## project, please see <http://www.apache.org/>.
  55. ##
  56.  
  57. ##
  58. ##  Makefile -- Apache Autoconf-style Interface (APACI)
  59. ##              top-level control Makefile for out-of-the-box
  60. ##              build and installation procedure.
  61. ##
  62. ##  Written by Ralf S. Engelschall <rse@apache.org>
  63. ##
  64.  
  65. ## ==================================================================
  66. ##                              Options
  67. ## ==================================================================
  68.  
  69. #   safe environment
  70. SHELL           = @SHELL@
  71.  
  72. #   what platform are we on
  73. PLATFORM    = @PLATFORM@
  74.  
  75. #   paths to the source tree parts
  76. TOP             = .
  77. SRC             = @SRC@
  78. MKF             = @MKF@
  79. AUX             = @AUX@
  80.  
  81. #   build tools
  82. CP              = cp
  83. LN              = ln
  84. RM              = rm -f
  85. MKDIR           = $(TOP)/$(AUX)/mkdir.sh
  86. INSTALL         = $(TOP)/$(AUX)/install.sh -c
  87. IFLAGS_PROGRAM  = @IFLAGS_PROGRAM@
  88. IFLAGS_CORE     = @IFLAGS_CORE@
  89. IFLAGS_DSO      = @IFLAGS_DSO@
  90. IFLAGS_SCRIPT   = @IFLAGS_SCRIPT@
  91. IFLAGS_DATA     = @IFLAGS_DATA@
  92. INSTALL_PROGRAM = $(INSTALL) $(IFLAGS_PROGRAM)
  93. INSTALL_CORE    = $(INSTALL) $(IFLAGS_CORE)
  94. INSTALL_DSO     = $(INSTALL) $(IFLAGS_DSO)
  95. INSTALL_SCRIPT  = $(INSTALL) $(IFLAGS_SCRIPT)
  96. INSTALL_DATA    = $(INSTALL) $(IFLAGS_DATA)
  97. PERL            = @PERL@
  98. TAR        = @TAR@
  99. TAROPT        = @TAROPT@
  100.  
  101. #   installation name of Apache webserver
  102. TARGET          = @TARGET@
  103.  
  104. #   installation root 
  105. #   (overrideable by package maintainers for
  106. #   rolling packages without bristling the system)
  107. root            =
  108.  
  109. #   installation paths
  110. prefix          = @prefix@
  111. exec_prefix     = @exec_prefix@
  112. bindir          = @bindir@
  113. sbindir         = @sbindir@
  114. libexecdir      = @libexecdir@
  115. mandir          = @mandir@
  116. sysconfdir      = @sysconfdir@
  117. datadir         = @datadir@
  118. iconsdir        = @iconsdir@
  119. htdocsdir       = @htdocsdir@
  120. cgidir          = @cgidir@
  121. includedir      = @includedir@
  122. localstatedir   = @localstatedir@
  123. runtimedir      = @runtimedir@
  124. logfiledir      = @logfiledir@
  125. proxycachedir   = @proxycachedir@
  126.  
  127. libexecdir_relative   = @libexecdir_relative@
  128.  
  129. #   suexec details (optional)
  130. suexec          = @suexec@
  131. suexec_caller   = @suexec_caller@
  132. suexec_docroot  = @suexec_docroot@
  133. suexec_logexec  = @suexec_logexec@
  134. suexec_userdir  = @suexec_userdir@
  135. suexec_uidmin   = @suexec_uidmin@
  136. suexec_gidmin   = @suexec_gidmin@
  137. suexec_safepath = @suexec_safepath@
  138. suexec_umask    = @suexec_umask@
  139.  
  140. #   some substituted configuration parameters
  141. conf_user        = @conf_user@
  142. conf_group       = @conf_group@
  143. conf_port        = @conf_port@
  144. conf_serveradmin = @conf_serveradmin@
  145. conf_servername  = @conf_servername@
  146.  
  147. #   usage of src/support stuff
  148. build-support     = @build_support@
  149. install-support   = @install_support@
  150. clean-support     = @clean_support@
  151. distclean-support = @distclean_support@
  152.  
  153. #   forwarding arguments
  154. MFWD = root=$(root)
  155.  
  156. ## ==================================================================
  157. ##                              Targets
  158. ## ==================================================================
  159.  
  160. #   default target
  161. all: build
  162.  
  163. ## ------------------------------------------------------------------
  164. ##                           Build Target
  165. ## ------------------------------------------------------------------
  166.  
  167. #   build the package
  168. build:
  169.     @echo "===> $(SRC)"
  170.     @$(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) build-std
  171.     @if [ "x$(build-support)" != "x" ]; then \
  172.         $(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) $(build-support); \
  173.         fi
  174.     @touch $(TOP)/$(SRC)/.apaci.build.ok
  175.     @echo "<=== $(SRC)"
  176.  
  177. #   the non-verbose variant for package maintainers
  178. build-quiet:
  179.     @$(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) QUIET=1 build
  180.  
  181. #   build the standard stuff
  182. build-std:
  183.     @case "x$(PLATFORM)" in \
  184.       x*390*) _C89_STEPS="0xffffffff"; export _C89_STEPS;; \
  185.     esac; \
  186.     cd $(TOP)/$(SRC); $(MAKE) $(MFLAGS) SDP=$(SRC)/ all
  187.  
  188. #   build the additional support stuff
  189. build-support:
  190.     @echo "===> $(SRC)/support"; \
  191.     case "x$(PLATFORM)" in \
  192.       x*390*) _C89_STEPS="0xffffffff"; export _C89_STEPS;; \
  193.     esac; \
  194.     cd $(TOP)/$(SRC)/support; $(MAKE) $(MFLAGS) all || exit 1; \
  195.     if [ ".$(suexec)" = .1 ]; then \
  196.         $(MAKE) $(MFLAGS) \
  197.         EXTRA_CFLAGS='\
  198.             $(suexec_umask) \
  199.             -DHTTPD_USER=\"$(suexec_caller)\" \
  200.             -DUID_MIN=$(suexec_uidmin) \
  201.             -DGID_MIN=$(suexec_gidmin) \
  202.             -DUSERDIR_SUFFIX=\"$(suexec_userdir)\" \
  203.             -DLOG_EXEC=\"$(suexec_logexec)\" \
  204.             -DDOC_ROOT=\"$(suexec_docroot)\" \
  205.             -DSAFE_PATH=\"$(suexec_safepath)\"' \
  206.         suexec; \
  207.     fi
  208.     @echo "<=== $(SRC)/support"
  209.  
  210. ## ------------------------------------------------------------------
  211. ##                       Installation Targets
  212. ## ------------------------------------------------------------------
  213.  
  214. #   indirection step to avoid conflict with INSTALL document 
  215. #   on case-insenstive filesystems, for instance on OS/2
  216. install: install-all
  217.  
  218. #   the install target for installing the complete Apache
  219. #   package. This is implemented by running subtargets for the
  220. #   separate parts of the installation process.
  221. install-all:
  222.     @if [ ! -f $(TOP)/$(SRC)/.apaci.build.ok ]; then \
  223.         $(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) build; \
  224.     else \
  225.         :; \
  226.     fi
  227.     @$(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) \
  228.         install-mktree install-programs $(install-support) \
  229.         install-include install-data install-config
  230.     -@$(RM) $(SRC)/.apaci.install.tmp
  231.     -@$(RM) $(SRC)/.apaci.install.conf
  232.     -@if [ ".$(QUIET)" != .1 ]; then \
  233.         if [ ".$(TARGET)" = .httpd ]; then \
  234.             apachectl='apachectl'; \
  235.         else \
  236.             apachectl="$(TARGET)ctl"; \
  237.         fi; \
  238.         echo "+--------------------------------------------------------+"; \
  239.         echo "| You now have successfully built and installed the      |"; \
  240.         echo "| Apache 1.3 HTTP server. To verify that Apache actually |"; \
  241.         echo "| works correctly you now should first check the         |"; \
  242.         echo "| (initially created or preserved) configuration files   |"; \
  243.         echo "|                                                        |"; \
  244.         echo "|   $(sysconfdir)/$(TARGET).conf"; \
  245.         echo "|                                                        |"; \
  246.         echo "| and then you should be able to immediately fire up     |"; \
  247.         echo "| Apache the first time by running:                      |"; \
  248.         echo "|                                                        |"; \
  249.         echo "|   $(sbindir)/$${apachectl} start"; \
  250.         echo "|                                                        |"; \
  251.         echo "| Thanks for using Apache.       The Apache Group        |"; \
  252.         echo "|                                http://www.apache.org/  |"; \
  253.         echo "+--------------------------------------------------------+"; \
  254.     fi
  255.  
  256. #   the non-verbose variant for package maintainers
  257. install-quiet:
  258.     @$(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) QUIET=1 install-all
  259.  
  260. #   create the installation tree
  261. install-mktree:
  262.     @echo "===> [mktree: Creating Apache installation tree]"
  263.     $(MKDIR) $(root)$(bindir)
  264.     $(MKDIR) $(root)$(sbindir)
  265.     $(MKDIR) $(root)$(libexecdir)
  266.     $(MKDIR) $(root)$(mandir)/man1
  267.     $(MKDIR) $(root)$(mandir)/man8
  268.     $(MKDIR) $(root)$(sysconfdir)
  269.     $(MKDIR) $(root)$(htdocsdir)
  270.     $(MKDIR) $(root)$(iconsdir)
  271.     $(MKDIR) $(root)$(cgidir)
  272.     $(MKDIR) $(root)$(includedir)
  273.     $(MKDIR) $(root)$(includedir)/xml
  274.     $(MKDIR) $(root)$(runtimedir)
  275.     $(MKDIR) $(root)$(logfiledir)
  276.     $(MKDIR) $(root)$(proxycachedir)
  277.     -@if [ "x`$(AUX)/getuid.sh`" = "x0" ]; then \
  278.         echo "chown $(conf_user) $(root)$(proxycachedir)"; \
  279.         chown $(conf_user) $(root)$(proxycachedir); \
  280.         echo "chgrp $(conf_group) $(root)$(proxycachedir)"; \
  281.         chgrp "$(conf_group)" $(root)$(proxycachedir); \
  282.     fi
  283.     @echo "<=== [mktree]"
  284.  
  285. #   install the server program and optionally corresponding
  286. #   shared object files.
  287. install-programs:
  288.     @echo "===> [programs: Installing Apache $(TARGET) program and shared objects]"
  289.     -@if [ ".`grep '^[     ]*AddModule.*mod_so\.o' $(TOP)/$(SRC)/Configuration.apaci`" != . ]; then \
  290.         echo "$(INSTALL_CORE) $(TOP)/$(SRC)/$(TARGET) $(root)$(sbindir)/$(TARGET)"; \
  291.         $(INSTALL_CORE) $(TOP)/$(SRC)/$(TARGET) $(root)$(sbindir)/$(TARGET); \
  292.         SHLIB_EXPORT_FILES="`grep '^SHLIB_EXPORT_FILES=' $(TOP)/$(SRC)/Makefile | sed -e 's:^.*=::'`"; \
  293.         if [ ".$${SHLIB_EXPORT_FILES}" != . ]; then \
  294.             $(CP) $(TOP)/$(SRC)/support/httpd.exp $(root)$(libexecdir)/; \
  295.             chmod 644 $(root)$(libexecdir)/httpd.exp; \
  296.         fi; \
  297.     else \
  298.         echo "$(INSTALL_PROGRAM) $(TOP)/$(SRC)/$(TARGET) $(root)$(sbindir)/$(TARGET)"; \
  299.         $(INSTALL_PROGRAM) $(TOP)/$(SRC)/$(TARGET) $(root)$(sbindir)/$(TARGET); \
  300.     fi
  301.     -@if [ ".`grep 'SUBTARGET=target_shared' $(TOP)/$(SRC)/Makefile`" != . ]; then \
  302.         SHLIB_SUFFIX_NAME="`grep '^SHLIB_SUFFIX_NAME=' $(TOP)/$(SRC)/Makefile | sed -e 's:^.*=::'`"; \
  303.         SHLIB_SUFFIX_LIST="`grep '^SHLIB_SUFFIX_LIST=' $(TOP)/$(SRC)/Makefile | sed -e 's:^.*=::'`"; \
  304.         echo "$(INSTALL_CORE) $(TOP)/$(SRC)/lib$(TARGET).ep $(root)$(libexecdir)/lib$(TARGET).ep"; \
  305.         $(INSTALL_CORE) $(TOP)/$(SRC)/lib$(TARGET).ep $(root)$(libexecdir)/lib$(TARGET).ep; \
  306.         echo "$(INSTALL_DSO) $(TOP)/$(SRC)/lib$(TARGET).$${SHLIB_SUFFIX_NAME} $(root)$(libexecdir)/lib$(TARGET).$${SHLIB_SUFFIX_NAME}"; \
  307.         $(INSTALL_DSO) $(TOP)/$(SRC)/lib$(TARGET).$${SHLIB_SUFFIX_NAME} $(root)$(libexecdir)/lib$(TARGET).$${SHLIB_SUFFIX_NAME}; \
  308.         if [ ".$${SHLIB_SUFFIX_LIST}" != . ]; then \
  309.             echo "$(RM) $(libexecdir)/lib$(TARGET).$${SHLIB_SUFFIX_NAME}.*"; \
  310.             $(RM) $(libexecdir)/lib$(TARGET).$${SHLIB_SUFFIX_NAME}.*; \
  311.             for suffix in $${SHLIB_SUFFIX_LIST} ""; do \
  312.                 [ ".$${suffix}" = . ] && continue; \
  313.                 echo "$(LN) $(root)$(libexecdir)/lib$(TARGET).$${SHLIB_SUFFIX_NAME} $(root)$(libexecdir)/lib$(TARGET).$${SHLIB_SUFFIX_NAME}.$${suffix}"; \
  314.                 $(LN) $(root)$(libexecdir)/lib$(TARGET).$${SHLIB_SUFFIX_NAME} $(root)$(libexecdir)/lib$(TARGET).$${SHLIB_SUFFIX_NAME}.$${suffix}; \
  315.             done; \
  316.         fi; \
  317.     fi
  318.     $(INSTALL_DATA) $(TOP)/$(SRC)/support/httpd.8 $(root)$(mandir)/man8/$(TARGET).8
  319.     -@$(RM) $(SRC)/.apaci.install.conf; touch $(SRC)/.apaci.install.conf
  320.     -@if [ ".`grep '^[     ]*SharedModule' $(TOP)/$(SRC)/Configuration.apaci`" != . ]; then \
  321.         for mod in `egrep '^[     ]*SharedModule' $(TOP)/$(SRC)/Configuration.apaci |\
  322.                     sed -e 's/^[     ]*SharedModule[     ]*//'`; do \
  323.             file=`echo $${mod} | sed -e 's;^.*/\([^/]*\);\1;'`; \
  324.             echo "$(INSTALL_DSO) $(TOP)/$(SRC)/$${mod} $(root)$(libexecdir)/$${file}"; \
  325.             $(INSTALL_DSO) $(TOP)/$(SRC)/$${mod} $(root)$(libexecdir)/$${file}; \
  326.             name=`$(TOP)/$(AUX)/fmn.sh $(TOP)/$(SRC)/$${mod}`; \
  327.             echo dummy | awk '{ printf("LoadModule %-18s %s\n", modname, modpath); }' \
  328.             modname="$${name}" modpath="$(libexecdir_relative)$${file}" >>$(SRC)/.apaci.install.conf; \
  329.         done; \
  330.         echo "" >>$(SRC)/.apaci.install.conf; \
  331.         echo "#  Reconstruction of the complete module list from all available modules" >>$(SRC)/.apaci.install.conf; \
  332.         echo "#  (static and shared ones) to achieve correct module execution order." >>$(SRC)/.apaci.install.conf; \
  333.         echo "#  [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]" >>$(SRC)/.apaci.install.conf; \
  334.         echo "ClearModuleList" >>$(SRC)/.apaci.install.conf; \
  335.         egrep "^[     ]*(Add|Shared)Module" $(SRC)/Configuration.apaci |\
  336.         sed    -e 's:SharedModule:AddModule:' \
  337.             -e 's:modules/[^/]*/::' \
  338.             -e 's:[     ]lib: mod_:' \
  339.             -e 's:\.[soam].*$$:.c:' >>$(SRC)/.apaci.install.conf; \
  340.     fi
  341.     @echo "<=== [programs]"
  342.  
  343. #   install the support programs and scripts
  344. install-support:
  345.     @echo "===> [support: Installing Apache support programs and scripts]"
  346.     $(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/ab $(root)$(sbindir)/ab
  347.     $(INSTALL_DATA) $(TOP)/$(SRC)/support/ab.8 $(root)$(mandir)/man8/ab.8
  348.     @if [ ".$(TARGET)" = .httpd ]; then \
  349.         apachectl='apachectl'; \
  350.     else \
  351.         apachectl="$(TARGET)ctl"; \
  352.     fi; \
  353.     echo "$(INSTALL_SCRIPT) $(TOP)/$(SRC)/support/apachectl[*] $(root)$(sbindir)/$${apachectl}"; \
  354.     sed -e 's;PIDFILE=.*;PIDFILE=$(runtimedir)/$(TARGET).pid;' \
  355.         -e 's;HTTPD=.*;HTTPD=$(sbindir)/$(TARGET);' \
  356.         < $(TOP)/$(SRC)/support/apachectl > $(TOP)/$(SRC)/.apaci.install.tmp && \
  357.         $(INSTALL_SCRIPT) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(sbindir)/$${apachectl}; \
  358.     echo "$(INSTALL_DATA) $(TOP)/$(SRC)/support/apachectl.8 $(root)$(mandir)/man8/$${apachectl}.8"; \
  359.     $(INSTALL_DATA) $(TOP)/$(SRC)/support/apachectl.8 $(root)$(mandir)/man8/$${apachectl}.8
  360.     $(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/htpasswd $(root)$(bindir)/htpasswd
  361.     $(INSTALL_DATA) $(TOP)/$(SRC)/support/htpasswd.1 $(root)$(mandir)/man1/htpasswd.1
  362.     $(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/htdigest $(root)$(bindir)/htdigest
  363.     $(INSTALL_DATA) $(TOP)/$(SRC)/support/htdigest.1 $(root)$(mandir)/man1/htdigest.1
  364.     @echo "$(INSTALL_SCRIPT) $(TOP)/$(SRC)/support/dbmmanage[*] $(root)$(bindir)/dbmmanage"; \
  365.     sed -e 's;^#!/.*;#!$(PERL);' \
  366.         < $(TOP)/$(SRC)/support/dbmmanage > $(TOP)/$(SRC)/.apaci.install.tmp && \
  367.         $(INSTALL_SCRIPT) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(bindir)/dbmmanage
  368.     $(INSTALL_DATA) $(TOP)/$(SRC)/support/dbmmanage.1 $(root)$(mandir)/man1/dbmmanage.1
  369.     $(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/logresolve $(root)$(sbindir)/logresolve
  370.     $(INSTALL_DATA) $(TOP)/$(SRC)/support/logresolve.8 $(root)$(mandir)/man8/logresolve.8
  371.     $(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/rotatelogs $(root)$(sbindir)/rotatelogs
  372.     $(INSTALL_DATA) $(TOP)/$(SRC)/support/rotatelogs.8 $(root)$(mandir)/man8/rotatelogs.8
  373.     @echo "$(INSTALL_SCRIPT) $(TOP)/$(SRC)/support/apxs[*] $(root)$(sbindir)/apxs"; \
  374.     sed -e 's;^#!/.*;#!$(PERL);' \
  375.         -e 's;\@prefix\@;$(prefix);' \
  376.         -e 's;\@sbindir\@;$(sbindir);' \
  377.         -e 's;\@libexecdir\@;$(libexecdir);' \
  378.         -e 's;\@includedir\@;$(includedir);' \
  379.         -e 's;\@sysconfdir\@;$(sysconfdir);' \
  380.         < $(TOP)/$(SRC)/support/apxs > $(TOP)/$(SRC)/.apaci.install.tmp && \
  381.         $(INSTALL_SCRIPT) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(sbindir)/apxs
  382.     $(INSTALL_DATA) $(TOP)/$(SRC)/support/apxs.8 $(root)$(mandir)/man8/apxs.8
  383.     -@if [ ".$(suexec)" = .1 ]; then \
  384.         echo "$(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/suexec $(root)$(sbindir)/suexec"; \
  385.         $(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/suexec $(root)$(sbindir)/suexec; \
  386.         echo "chown root $(root)$(sbindir)/suexec"; \
  387.         chown root $(root)$(sbindir)/suexec; \
  388.         echo "chmod 4711 $(root)$(sbindir)/suexec"; \
  389.         chmod 4711 $(root)$(sbindir)/suexec; \
  390.         echo "$(INSTALL_DATA) $(TOP)/$(SRC)/support/suexec.8 $(root)$(mandir)/man8/suexec.8"; \
  391.         $(INSTALL_DATA) $(TOP)/$(SRC)/support/suexec.8 $(root)$(mandir)/man8/suexec.8; \
  392.     fi
  393.     @echo "<=== [support]"
  394.  
  395. #   install the support programs and scripts for binary distribution
  396. install-binsupport:
  397.     @echo "===> [support: Installing Apache support programs and scripts for binary distribution]"
  398.     $(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/ab $(root)$(sbindir)/ab
  399.     $(INSTALL_DATA) $(TOP)/$(SRC)/support/ab.8 $(root)$(mandir)/man8/ab.8
  400.     @if [ ".$(TARGET)" = .httpd ]; then \
  401.         apachectl='apachectl'; \
  402.     else \
  403.         apachectl="$(TARGET)ctl"; \
  404.     fi; \
  405.     echo "$(INSTALL_SCRIPT) $(TOP)/$(SRC)/support/apachectl[*] $(root)$(sbindir)/$${apachectl}"; \
  406.     sed -e 's;PIDFILE=.*;PIDFILE=$(runtimedir)/$(TARGET).pid;' \
  407.         -e 's;HTTPD=.*;HTTPD=$(sbindir)/$(TARGET);' \
  408.         < $(TOP)/$(SRC)/support/apachectl > $(TOP)/$(SRC)/.apaci.install.tmp && \
  409.         $(INSTALL_SCRIPT) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(sbindir)/$${apachectl}; \
  410.     echo "$(INSTALL_DATA) $(TOP)/$(SRC)/support/apachectl.8 $(root)$(mandir)/man8/$${apachectl}.8"; \
  411.     $(INSTALL_DATA) $(TOP)/$(SRC)/support/apachectl.8 $(root)$(mandir)/man8/$${apachectl}.8
  412.     $(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/htpasswd $(root)$(bindir)/htpasswd
  413.     $(INSTALL_DATA) $(TOP)/$(SRC)/support/htpasswd.1 $(root)$(mandir)/man1/htpasswd.1
  414.     $(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/htdigest $(root)$(bindir)/htdigest
  415.     $(INSTALL_DATA) $(TOP)/$(SRC)/support/htdigest.1 $(root)$(mandir)/man1/htdigest.1
  416.     @echo "$(INSTALL_SCRIPT) $(TOP)/$(SRC)/support/dbmmanage[*] $(root)$(bindir)/dbmmanage"; \
  417.     $(INSTALL_SCRIPT) $(TOP)/$(SRC)/support/dbmmanage $(root)$(bindir)/dbmmanage
  418.     $(INSTALL_DATA) $(TOP)/$(SRC)/support/dbmmanage.1 $(root)$(mandir)/man1/dbmmanage.1
  419.     $(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/logresolve $(root)$(sbindir)/logresolve
  420.     $(INSTALL_DATA) $(TOP)/$(SRC)/support/logresolve.8 $(root)$(mandir)/man8/logresolve.8
  421.     $(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/rotatelogs $(root)$(sbindir)/rotatelogs
  422.     $(INSTALL_DATA) $(TOP)/$(SRC)/support/rotatelogs.8 $(root)$(mandir)/man8/rotatelogs.8
  423.     @echo "$(INSTALL_SCRIPT) $(TOP)/$(SRC)/support/apxs[*] $(root)$(sbindir)/apxs"; \
  424.     $(INSTALL_SCRIPT) $(TOP)/$(SRC)/support/apxs $(root)$(sbindir)/apxs
  425.     $(INSTALL_DATA) $(TOP)/$(SRC)/support/apxs.8 $(root)$(mandir)/man8/apxs.8
  426.     -@if [ ".$(suexec)" = .1 ]; then \
  427.         echo "$(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/suexec $(root)$(sbindir)/suexec"; \
  428.         $(INSTALL_PROGRAM) $(TOP)/$(SRC)/support/suexec $(root)$(sbindir)/suexec; \
  429.         echo "chown root $(root)$(sbindir)/suexec"; \
  430.         chown root $(root)$(sbindir)/suexec; \
  431.         echo "chmod 4711 $(root)$(sbindir)/suexec"; \
  432.         chmod 4711 $(root)$(sbindir)/suexec; \
  433.         echo "$(INSTALL_DATA) $(TOP)/$(SRC)/support/suexec.8 $(root)$(mandir)/man8/suexec.8"; \
  434.         $(INSTALL_DATA) $(TOP)/$(SRC)/support/suexec.8 $(root)$(mandir)/man8/suexec.8; \
  435.     fi
  436.     @echo "<=== [support]"
  437.  
  438. #   install the Apache C header files
  439. install-include:
  440.     @echo "===> [include: Installing Apache C header files]"
  441.     $(CP) $(TOP)/$(SRC)/include/*.h $(root)$(includedir)/
  442.     $(CP) $(TOP)/$(SRC)/lib/expat-lite/*.h $(root)$(includedir)/xml/
  443.     @osdir=`grep '^OSDIR=' $(TOP)/$(SRC)/Makefile.config | sed -e 's:^OSDIR=.*/os/:os/:'`; \
  444.         echo "$(CP) $(TOP)/$(SRC)/$${osdir}/os.h $(root)$(includedir)/"; \
  445.         $(CP) $(TOP)/$(SRC)/$${osdir}/os.h $(root)$(includedir)/; \
  446.         echo "$(CP) $(TOP)/$(SRC)/$${osdir}/os-inline.c $(root)$(includedir)/"; \
  447.         $(CP) $(TOP)/$(SRC)/$${osdir}/os-inline.c $(root)$(includedir)/
  448.     chmod 644 $(root)$(includedir)/*.h $(root)$(includedir)/xml/*.h
  449.     @echo "<=== [include]"
  450.  
  451. #   create an initial document root containing the Apache manual,
  452. #   icons and distributed CGI scripts.
  453. install-data:
  454.     @echo "===> [data: Installing initial data files]"
  455.     -@if [ -f $(root)$(htdocsdir)/index.html ] || [ -f $(root)$(htdocsdir)/index.html.en ]; then \
  456.         echo "[PRESERVING EXISTING DATA SUBDIR: $(root)$(htdocsdir)/]"; \
  457.     else \
  458.         echo "Copying tree $(TOP)/htdocs/ -> $(root)$(htdocsdir)/"; \
  459.         (cd $(TOP)/htdocs/ && $(TAR) $(TAROPT) - *) |\
  460.         (cd $(root)$(htdocsdir)/ && $(TAR) -xf -); \
  461.         find $(root)$(htdocsdir)/ -type d -exec chmod a+rx {} \; ; \
  462.         find $(root)$(htdocsdir)/ -type f -exec chmod a+r {} \; ; \
  463.     fi
  464.     -@if [ -f $(root)$(cgidir)/printenv ]; then \
  465.         echo "[PRESERVING EXISTING DATA SUBDIR: $(root)$(cgidir)/]"; \
  466.     else \
  467.         for script in printenv test-cgi; do \
  468.             cat $(TOP)/cgi-bin/$${script} |\
  469.             sed -e 's;^#!/.*perl;#!$(PERL);' \
  470.             > $(TOP)/$(SRC)/.apaci.install.tmp; \
  471.             echo "$(INSTALL_DATA) $(TOP)/conf/$${script}[*] $(root)$(cgidir)/$${script}"; \
  472.             $(INSTALL_DATA) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(cgidir)/$${script}; \
  473.         done; \
  474.     fi
  475.     @echo "Copying tree $(TOP)/icons/ -> $(root)$(iconsdir)/"; \
  476.     (cd $(TOP)/icons/ && $(TAR) $(TAROPT) - *) |\
  477.     (cd $(root)$(iconsdir)/ && $(TAR) -xf -); \
  478.     find $(root)$(iconsdir)/ -type d -exec chmod a+rx {} \; ;\
  479.     find $(root)$(iconsdir)/ -type f -exec chmod a+r {} \;
  480.     @echo "<=== [data]"
  481.  
  482. #   create the initial configuration by providing default files
  483. #   and initial config files while preserving existing ones.
  484. install-config:
  485.     @echo "===> [config: Installing Apache configuration files]"
  486.     -@for conf in httpd.conf access.conf srm.conf; do \
  487.         if [ .$$conf = .httpd.conf ]; then \
  488.             target_conf="$(TARGET).conf"; \
  489.         else \
  490.             target_conf="$$conf"; \
  491.         fi; \
  492.         if [ ".$(TARGET)" = .httpd ]; then \
  493.             target_prefix=""; \
  494.         else \
  495.             target_prefix="$(TARGET)_"; \
  496.         fi; \
  497.         (echo "##"; \
  498.          echo "## $${target_conf} -- Apache HTTP server configuration file"; \
  499.          echo "##"; \
  500.          echo ""; \
  501.          cat $(TOP)/conf/$${conf}-dist ) |\
  502.          sed -e '/# LoadModule/r $(TOP)/$(SRC)/.apaci.install.conf' \
  503.             -e 's;@@ServerRoot@@/htdocs;$(htdocsdir);' \
  504.             -e 's;@@ServerRoot@@/icons;$(iconsdir);' \
  505.             -e 's;@@ServerRoot@@/cgi-bin;$(cgidir);' \
  506.             -e 's;@@ServerRoot@@/proxy;$(proxycachedir);' \
  507.             -e 's;@@ServerRoot@@;$(prefix);g' \
  508.             -e 's;httpd\.conf;$(TARGET).conf;' \
  509.             -e 's;logs/accept\.lock;$(runtimedir)/$(TARGET).lock;' \
  510.             -e 's;logs/apache_runtime_status;$(runtimedir)/$(TARGET).scoreboard;' \
  511.             -e 's;logs/httpd\.pid;$(runtimedir)/$(TARGET).pid;' \
  512.             -e "s;logs/access_log;$(logfiledir)/$${target_prefix}access_log;" \
  513.             -e "s;logs/error_log;$(logfiledir)/$${target_prefix}error_log;" \
  514.             -e "s;logs/referer_log;$(logfiledir)/$${target_prefix}referer_log;" \
  515.             -e "s;logs/agent_log;$(logfiledir)/$${target_prefix}agent_log;" \
  516.             -e 's;conf/magic;$(sysconfdir)/magic;' \
  517.             -e 's;conf/mime\.types;$(sysconfdir)/mime.types;' \
  518.             -e 's;User nobody;User $(conf_user);' \
  519.             -e 's;Group #-1;Group $(conf_group);' \
  520.             -e 's;Port 80;Port $(conf_port);' \
  521.             -e 's;ServerAdmin you@your.address;ServerAdmin $(conf_serveradmin);' \
  522.             -e 's;ServerName new.host.name;ServerName $(conf_servername);' \
  523.             > $(TOP)/$(SRC)/.apaci.install.tmp && \
  524.         echo "$(INSTALL_DATA) $(TOP)/conf/$${conf}-dist[*] $(root)$(sysconfdir)/$${target_conf}.default"; \
  525.         $(INSTALL_DATA) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(sysconfdir)/$${target_conf}.default; \
  526.         if [ ! -f "$(root)$(sysconfdir)/$${target_conf}" ]; then \
  527.             echo "$(INSTALL_DATA) $(TOP)/conf/$${conf}-dist[*] $(root)$(sysconfdir)/$${target_conf}"; \
  528.             $(INSTALL_DATA) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(sysconfdir)/$${target_conf}; \
  529.         else \
  530.             echo "[PRESERVING EXISTING CONFIG FILE: $(root)$(sysconfdir)/$${target_conf}]"; \
  531.         fi; \
  532.     done
  533.     -@for conf in mime.types magic; do \
  534.         echo "$(INSTALL_DATA) $(TOP)/conf/$${conf} $(root)$(sysconfdir)/$${conf}.default"; \
  535.         $(INSTALL_DATA) $(TOP)/conf/$${conf} $(root)$(sysconfdir)/$${conf}.default; \
  536.         if [ ! -f "$(root)$(sysconfdir)/$${conf}" ]; then \
  537.             echo "$(INSTALL_DATA) $(TOP)/conf/$${conf} $(root)$(sysconfdir)/$${conf}"; \
  538.             $(INSTALL_DATA) $(TOP)/conf/$${conf} $(root)$(sysconfdir)/$${conf}; \
  539.         else \
  540.             echo "[PRESERVING EXISTING CONFIG FILE: $(root)$(sysconfdir)/$${conf}]"; \
  541.         fi; \
  542.     done
  543.     @echo "<=== [config]"
  544.  
  545.  
  546. ## ------------------------------------------------------------------
  547. ##                       Cleanup Targets
  548. ## ------------------------------------------------------------------
  549.  
  550. #   cleanup the source tree by removing anything which was
  551. #   created by the build target
  552. clean:
  553.     @echo "===> $(SRC)"
  554.     @$(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) clean-std $(clean-support)
  555.     @echo "<=== $(SRC)"
  556.     @$(RM) $(TOP)/$(SRC)/.apaci.build.ok
  557.  
  558. #   clean the standard stuff
  559. clean-std:
  560.     @cd $(TOP)/$(SRC); $(MAKE) $(MFLAGS) SDP=$(SRC)/ clean
  561.  
  562. #   clean additional support stuff
  563. clean-support:
  564.     @echo "===> $(SRC)/support"; \
  565.     cd $(TOP)/$(SRC)/support; $(MAKE) $(MFLAGS) clean; \
  566.     if [ ".$(suexec)" = .1 ]; then \
  567.         echo "$(RM) suexec"; \
  568.         $(RM) suexec; \
  569.     fi; \
  570.     echo "<=== $(SRC)/support"
  571.  
  572. #   cleanup the source tree by removing anything which was
  573. #   created by the configure step and the build target.
  574. #   When --shadow is used we just remove the complete shadow tree.
  575. distclean:
  576.     @if [ ".$(SRC)" = .src ]; then \
  577.         $(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) distclean-normal; \
  578.     else \
  579.         $(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) distclean-shadow; \
  580.     fi
  581.  
  582. distclean-normal:
  583.     @echo "===> $(SRC)"
  584.     @$(MAKE) -f $(TOP)/$(MKF) $(MFLAGS) $(MFWD) distclean-std $(distclean-support)
  585.     @echo "<=== $(SRC)"
  586.     -$(RM) $(SRC)/Configuration.apaci
  587.     -$(RM) $(SRC)/apaci
  588.     @$(RM) $(SRC)/.apaci.build.ok
  589.     -$(RM) Makefile
  590.     -$(RM) config.status
  591.  
  592. #   clean the standard stuff
  593. distclean-std:
  594.     @cd $(TOP)/$(SRC); $(MAKE) $(MFLAGS) SDP=$(SRC)/ distclean
  595.  
  596. distclean-support:
  597.     @echo "===> $(SRC)/support"; \
  598.     cd $(TOP)/$(SRC)/support; $(MAKE) $(MFLAGS) distclean; \
  599.     if [ ".$(suexec)" = .1 ]; then \
  600.         echo "$(RM) suexec"; \
  601.         $(RM) suexec; \
  602.     fi; \
  603.     echo "<=== $(SRC)/support"
  604.  
  605. distclean-shadow:
  606.     $(RM) -r $(SRC)
  607.     $(RM) $(TOP)/$(MKF)
  608.     -@if [ ".`ls $(TOP)/src.* 2>/dev/null`" = . ]; then \
  609.         echo "$(RM) Makefile"; \
  610.         $(RM) Makefile; \
  611.     fi
  612.  
  613.