## ## Makefile.apxs -- Build procedure for mod_ftp Apache module ## ## Do not build the Makefile.apxs makefile, run ./configure.apxs and build ## from the resulting Makefile ## # top_builddir and top_srcdir are misnomers, because build/*.mk scripts # expect each of them to be the parent of the build directory, and fail # to trust the installbuilddir. exp_installbuilddir=$(shell $(APXS) -q exp_installbuilddir) top_srcdir=$(installbuilddir)/.. top_builddir=$(installbuilddir)/.. ftp_builddir=. ftp_srcdir=. builddir=. srcdir=. awk=. SUBDIRS = modules/ftp CLEAN_SUBDIRS = TARGETS = INSTALL_TARGETS = install-conf install-ftpdocs install-include install-manual DISTCLEAN_TARGETS = config.apxs.log modules/ftp/ftp_config.h EXTRACLEAN_TARGETS = include $(exp_installbuilddir)/rules.mk x-local-distclean: rm -rf docs/manual/build docs/manual/style # Dang nabbit, these are stripped! Reconstitute them; rel_libexecdir=`echo $(exp_libexecdir) | sed -e "s#^$(prefix)/##;"` rel_sysconfdir=`echo $(exp_sysconfdir) | sed -e "s#^$(prefix)/##;"` rel_logfiledir=`echo $(exp_logfiledir) | sed -e "s#^$(prefix)/##;"` httpd_conffile=$(exp_sysconfdir)/$(progname).conf httpd_origconffile=$(exp_sysconfdir)/original/$(progname).conf exp_ftpdocsdir=$(exp_datadir)/ftpdocs FTPPORT=21 install-conf: @echo Installing configuration files @$(MKINSTALLDIRS) $(DESTDIR)$(exp_sysconfdir) \ $(DESTDIR)$(exp_sysconfdir)/original for i in $(DESTDIR)$(httpd_conffile) $(DESTDIR)$(httpd_origconffile); do \ if test -f $$i; then \ ($(awk) -f $(ftp_srcdir)/build/addloadexample.awk \ -v MODULE=ftp -v DSO=.so -v LIBPATH=$(rel_libexecdir) \ -v EXAMPLECONF=$(rel_sysconfdir)/extra/ftpd.conf \ < $$i > $$i.new && \ mv $$i $$i.bak && mv $$i.new $$i \ ) || true; \ fi; \ done @$(MKINSTALLDIRS) $(DESTDIR)$(exp_sysconfdir)/extra \ $(DESTDIR)$(exp_sysconfdir)/original/extra @cd $(ftp_srcdir)/docs/conf; \ for j in $(ftp_srcdir)/docs/conf; do \ cd $$j ; \ for i in extra/ftpd*.conf; do \ if test -f $$i; then \ sed -e '/^\#@@LoadFtpModules@@/d;' \ -e 's#@exp_ftpdocsdir@#$(exp_ftpdocsdir)#;' \ -e 's#@exp_runtimedir@#$(exp_runtimedir)#;' \ -e 's#@exp_sysconfdir@#$(exp_sysconfdir)#;' \ -e 's#@rel_sysconfdir@#$(rel_sysconfdir)#;' \ -e 's#@rel_logfiledir@#$(rel_logfiledir)#;' \ -e 's#@@FTPPort@@#$(FTPPORT)#;' \ < $$i > $(exp_sysconfdir)/original/$$i; \ chmod 0644 $(exp_sysconfdir)/original/$$i; \ if test ! -f $(exp_sysconfdir)/$$i; then \ cp $(exp_sysconfdir)/original/$$i \ $(exp_sysconfdir)/$$i; \ chmod 0644 $(exp_sysconfdir)/$$i; \ fi; \ fi; \ done ; \ done svnroot=http://svn.apache.org/repos/asf/httpd manualdir=$(ftp_srcdir)/docs/manual # Note; by default, make generate-docs rebuilds the local pages # To regenerate the installed pages (after using make install to # drop in the ftp content), simply # # make manualdir=/path/to/manual generate-docs # generate-docs: @if test ! -d $(manualdir)/build; then \ cd $(manualdir); \ svn export $(svnroot)/docs-build/trunk build; \ fi @if test ! -d $(manualdir)/style; then \ cd $(manualdir); \ svn export $(svnroot)/httpd/trunk/docs/manual/style; \ fi cd $(manualdir)/build; \ ./build.sh all generate-dox: cd $(ftp_srcdir); \ doxygen $(ftp_srcdir)/docs/doxygen-ftp.conf ftpdocs-srcdir = $(ftp_srcdir)/docs/ftproot install-ftpdocs: @if test -d $(DESTDIR)$(exp_ftpdocsdir); then \ echo "Preserving existing FTP documents"; \ else \ echo "Installing FTP documents"; \ $(MKINSTALLDIRS) $(DESTDIR)$(exp_ftpdocsdir) ; \ if test -d $(DESTDIR)$(ftpdocs-srcdir) && test "x$(RSYNC)" != "x" \ && test -x "$(RSYNC)" ; then \ $(RSYNC) --exclude .svn -rlpt --numeric-ids $(ftpdocs-srcdir)/ \ $(DESTDIR)$(exp_ftpdocsdir)/; \ else \ test -d $(ftpdocs-srcdir) && (cd $(ftpdocs-srcdir) \ && cp -rp * $(DESTDIR)$(exp_ftpdocsdir)) ; \ cd $(DESTDIR)$(exp_ftpdocsdir) && find . -name ".svn" -type d -print \ | xargs rm -rf 2>/dev/null || true; \ fi; \ fi install-manual: @echo Installing online manual @test -d $(DESTDIR)$(exp_manualdir) \ || $(MKINSTALLDIRS) $(DESTDIR)$(exp_manualdir) @if test "x$(RSYNC)" != "x" && test -x $(RSYNC) ; then \ $(RSYNC) --exclude .svn -rlpt --numeric-ids \ $(ftp_srcdir)/docs/manual/ $(DESTDIR)$(exp_manualdir)/; \ else \ cp -rp $(ftp_srcdir)/docs/manual/* $(DESTDIR)$(exp_manualdir)/ && \ find $(DESTDIR)$(exp_manualdir) -name ".svn" -type d -print \ | xargs rm -rf 2>/dev/null || true; \ fi install-include: @echo Installing header files @$(MKINSTALLDIRS) $(DESTDIR)$(exp_includedir) && \ cp $(ftp_srcdir)/include/mod_ftp.h $(DESTDIR)$(exp_includedir)/ && \ chmod 0644 $(DESTDIR)$(exp_includedir)/mod_ftp.h .PHONY: generate-dox generate-docs