RECURSIVE_MAKE_ARGS=$(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' CPPFLAGS='$(CPPFLAGS)'
DESTDIR=
SHELL = /bin/sh
LANG = C
LC_ALL = C
RM = rm -f
MAKEPATH=./lib-src/make-path
pwd = /bin/pwd
TAR = tar
CC=cc
CPP=cpp
LN_S=ln -s
CFLAGS=-Wall -Wno-switch -Wundef -Wsign-compare -Wno-char-subscripts -Wpacked -Wpointer-arith -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -g -O2 -pipe -I/usr/local/include/libpng16 -I/usr/local/include/freetype2 -fno-strict-aliasing -std=gnu89
CPPFLAGS=
LDFLAGS= 
version=21.5-b34
configuration=amd64--freebsd
PROGNAME=xemacs
SHEBANG_PROGNAME=xemacs-script
prefix=/usr/local
inststaticdir=${PROGNAME}
instvardir=${PROGNAME}-${version}
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
datarootdir=${prefix}/share
datadir=${datarootdir}
statedir=${prefix}/lib
libdir=${exec_prefix}/lib
mandir=/usr/local/man
manext=.1
infodir=/usr/local/lib/xemacs-21.5.34/info
infopath=/usr/local/info:/usr/local/share/texmf-dist/doc/info
srcdir=/var/ports/var/ports/homekxj/editors/xemacs-devel/work/xemacs-21.5.34
blddir=/var/ports/var/ports/homekxj/editors/xemacs-devel/work/xemacs-21.5.34
lispdir=${datadir}/${instvardir}/lisp
moduledir=${libdir}/${instvardir}/${configuration}/modules
sitelispdir=${datadir}/${inststaticdir}/site-lisp
sitemoduledir=${libdir}/${inststaticdir}/site-modules
buildlispdir=${srcdir}/lisp
etcdir=${datadir}/${instvardir}/etc
docdir=${archlibdir}
archlibdir=${libdir}/${instvardir}/${configuration}
INSTALL =  /usr/bin/install -c
INSTALL_PROGRAM = install   -m 555
INSTALL_DATA = install  -m 0644
MAKE_SUBDIR =  lib-src lwlib src
SUBDIR = ${MAKE_SUBDIR} man  
SUBDIR_MAKEFILES = lib-src/Makefile lib-src/GNUmakefile lwlib/Makefile lwlib/GNUmakefile src/Makefile src/GNUmakefile
INSTALL_ARCH_DEP_SUBDIR =  lib-src
COPYDIR = ${srcdir}/etc ${srcdir}/lisp
COPYDESTS = ${etcdir} ${lispdir}
GENERATED_HEADERS = src/paths.h src/Emacs.ad.h src/config.h lwlib/config.h src/sheap-adjust.h src/xemacs.def etc/PROBLEMS src/.gdbinit
all: Makefile ${GENERATED_HEADERS} ${MAKE_SUBDIR} info
.SUFFIXES:
.NO_PARALLEL: ${GENERATED_HEADERS} ${MAKE_SUBDIR}
.PHONY: ${SUBDIR} all beta
beta: elcclean update-version all
dist: all
.PHONY: config configure depend
config: configure depend
configure: ${srcdir}/configure ${srcdir}/lib-src/config.values.in
${srcdir}/configure : ${srcdir}/configure.ac
	cd ${srcdir} && autoconf
${srcdir}/lib-src/config.values.in : ${srcdir}/configure
	cd ${srcdir} && $(SHELL) lib-src/config.values.sh
depend ${srcdir}/src/depend:
	cd ./src && $(MAKE) $(RECURSIVE_MAKE_ARGS) depend
.PHONY: config-changed
config-changed:
	cd ./src && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@
.PHONY: check
check:
	cd ./src && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@
.PHONY: check-features
check-features: all
	cd ./src && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@
src/Emacs.ad.h: ${srcdir}/etc/Emacs.ad
	@echo "Producing \`src/Emacs.ad.h' from \`etc/Emacs.ad'."
	@$(RM) src/Emacs.ad.h
	@(echo "/*	Do not edit this file!" ; \
	  echo "  	Automatically generated from ${srcdir}/etc/Emacs.ad" ; \
	  echo " */" ; \
	  $(SHELL) ${srcdir}/lib-src/ad2c ${srcdir}/etc/Emacs.ad ) > \
	  src/Emacs.ad.h
src/sheap-adjust.h:
	@echo "Resetting \`src/sheap-adjust.h'."; \
	(echo "/*	Do not edit this file!" ; \
	 echo "  	Automatically generated by XEmacs */" ; \
	 echo "#define SHEAP_ADJUSTMENT 0") > $@
src:  lwlib FRC.src
pkg-src/tree-x: pkg-src/FRC.tree-x
lib-src: FRC.lib-src
lwlib:	FRC.lwlib
FRC.src FRC.lib-src FRC.lwlib pkg-src/FRC.tree-x:
FRC.lisp.finder-inf.el:
${SUBDIR}: ${SUBDIR_MAKEFILES} ${GENERATED_HEADERS} FRC
	cd ./$@ && $(MAKE) $(RECURSIVE_MAKE_ARGS) all
update-version:
	cp ${srcdir}/version.sh.in ${srcdir}/version.sh
	if test -d ${srcdir}/.hg; then \
	    (cd ${srcdir}; hg identify | cut -d " " -f 1 >> version.sh); \
	fi
modules/sample modules/ldap modules/zlib modules/base64: lib-src
modules/postgresql modules/canna: lib-src
Makefile: ${srcdir}/Makefile.in.in config.status
	./config.status
	$(MAKE) $(RECURSIVE_MAKE_ARGS) all
src/Makefile: ${srcdir}/src/Makefile.in.in ${srcdir}/src/depend config.status
	./config.status
lib-src/Makefile: ${srcdir}/lib-src/Makefile.in.in config.status
	./config.status
lwlib/Makefile: ${srcdir}/lwlib/Makefile.in.in config.status
	./config.status
pkg-src/tree-x/Makefile: ${srcdir}/pkg-src/tree-x/Makefile.in.in config.status
	./config.status
src/config.h: ${srcdir}/src/config.h.in
	./config.status && touch $@
src/paths.h: ${srcdir}/src/paths.h.in
	./config.status && touch $@
lwlib/config.h: ${srcdir}/lwlib/config.h.in
	./config.status && touch $@
src/xemacs.def: $(srcdir)/src/xemacs.def.in.in
	./config.status && touch $@
src/.gdbinit: ${srcdir}/src/.gdbinit.in.in
	./config.status && touch $@
etc/PROBLEMS: $(srcdir)/PROBLEMS
	cp $^ $@
.PHONY: install-only install install-arch-dep install-arch-indep gzip.el mkdir
install-only: ${MAKE_SUBDIR} check-features install-arch-dep install-arch-indep
install: all check-features install-arch-dep install-arch-indep
install-arch-dep: mkdir
	for subdir in ${INSTALL_ARCH_DEP_SUBDIR}; do \
	(cd ./$${subdir} && $(MAKE) $(RECURSIVE_MAKE_ARGS) install prefix=${prefix} \
	    exec_prefix=${exec_prefix} bindir=${bindir} libdir=${libdir} \
	    archlibdir=${archlibdir}) ; done
	if test "`(cd $(DESTDIR)${archlibdir} && $(pwd))`" != \
		"`(cd ./lib-src && $(pwd))`"; then \
	   if test -f ../Installation; then \
		${INSTALL_DATA} ../Installation $(DESTDIR)${archlibdir}/Installation; \
	   fi; \
	   ${INSTALL_DATA} lib-src/config.values $(DESTDIR)${docdir}/config.values; \
	   ${INSTALL_DATA} lib-src/DOC $(DESTDIR)${docdir}/DOC; \
	   for subdir in `find ${archlibdir} -type d ! -name RCS ! -name SCCS ! -name CVS -print` ; \
	     do (cd $${subdir} && $(RM) -r RCS CVS SCCS \#* *~) ; done ; \
	else true; fi
	${INSTALL_DATA} src/${PROGNAME}.dmp $(DESTDIR)${bindir}/${PROGNAME}-${version}-`src/${PROGNAME} -sd`.dmp
	${INSTALL_PROGRAM} src/${PROGNAME} $(DESTDIR)${bindir}/${PROGNAME}-${version}
	-chmod 0755 $(DESTDIR)${bindir}/${PROGNAME}-${version}
	cd $(DESTDIR)${bindir} && $(RM) ./${PROGNAME} && ${LN_S} ${PROGNAME}-${version} ./${PROGNAME}
	cd $(DESTDIR)${bindir} && $(RM) ./${SHEBANG_PROGNAME} && ${LN_S} ${PROGNAME}-${version} ./${SHEBANG_PROGNAME}
install-arch-indep: mkdir info
	-@set ${COPYDESTS} ; \
	 for dir in ${COPYDIR} ; do \
	   if test "`(cd $(DESTDIR)$$1 && $(pwd))`" != \
		   "`(cd $${dir} && $(pwd))`"; then \
	     : do nothing - echo "rm -rf $$1" ; \
	   fi ; \
	   shift ; \
	 done
	-set ${COPYDESTS} ; \
	 for dir in ${COPYDESTS} ; do \
	   if test ! -d $${dir} ; then mkdir $(DESTDIR)$${dir} ; fi ; \
	 done ; \
	 for dir in ${COPYDIR} ; do \
	   dest=$$1 ; shift ; \
	   test -d $${dir} \
	     -a "`(cd $${dir} && $(pwd))`" != \
		"`(cd $(DESTDIR)$${dest} && $(pwd))`" \
	   && (echo "Copying $${dir}..." ; \
	       (cd $${dir} && $(TAR) -cf - . ) | \
		(cd $(DESTDIR)$${dest} && umask 022 && $(TAR) -xf - );\
	       chmod 0755 $(DESTDIR)$${dest}; \
	       for subdir in `find $(DESTDIR)$${dest} -type d ! -name RCS ! -name SCCS ! -name CVS -print` ; do \
		 (cd $${subdir} && $(RM) -r RCS CVS SCCS \#* *~) ; \
	       done) ; \
	 done
	if test "`(cd ${srcdir}/info && $(pwd))`" != \
		"`(cd $(DESTDIR)${infodir} && $(pwd))`" && cd ${srcdir}/info; then \
	  if test ! -f $(DESTDIR)${infodir}/dir -a -f dir ; then \
	    ${INSTALL_DATA} ${srcdir}/info/dir $(DESTDIR)${infodir}/dir ; \
	  fi ; \
	  for file in *.info* ; do \
	    ${INSTALL_DATA} $${file} $(DESTDIR)${infodir}/$${file} ; \
	    chmod 0644 $(DESTDIR)${infodir}/$${file}; \
	  done ; \
	fi
	cd ${srcdir}/etc && \
	  for page in xemacs etags ctags gnuserv gnuclient gnuattach gnudoit; do \
	    ${INSTALL_DATA} ${srcdir}/etc/$${page}.1 $(DESTDIR)${mandir}/$${page}${manext} ; \
	    chmod 0644 $(DESTDIR)${mandir}/$${page}${manext} ; \
	  done
	@echo "If you would like to save approximately 4M of disk space, do"
	@echo "make gzip-el"
	@echo "or you may run "
	@echo ${srcdir}/lib-src/gzip-el.sh lispdir " from the command line."
	@echo "Where lispdir is where the lisp files were installed, i.e.,"
	@echo "${lispdir}"
gzip-el:
	$(SHELL) ${srcdir}/lib-src/gzip-el.sh $(DESTDIR)${lispdir}
mkdir: FRC.mkdir
	for dir in \
	    ${COPYDESTS} ${docdir} ${infodir} ${archlibdir} \
	    ${mandir} ${bindir} ${datadir} ${libdir} \
	    ${sitelispdir} ; \
	do \
	    ${MAKEPATH} $(DESTDIR)$${dir} ; \
	done ;
package_path = /usr/local/share/xemacs
pkgsrcdir = ${srcdir}/etc/bundled-packages
check-available-packages:
	@if test -r ${pkgsrcdir}/bootstrap.tar.gz; \
	then echo "To install a set of bootstrap packages in"; \
	     echo "${package_path}/xemacs-packages, type:"; \
	     echo "  make install-bootstrap-packages"; \
	fi; \
	if test -r ${pkgsrcdir}/xemacs-sumo.tar.gz; \
	then echo "To install the full set of non-mule packages in"; \
	     echo "${package_path}/xemacs-packages, type:"; \
	     echo "  make install-nonmule-packages"; \
	fi; \
	if test -r ${pkgsrcdir}/xemacs-mule-sumo.tar.gz; \
	then echo "To install the full set of packages with mule in"; \
	     echo "${package_path}/mule-packages, type:"; \
	     echo "  make install-all-packages"; \
	fi
mkpkgdir: FRC.mkdir ${MAKEPATH}
	@if test -z ${package_path}; \
	then echo "Not configured --with-late-packages; no place to install."; \
		exit -1; \
	elif echo ${package_path} | grep ":"; \
	then echo "Configured with multiple late package directories; you decide where to install."; \
		exit -1; \
	elif test -e ${package_path}/xemacs-packages \
		-o -e ${package_path}/mule-packages; \
	then echo "${package_path} is installed; won't overwrite packages."; \
		exit -1; \
	fi
	${MAKEPATH} ${package_path};
install-bootstrap-packages: mkpkgdir
	cd ${package_path}; tar xvzf ${pkgsrcdir}/bootstrap.tar.gz
install-nonmule-packages: mkpkgdir
	cd ${package_path}; tar xvzf ${pkgsrcdir}/xemacs-sumo.tar.gz
install-all-packages: mkpkgdir
	cd ${package_path}; tar xvzf ${pkgsrcdir}/xemacs-sumo.tar.gz; \
	cd ${package_path}; tar xvzf ${pkgsrcdir}/xemacs-mule-sumo.tar.gz
FRC FRC.src.paths.h FRC.mkdir FRC.dump-elcs FRC.info:
FRC.mostlyclean FRC.clean FRC.distclean FRC.realclean FRC.extraclean FRC.tags:
FRC.distclean-noconfig FRC.realclean-noconfig FRC.extraclean-noconfig:
.PHONY: mostlyclean clean distclean realclean extraclean elcclean
.PHONY: distclean-noconfig realclean-noconfig extraclean-noconfig
.PHONY: top-mostlyclean top-clean top-distclean top-realclean top-extraclean
.PHONY: top-distclean-noconfig top-realclean-noconfig top-extraclean-noconfig
top-mostlyclean: FRC.mostlyclean
	-$(RM) core
mostlyclean: top-mostlyclean
	for d in $(SUBDIR); do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
top-clean: FRC.clean
	-$(RM) core lisp/auto-autoloads.el* lisp/custom-load.el*
	-$(RM) lisp/mule/auto-autoloads.el* lisp/mule/custom-load.el*
	-$(RM) modules/auto-autoloads.el* modules/custom-load.el*
	-$(RM) etc/PROBLEMS
clean: top-mostlyclean top-clean
	for d in $(SUBDIR); do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
top-distclean-noconfig: FRC.distclean-noconfig
	-$(RM) TAGS .sbinit lock/* lisp/finder-inf.el*
distclean-noconfig: top-mostlyclean top-clean top-distclean-noconfig
	for d in $(SUBDIR); do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
top-distclean: FRC.distclean
	-$(RM) config.status config.log confdefs.h config-tmp-* build-install Installation
	-$(RM) GNUmakefile Makefile Makefile.in
	-$(RM) Installation.el Installation.elc
distclean: top-mostlyclean top-clean top-distclean-noconfig top-distclean
	for d in $(SUBDIR); do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
top-realclean-noconfig: FRC.realclean-noconfig
	-$(RM) *.elc lisp/*.elc lisp/mule/*.elc lisp/term/*.elc modules/*.elc
realclean-noconfig: top-mostlyclean top-clean top-distclean-noconfig top-realclean-noconfig
	for d in $(SUBDIR); do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
top-realclean: FRC.realclean
elcclean: realclean-noconfig
realclean: top-mostlyclean top-clean top-distclean-noconfig top-distclean top-realclean-noconfig top-realclean
	for d in $(SUBDIR); do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
top-extraclean-noconfig: FRC.extraclean-noconfig
	-$(RM) *~ \#*
extraclean-noconfig: top-mostlyclean top-clean top-distclean-noconfig top-realclean-noconfig top-extraclean-noconfig
	for d in $(SUBDIR); do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
top-extraclean: FRC.extraclean
extraclean: top-mostlyclean top-clean top-distclean-noconfig top-distclean top-realclean-noconfig top-realclean top-extraclean-noconfig top-extraclean
	for d in $(SUBDIR); do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
SOURCES = ChangeLog INSTALL Makefile.in.in PROBLEMS \
	README build-install.in configure make-dist move-if-change
.PHONY: unlock relock TAGS tags dist info dvi mcs
unlock:
	chmod u+w $(SOURCES) cpp/*
	-cd ./elisp && chmod u+w Makefile README *.texi
	for d in src etc lib-src lisp; do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
	cd ./lisp/term && chmod u+w README *.el
	cd ./man && chmod u+w *texi* ChangeLog split-man
	cd ./lwlib && chmod u+w *.[ch] Makefile.in.in
relock:
	chmod u-w $(SOURCES) cpp/*
	-cd ./elisp && chmod u-w Makefile README *.texi
	for d in src etc lib-src lisp; do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
	cd ./lisp/term && chmod u+w README *.el
	cd ./man && chmod u+w *texi* ChangeLog split-man
	cd ./lwlib && chmod u+w *.[ch] Makefile.in.in
PRUNE_VC = -name SCCS -prune -o -name RCS -prune -o -name CVS -prune -o
tagslisp = lisp
TAGS tags: FRC.tags
	@echo "If you don't have a copy of etags around, then do 'make lib-src' first."
	-$(RM) ${srcdir}/TAGS
	@PATH=`$(pwd)`/lib-src:$$PATH HOME=/-=-; export PATH HOME; \
	  echo "Using etags from `which etags`."
	PATH=`$(pwd)`/lib-src:$$PATH ; export PATH; cd ${srcdir} && \
	find src lwlib lib-src modules ${PRUNE_VC} -name '*.[ch]' -print | \
	  xargs etags -a \
		-r '/[ 	]*DEF\(VAR\|INE\)_[A-Z_]+[ 	]*([ 	]*"\([^"]+\)"/\2/' \
	        -r '/^DEFUN[	]*([	]*"\([^"]+\)"[	]*,[ 	]*\([A-Za-z0-9_]+\)/\2/'; \
	find ${tagslisp} ${PRUNE_VC} -name '*.el' ! -name 'auto-autoloads.el' -print | \
	  xargs etags -a -l none -r "/^(def\\(var\\|un\\|alias\\|const\\|macro\\|subst\\|struct\\|face\\|group\\|custom\\|ine-\\(function\\|compiler-macro\\|[a-z-]+alias\\)\\)[ 	]+'?\\([^ 	]+\\)/\\3/"
info: FRC.info
	cd ${srcdir}/man && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@
dvi:
	cd ${srcdir}/man && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@
mcs:
	date=`LANG=C LC_ALL=C date -u '+%e %b %Y'`; \
	ident="@(#)RELEASE VERSION XEmacs ${version} $${date}"; \
	for f in `file lib-src/* src/${PROGNAME} | grep ELF | sed -e 's/:.*//'`; do \
	  mcs -da "$${ident} `echo $${f} | sed 's/.*\///'`" $${f}; \
	done
.PHONY: fix-perms
FRC.fix-perms:
fix-perms: FRC.fix-perms
	cd ${srcdir} && sh lib-src/fix-perms.sh
