Source

Apache HTTP Server / Makefile.in

Full commit

SUBDIRS = srclib os server modules support
CLEAN_SUBDIRS = test

PROGRAM_NAME         = $(progname)
PROGRAM_SOURCES      = modules.c
PROGRAM_LDADD        = $(EXTRA_LDFLAGS) $(HTTPD_LDFLAGS) \
                       $(PROGRAM_DEPENDENCIES) $(EXTRA_LIBS)
PROGRAM_DEPENDENCIES = \
  $(BUILTIN_LIBS) \
  $(MPM_LIB) \
  server/libmain.la \
  os/$(OS_DIR)/libos.la \
  $(AP_LIBS)

PROGRAMS        = $(PROGRAM_NAME)
TARGETS         = $(PROGRAMS) $(shared_build) $(other_targets)
PHONY_TARGETS   = $(srcdir)/buildmark.c
INSTALL_TARGETS = install-conf install-htdocs install-error install-icons \
	install-other install-cgi install-include install-suexec install-man \
	install-build

DISTCLEAN_TARGETS  = include/ap_config_auto.h include/ap_config_path.h \
	modules.c config.cache config.log config.status config_vars.mk
EXTRACLEAN_TARGETS = configure include/ap_config_auto.h.in generated_lists

include $(top_builddir)/build/rules.mk
include $(top_srcdir)/build/program.mk

install-conf:
	@echo Installing configuration files
	@test -d $(sysconfdir) || $(MKINSTALLDIRS) $(sysconfdir)
	@cd $(top_srcdir)/docs/conf; \
	for i in mime.types magic; do \
		$(INSTALL_DATA) $$i $(sysconfdir); \
	done; \
	for i in *-std* ssl.conf; do \
		[ -f $$i ] || continue; \
		( \
			n_lm=`awk 'BEGIN {n=0} /@@LoadModule@@/ {n+=1} END {print n}' < $$i`; \
			if test $$n_lm -eq 0 -o "x$(DSO_MODULES)" = "x"; then \
				sed -e 's#@@ServerRoot@@#$(prefix)#g' \
					-e 's#@@Port@@#$(PORT)#g' \
					-e '/@@LoadModule@@/d' \
					< $$i; \
			else \
				sed -n -e '/@@LoadModule@@/q' \
					-e 's#@@ServerRoot@@#$(prefix)#g' \
					-e 's#@@Port@@#$(PORT)#g' \
					-e 'p' \
					< $$i; \
				for j in $(DSO_MODULES) "^EOL^"; do \
					if test "x$$j" = "xssl"; then \
						echo "<IfDefine SSL>"; \
					fi; \
					if test $$j != "^EOL^"; then \
						echo "LoadModule $${j}_module modules/mod_$${j}.so"; \
					fi; \
					if test "x$$j" = "xssl"; then \
						echo "</IfDefine>"; \
					fi; \
				done; \
				sed -e '1,/@@LoadModule@@/d' \
					-e '/@@LoadModule@@/d' \
					-e 's#@@ServerRoot@@#$(prefix)#g' \
					-e 's#@@Port@@#$(PORT)#g' \
					< $$i; \
			fi \
		) > $(sysconfdir)/$$i; \
		chmod 0644 $(sysconfdir)/$$i; \
		file=`echo $$i|sed s/-std//`; \
		if [ "$$file" = "httpd.conf" ]; then \
			file=`echo $$file|sed s/.*.conf/$(PROGRAM_NAME).conf/`; \
		fi; \
		if test "$$file" != "$$i" && test ! -f $(sysconfdir)/$$file; then \
			$(INSTALL_DATA) $(sysconfdir)/$$i $(sysconfdir)/$$file; \
		fi; \
	done
	@if test -f "$(builddir)/envvars-std"; then \
	    cp -p envvars-std $(sbindir); \
	    if test ! -f $(sbindir)/envvars; then \
	        cp -p envvars-std $(sbindir)/envvars ; \
	    fi ; \
	fi

