## -*- Mode: Makefile -*-
## 
## $Source: /n/flamingo/y/soar/projects/hucka/sde/RCS/Makefile,v $
## $Id: Makefile,v 0.6 1994/06/08 17:34:15 hucka Exp hucka $
## 
## Description       : Makefile for SDE
## Original author(s): Michael Hucka <hucka@pelican.eecs.umich.edu>
## Organization      : University of Michigan AI Lab
## 
## To use this makefile, first check the name of your emacs.  Then:
##
## 1) If the name of your emacs executable is the same as the
##    value of the definition of "EMACS" below, then you can make
##    this system by simply cd-ing to the directory of this file and
##    typing "make" in a shell.
##
## 2) If the name of your emacs executable is different, then
##    can make this system by typing
##               make EMACS=xxxx
##    where "xxxx" is the name of your emacs executable.

EMACS   = emacs

################### No user-modifiable parts beyond this point ###############

#-----------------------------------------------------------------------------
# Files that comprise the package.
#
# Note to maintainers: the file sde-maint.el also has lists of the files that
# make up SDE.  This is a maintenance concern, because it means the lists in
# both places must be kept up-to-date and synchronized, but it's the only
# solution I've found so far.  This makefile lists the files so that the
# package can be constructed; most of the work of building SDE is done by
# sde-maint.el.
#-----------------------------------------------------------------------------

SOURCES = sde-basics.el \
	  sde-comment.el \
	  sde-compat.el \
	  sde-data.el \
	  sde-emacs19.el \
	  sde-feedback.el \
	  sde-find.el \
	  sde-first.el \
	  sde-header.el \
	  sde-help.el \
	  sde-indent.el \
	  sde-last.el \
	  sde-lemacs.el \
	  sde-maint.el \
	  sde-misc.el \
	  sde-next-match.el \
	  sde-repos.el \
	  sde-search.el \
	  sde-site.el \
	  sde-soar-mode.el \
	  sde-vars.el \
	  sde-version.el \
	  sde-window-support.el \
          completer.el \
	  conversion.el \
	  easymenu.el \
	  header.el \
	  powerkey.el \
	  tagify.el \
          stags.c

MANUAL  = manual/README \
	  manual/bk11.sty \
	  manual/book.sty \
	  manual/format.sty \
	  manual/fullpage.sty \
	  manual/latexinfo.sty \
	  manual/sde.info \
	  manual/sde.ps \
	  manual/sde.tex

MISC 	= ANNOUNCEMENT \
	  COPYING \
	  Makefile \
	  README \
	  sde-refcard.ps \
	  completer.lcd \
	  conversion-notes.txt

#-----------------------------------------------------------------------------
# Basic rules & actions.
#-----------------------------------------------------------------------------

.SUFFIXES: .elc .el .tar .Z .uu .c

all:	clean compile stags tags permissions links notices

compile:
	@echo "Compiling SDE files..."
	${EMACS} -batch -q -l sde-maint.el -f sde-maint-compile-distribution	
	@echo "Building sde.elc..."
	@cat sde-first.elc sde-vars.elc sde-basics.elc sde-data.elc sde-version.elc > sde.elc
	$(EMACS) -batch -q -l sde-maint.el -f sde-maint-print-autoloads >> sde.elc
	@cat sde-last.elc >> sde.elc

permissions:
	chmod a+r * */*

links:
	ln -s manual/sde.info sde.info

notices:
	@echo ""
	@echo "Finished compiling SDE."
	@echo "Don't forget to update \"sde-site.el\" for your installation."
	@echo ""

package: ${SOURCES} ${MANUAL} ${MISC}
	rm -f sde.tar sde.tar.Z
	/bin/tar cLf sde.tar ${SOURCES} ${MANUAL} ${MISC}
	compress sde.tar

tags:
	etags *.el *.c

clean:
	rm -f *.elc stags


#-----------------------------------------------------------------------------
# Special rules. 
#-----------------------------------------------------------------------------

stags: stags.c
	cc -DETAGS stags.c -o stags

