# Two describe facilities are supported:  One using the describe
# command within maxima, and ther other using DOC files inside
# gnu emacs

LOCALBIN=/usr/local/bin
# begin makedefs
MAXDIR = /usr/public/maxima
KCLDO = /public/akcl/o/
KCLDLSP = /public/akcl/lsp/
KCLDCMP = /public/akcl/cmpnew/
MAXSRC = ../src/
AKCLDIR=/usr/public/akcl
SHELL=/bin/sh
MACHINE=hp300-bsd

# Machine dependent makefile definitions for hp300 running 4.3bsd(mt xinu)

LBINDIR=/usr/local/bin

OFLAG	=  -O 
LIBS	= -lm -lg 
ODIR_DEBUG= -g

# This CC string will be used for compilation of the system,
# and also in the compiler::*cc* variable for later compilation of
# lisp files.

CC = gcc -fwritable-strings -msoft-float -DVOL=volatile -I$(AKCLDIR)/o 
MAINDIR = /public/kcl

# Enable the fastloading mechanism which does not use ld -A
# requires c/rel_.. machine dependent code.

RSYM	= rsym
SFASL	= $(ODIR)/sfasl.o

#  Use the mp.s file on 68k machine 

MPFILES= $(MPDIR)/mpi-bsd68k.o   $(MPDIR)/libmport.a


# When using SFASL it is good to have (si::build-symbol-table)
INITFORM=(si::build-symbol-table)

# Use symbolic links
SYMB=-s

LIBFILES=bsearch.o

# the  make to use for saved_kcp the profiler.
KCP=kcp-bsd

KCLDIR = /public/akcl
# end makedefs

# A directory on peoples search path.


FILES= print_doc.c edoc find-doc.el makefile

all:	
	make macsym-index.LISP
	make DOC-keys.el
	make install "LBINDIR=$(LBINDIR)

install: current-emacs-path print_doc edoc DOC-keys.el
	cp edoc $(LBINDIR)	
	cp find-doc.el `cat emacs-path`


$(LBINDIR)/print_doc: print_doc.c
	$(CC) -o $(LBINDIR)/print_doc print_doc.c

print_doc: print_doc.c
	$(CC) -o print_doc print_doc.c
	mv print_doc $(LBINDIR)/print_doc


DOC-keys.el: DOC
	echo '(load "find-doc")(snarf-doc "DOC")' > tmp.el~
	emacs -batch -l tmp.el~ 	
	rm -f lsp/tmp.el~

current-emacs-path:
	echo '(generate-new-buffer "emacs-path")' \
	'(insert (nth (1- (length load-path)) load-path))' \
	'(write-file "emacs-path")' > tmp.el~
	emacs -batch -l tmp.el~

macsym-index.LISP: macsym.doc ../src/macdes.lisp
	echo '(in-package "MAXIMA")(maxima::set-up-index "$(MAXDIR)/doc/macsym.doc" :make-new-one t)' | ../unixport/saved_maxima ../unixport/