install-build:
	@echo Installing build system files 
	@test -d $(installbuilddir) || $(MKINSTALLDIRS) $(installbuilddir) 
	@sed 's#LIBTOOL = \(.*\)#LIBTOOL = $(SHELL) $(installbuilddir)/libtool $(LTFLAGS)#' \
	    config_vars.mk > $(installbuilddir)/config_vars.mk; \
	cp build/*.mk $(installbuilddir); \
	cp $(top_srcdir)/build/instdso.sh $(installbuilddir); \
	cp srclib/apr/libtool $(installbuilddir); \
	if test -f srclib/apr/shlibtool; then \
	    cp srclib/apr/shlibtool $(installbuilddir); \
	fi

htdocs-srcdir = $(top_srcdir)/docs/docroot

docs::
	mkdir -p ./docs/api
	srclib/apr/build/scandoc.pl -i./build/default.pl -p./docs/api/ ./include/*.h

dox::
	doxygen $(top_srcdir)/docs/doxygen.conf

install-htdocs:
	@echo Installing HTML documents
	@test -d $(htdocsdir) || $(MKINSTALLDIRS) $(htdocsdir)
	@test -d $(htdocs-srcdir) && (cd $(htdocs-srcdir) && cp -rp * $(htdocsdir))
	@test -d $(manualdir) || $(MKINSTALLDIRS) $(manualdir)
	@test -d $(top_srcdir)/docs/manual && (cd $(top_srcdir)/docs/manual && cp -rp * $(manualdir))
	@(cd $(htdocsdir) && find . -name "CVS" -print | xargs rm -rf {} \;)

install-error:
	@echo Installing error documents
	@test -d $(errordir) || $(MKINSTALLDIRS) $(errordir)
	@(cd $(top_srcdir)/docs/error && cp -rp * $(errordir))
	@(cd $(errordir) && find . -name "CVS" -print | xargs rm -rf {} \;)

install-icons:
	@echo Installing icons
	@test -d $(iconsdir) || $(MKINSTALLDIRS) $(iconsdir)
	@(cd $(top_srcdir)/docs/icons && cp -rp * $(iconsdir))
	@(cd $(iconsdir) && find . -name "CVS" -print | xargs rm -rf {} \;)

install-cgi:
	@echo Installing CGIs
	@test -d $(cgidir) || $(MKINSTALLDIRS) $(cgidir)
	@(cd $(top_srcdir)/docs/cgi-examples && cp -rp * $(cgidir))
	@(cd $(cgidir) && find . -name "CVS" -print | xargs rm -rf {} \;)

install-other:
	@test -d $(logfiledir) || $(MKINSTALLDIRS) $(logfiledir)
	@for ext in dll x; do \
		file=apachecore.$$ext; \
		if test -f $$file; then \
			cp -p $$file $(bindir); \
		fi; \
	done; \
	file=httpd.dll; \
	if test -f $$file; then \
		cp -p $$file $(bindir); \
	fi;

install-include:
	@echo Installing header files
	@test -d $(includedir)     || $(MKINSTALLDIRS) $(includedir)
	@cp -p include/*.h $(srcdir)/include/*.h $(includedir)
	@cp -p $(srcdir)/os/$(OS_DIR)/os.h $(includedir)
	@if test -f $(srcdir)/os/$(OS_DIR)/os-inline.c; then \
            cp -p $(srcdir)/os/$(OS_DIR)/os-inline.c $(includedir); \
        fi;
	@cp -p $(srcdir)/server/mpm/$(MPM_NAME)/*.h $(includedir)
	@cp -p $(srcdir)/modules/dav/main/mod_dav.h $(includedir)
	@cp -p $(srcdir)/modules/filters/mod_include.h $(includedir)
	@cp -p $(srcdir)/modules/generators/mod_cgi.h $(includedir)
	@cp -p $(srcdir)/modules/http/mod_core.h $(includedir)
	@cp -p $(srcdir)/modules/proxy/mod_proxy.h $(includedir)
	@cp -p $(srcdir)/modules/ssl/*.h $(includedir)
	@cp -p $(srcdir)/srclib/pcre/pcre*.h $(includedir)
	@cp -p $(srcdir)/srclib/apr/include/*.h $(includedir)
	@cp -p $(srcdir)/srclib/apr-util/include/*.h $(includedir)
	@cp -p $(srcdir)/os/$(OS_DIR)/*.h $(includedir)
	@chmod 644 $(includedir)/*.h

install-man:
	@echo Installing man pages
	@test -d $(mandir)      || $(MKINSTALLDIRS) $(mandir)
	@test -d $(mandir)/man1 || $(MKINSTALLDIRS) $(mandir)/man1
	@test -d $(mandir)/man8 || $(MKINSTALLDIRS) $(mandir)/man8
	@cp -p $(top_srcdir)/docs/man/*.1 $(mandir)/man1
	@cp -p $(top_srcdir)/docs/man/*.8 $(mandir)/man8

install-suexec:
	@if test -f $(builddir)/support/suexec; then \
            test -d $(sbindir) || $(MKINSTALLDIRS) $(sbindir); \
            $(INSTALL_PROGRAM) $(top_builddir)/support/suexec $(sbindir); \
            chmod 4755 $(sbindir)/suexec; \
	fi

suexec:
	cd support && $(MAKE) suexec

include $(top_srcdir)/os/os2/core.mk